'passwd' tool.
[openssl.git] / apps / enc.c
index e584241bf1d2cf6c2caa61a41338bfeed3ff5f2e..0beb6377d7a873699cde067f85d01c326fa69a76 100644 (file)
@@ -245,7 +245,7 @@ bad:
                        BIO_printf(bio_err,"rc2     :128 bit key RC2 encryption\n");
 #endif
 #ifndef NO_BF
-                       BIO_printf(bio_err,"bf      :128 bit key BlowFish encryption\n");
+                       BIO_printf(bio_err,"bf      :128 bit key Blowfish encryption\n");
 #endif
 #ifndef NO_RC4
                        BIO_printf(bio_err," -%-5s :128 bit key RC4 encryption\n",
@@ -448,7 +448,8 @@ bad:
                                                                "invalid hex salt value\n");
                                                        goto end;
                                                }
-                                       } else RAND_bytes(salt, PKCS5_SALT_LEN);
+                                       } else if (RAND_pseudo_bytes(salt, PKCS5_SALT_LEN) < 0)
+                                               goto end;
                                        /* If -P option then don't bother writing */
                                        if((printkey != 2)
                                           && (BIO_write(wbio,magic,
@@ -563,6 +564,7 @@ bad:
                BIO_printf(bio_err,"bytes written:%8ld\n",BIO_number_written(out));
                }
 end:
+       ERR_print_errors(bio_err);
        if (strbuf != NULL) Free(strbuf);
        if (buff != NULL) Free(buff);
        if (in != NULL) BIO_free(in);