diff options
author | Richard Levitte <levitte@openssl.org> | 2000-03-07 22:35:27 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-03-07 22:35:27 +0000 |
commit | 3bf7ef5389168cbbef2ae2a0409d96716f73f8e0 (patch) | |
tree | b085c915a5d81e1b4c907111741ffb288f44a35e /crypto/pkcs12 | |
parent | f71732627a9f528a4966e55853bdf88aec207fae (diff) |
Check that a password was actually passed, or the user will just get
mysterious crashes.
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r-- | crypto/pkcs12/p12_key.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c index 02fdd20e2f..b364671ed2 100644 --- a/crypto/pkcs12/p12_key.c +++ b/crypto/pkcs12/p12_key.c @@ -104,6 +104,14 @@ int PKCS12_key_gen_uni (unsigned char *pass, int passlen, unsigned char *salt, #ifdef DEBUG_KEYGEN unsigned char *tmpout = out; int tmpn = n; +#endif + + if (!pass) { + PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + +#ifdef DEBUG_KEYGEN fprintf(stderr, "KEYGEN DEBUG\n"); fprintf(stderr, "ID %d, ITER %d\n", id, iter); fprintf(stderr, "Password (length %d):\n", passlen); |