diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_crpt.c')
| -rw-r--r-- | src/lib/libcrypto/pkcs12/p12_crpt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_crpt.c b/src/lib/libcrypto/pkcs12/p12_crpt.c index 6de6f8128f..97be6a5fb5 100644 --- a/src/lib/libcrypto/pkcs12/p12_crpt.c +++ b/src/lib/libcrypto/pkcs12/p12_crpt.c | |||
| @@ -64,17 +64,19 @@ | |||
| 64 | 64 | ||
| 65 | void PKCS12_PBE_add(void) | 65 | void PKCS12_PBE_add(void) |
| 66 | { | 66 | { |
| 67 | #ifndef NO_RC4 | 67 | #ifndef OPENSSL_NO_RC4 |
| 68 | EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC4, EVP_rc4(), EVP_sha1(), | 68 | EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC4, EVP_rc4(), EVP_sha1(), |
| 69 | PKCS12_PBE_keyivgen); | 69 | PKCS12_PBE_keyivgen); |
| 70 | EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC4, EVP_rc4_40(), EVP_sha1(), | 70 | EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC4, EVP_rc4_40(), EVP_sha1(), |
| 71 | PKCS12_PBE_keyivgen); | 71 | PKCS12_PBE_keyivgen); |
| 72 | #endif | 72 | #endif |
| 73 | #ifndef OPENSSL_NO_DES | ||
| 73 | EVP_PBE_alg_add(NID_pbe_WithSHA1And3_Key_TripleDES_CBC, | 74 | EVP_PBE_alg_add(NID_pbe_WithSHA1And3_Key_TripleDES_CBC, |
| 74 | EVP_des_ede3_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); | 75 | EVP_des_ede3_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); |
| 75 | EVP_PBE_alg_add(NID_pbe_WithSHA1And2_Key_TripleDES_CBC, | 76 | EVP_PBE_alg_add(NID_pbe_WithSHA1And2_Key_TripleDES_CBC, |
| 76 | EVP_des_ede_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); | 77 | EVP_des_ede_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); |
| 77 | #ifndef NO_RC2 | 78 | #endif |
| 79 | #ifndef OPENSSL_NO_RC2 | ||
| 78 | EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC2_CBC, EVP_rc2_cbc(), | 80 | EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC2_CBC, EVP_rc2_cbc(), |
| 79 | EVP_sha1(), PKCS12_PBE_keyivgen); | 81 | EVP_sha1(), PKCS12_PBE_keyivgen); |
| 80 | EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(), | 82 | EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(), |
| @@ -83,7 +85,7 @@ EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(), | |||
| 83 | } | 85 | } |
| 84 | 86 | ||
| 85 | int PKCS12_PBE_keyivgen (EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 87 | int PKCS12_PBE_keyivgen (EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
| 86 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, int en_de) | 88 | ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, int en_de) |
| 87 | { | 89 | { |
| 88 | PBEPARAM *pbe; | 90 | PBEPARAM *pbe; |
| 89 | int saltlen, iter; | 91 | int saltlen, iter; |
| @@ -115,7 +117,7 @@ int PKCS12_PBE_keyivgen (EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
| 115 | return 0; | 117 | return 0; |
| 116 | } | 118 | } |
| 117 | PBEPARAM_free(pbe); | 119 | PBEPARAM_free(pbe); |
| 118 | EVP_CipherInit(ctx, cipher, key, iv, en_de); | 120 | EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, en_de); |
| 119 | memset(key, 0, EVP_MAX_KEY_LENGTH); | 121 | memset(key, 0, EVP_MAX_KEY_LENGTH); |
| 120 | memset(iv, 0, EVP_MAX_IV_LENGTH); | 122 | memset(iv, 0, EVP_MAX_IV_LENGTH); |
| 121 | return 1; | 123 | return 1; |
