diff options
| author | miod <> | 2015-07-19 18:25:59 +0000 |
|---|---|---|
| committer | miod <> | 2015-07-19 18:25:59 +0000 |
| commit | 61761e41c7c80fb243bc192e66dd048e359b9347 (patch) | |
| tree | e7e2277b99a4664031d84c7631692bf4877f5ad0 /src/lib/libcrypto/pkcs7 | |
| parent | 48fd50bde369b42f678fadef9557080465a7e425 (diff) | |
| download | openbsd-61761e41c7c80fb243bc192e66dd048e359b9347.tar.gz openbsd-61761e41c7c80fb243bc192e66dd048e359b9347.tar.bz2 openbsd-61761e41c7c80fb243bc192e66dd048e359b9347.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 | ||
