summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12/p12_mutl.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2005-06-30 11:34:58 +0000
committerDr. Stephen Henson <steve@openssl.org>2005-06-30 11:34:58 +0000
commit1c2f1fe505f55a5df2430d78128a4ace331e6597 (patch)
tree049b5e3cf1e015287b3cdbcbca568d47c3cad6e3 /crypto/pkcs12/p12_mutl.c
parent14365bd82047c28a2d9552c47fb2729c3e1bb8b4 (diff)
Check PKCS7 structures in PKCS#12 files are of type data.
Diffstat (limited to 'crypto/pkcs12/p12_mutl.c')
-rw-r--r--crypto/pkcs12/p12_mutl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/pkcs12/p12_mutl.c b/crypto/pkcs12/p12_mutl.c
index 5eac25f10e..7bff04889c 100644
--- a/crypto/pkcs12/p12_mutl.c
+++ b/crypto/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;