summaryrefslogtreecommitdiff
path: root/lib/libcrypto/pkcs12/p12_mutl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/pkcs12/p12_mutl.c')
-rw-r--r--lib/libcrypto/pkcs12/p12_mutl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libcrypto/pkcs12/p12_mutl.c b/lib/libcrypto/pkcs12/p12_mutl.c
index 4886b9b2899..140d21155e7 100644
--- a/lib/libcrypto/pkcs12/p12_mutl.c
+++ b/lib/libcrypto/pkcs12/p12_mutl.c
@@ -72,6 +72,12 @@ int PKCS12_gen_mac (PKCS12 *p12, const char *pass, int passlen,
unsigned char key[PKCS12_MAC_KEY_LENGTH], *salt;
int saltlen, iter;
+ if (!PKCS7_type_is_data(p12->authsafes))
+ {
+ PKCS12err(PKCS12_F_PKCS12_GEN_MAC,PKCS12_R_CONTENT_TYPE_NOT_DATA);
+ return 0;
+ }
+
salt = p12->mac->salt->data;
saltlen = p12->mac->salt->length;
if (!p12->mac->iter) iter = 1;