Fix ECDH detection, add ECDH keyid test.
[openssl.git] / apps / passwd.c
index 5ff53b5743c6f7edb05cd993790a37260f949ed3..2814b32c75e5a0a07c532163357cf757cb25dcdd 100644 (file)
@@ -273,10 +273,8 @@ int MAIN(int argc, char **argv)
         OPENSSL_free(salt_malloc);
     if (passwd_malloc)
         OPENSSL_free(passwd_malloc);
-    if (in)
-        BIO_free(in);
-    if (out)
-        BIO_free_all(out);
+    BIO_free(in);
+    BIO_free_all(out);
     apps_shutdown();
     OPENSSL_EXIT(ret);
 }
@@ -416,7 +414,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
                 if (*salt_malloc_p == NULL)
                     goto err;
             }
-            if (RAND_pseudo_bytes((unsigned char *)*salt_p, 2) < 0)
+            if (RAND_bytes((unsigned char *)*salt_p, 2) <= 0)
                 goto err;
             (*salt_p)[0] = cov_2char[(*salt_p)[0] & 0x3f]; /* 6 bits */
             (*salt_p)[1] = cov_2char[(*salt_p)[1] & 0x3f]; /* 6 bits */
@@ -437,7 +435,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
                 if (*salt_malloc_p == NULL)
                     goto err;
             }
-            if (RAND_pseudo_bytes((unsigned char *)*salt_p, 8) < 0)
+            if (RAND_bytes((unsigned char *)*salt_p, 8) <= 0)
                 goto err;
 
             for (i = 0; i < 8; i++)