Fix for previous patch: If RAND_pseudo_bytes returns 0, this is not an error.
[openssl.git] / crypto / pem / pem_lib.c
index b19ad2c8184ab2cb4c915699072278cdca7a7b11..b5e0a650f8ded59bb8c06c06e46dc8b73d942a62 100644 (file)
@@ -373,7 +373,7 @@ int PEM_ASN1_write_bio(int (*i2d)(), const char *name, BIO *bp, char *x,
                        kstr=(unsigned char *)buf;
                        }
                RAND_add(data,i,0);/* put in the RSA key. */
-               if (RAND_pseudo_bytes(iv,8) <= 0)       /* Generate a salt */
+               if (RAND_pseudo_bytes(iv,8) < 0)        /* Generate a salt */
                        goto err;
                /* The 'iv' is used as the iv and as a salt.  It is
                 * NOT taken from the BytesToKey function */