aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12/p12_mutl.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2001-07-30 23:57:25 +0000
committerBen Laurie <ben@openssl.org>2001-07-30 23:57:25 +0000
commitdbad169019598981174ff46c7a9bf58373b0e53a (patch)
treece8ca1188d5614648f24b03967785543f1edc8f5 /crypto/pkcs12/p12_mutl.c
parent3ba5d1cf2eb6ef28ac5f6d9f3d28020d00c5be50 (diff)
downloadopenssl-dbad169019598981174ff46c7a9bf58373b0e53a.tar.gz
Really add the EVP and all of the DES changes.
Diffstat (limited to 'crypto/pkcs12/p12_mutl.c')
-rw-r--r--crypto/pkcs12/p12_mutl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/pkcs12/p12_mutl.c b/crypto/pkcs12/p12_mutl.c
index f67715e869..2e1b7d874f 100644
--- a/crypto/pkcs12/p12_mutl.c
+++ b/crypto/pkcs12/p12_mutl.c
@@ -71,6 +71,7 @@ int PKCS12_gen_mac (PKCS12 *p12, const char *pass, int passlen,
HMAC_CTX hmac;
unsigned char key[PKCS12_MAC_KEY_LENGTH], *salt;
int saltlen, iter;
+
salt = p12->mac->salt->data;
saltlen = p12->mac->salt->length;
if (!p12->mac->iter) iter = 1;
@@ -85,11 +86,12 @@ int PKCS12_gen_mac (PKCS12 *p12, const char *pass, int passlen,
PKCS12err(PKCS12_F_PKCS12_GEN_MAC,PKCS12_R_KEY_GEN_ERROR);
return 0;
}
+ HMAC_CTX_init(&hmac);
HMAC_Init (&hmac, key, PKCS12_MAC_KEY_LENGTH, md_type);
HMAC_Update (&hmac, p12->authsafes->d.data->data,
p12->authsafes->d.data->length);
HMAC_Final (&hmac, mac, maclen);
- HMAC_cleanup (&hmac);
+ HMAC_CTX_cleanup (&hmac);
return 1;
}