diff options
author | miod <> | 2015-07-19 18:25:59 +0000 |
---|---|---|
committer | miod <> | 2015-07-19 18:25:59 +0000 |
commit | e5955381f2756ed7dfa9d95684f7bce72885cbd0 (patch) | |
tree | e7e2277b99a4664031d84c7631692bf4877f5ad0 /src/lib/libcrypto/pkcs7 | |
parent | 434ae239dcf64cf56b6f17edb0168de9e7c1a70b (diff) | |
download | openbsd-e5955381f2756ed7dfa9d95684f7bce72885cbd0.tar.gz openbsd-e5955381f2756ed7dfa9d95684f7bce72885cbd0.tar.bz2 openbsd-e5955381f2756ed7dfa9d95684f7bce72885cbd0.zip |
Verify ASN1 objects types before attempting to access them as a particular
type.
ok guenther@ doug@
Diffstat (limited to 'src/lib/libcrypto/pkcs7')
-rw-r--r-- | src/lib/libcrypto/pkcs7/pk7_doit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c index d6fcaca745..2c69edf499 100644 --- a/src/lib/libcrypto/pkcs7/pk7_doit.c +++ b/src/lib/libcrypto/pkcs7/pk7_doit.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pk7_doit.c,v 1.34 2015/07/18 14:40:59 miod Exp $ */ | 1 | /* $OpenBSD: pk7_doit.c,v 1.35 2015/07/19 18:25:59 miod Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1187,6 +1187,8 @@ PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk) | |||
1187 | 1187 | ||
1188 | if (!(astype = get_attribute(sk, NID_pkcs9_messageDigest))) | 1188 | if (!(astype = get_attribute(sk, NID_pkcs9_messageDigest))) |
1189 | return NULL; | 1189 | return NULL; |
1190 | if (astype->type != V_ASN1_OCTET_STRING) | ||
1191 | return NULL; | ||
1190 | return astype->value.octet_string; | 1192 | return astype->value.octet_string; |
1191 | } | 1193 | } |
1192 | 1194 | ||