diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_mutl.c')
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_mutl.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_mutl.c b/src/lib/libcrypto/pkcs12/p12_mutl.c index 9ab740d51f..96de1bd11e 100644 --- a/src/lib/libcrypto/pkcs12/p12_mutl.c +++ b/src/lib/libcrypto/pkcs12/p12_mutl.c | |||
@@ -97,10 +97,14 @@ int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, | |||
97 | return 0; | 97 | return 0; |
98 | } | 98 | } |
99 | HMAC_CTX_init(&hmac); | 99 | HMAC_CTX_init(&hmac); |
100 | HMAC_Init_ex(&hmac, key, md_size, md_type, NULL); | 100 | if (!HMAC_Init_ex(&hmac, key, md_size, md_type, NULL) |
101 | HMAC_Update(&hmac, p12->authsafes->d.data->data, | 101 | || !HMAC_Update(&hmac, p12->authsafes->d.data->data, |
102 | p12->authsafes->d.data->length); | 102 | p12->authsafes->d.data->length) |
103 | HMAC_Final(&hmac, mac, maclen); | 103 | || !HMAC_Final(&hmac, mac, maclen)) |
104 | { | ||
105 | HMAC_CTX_cleanup(&hmac); | ||
106 | return 0; | ||
107 | } | ||
104 | HMAC_CTX_cleanup(&hmac); | 108 | HMAC_CTX_cleanup(&hmac); |
105 | return 1; | 109 | return 1; |
106 | } | 110 | } |