diff options
Diffstat (limited to 'src/lib/libssl/src/crypto/pkcs7/pk7_attr.c')
-rw-r--r-- | src/lib/libssl/src/crypto/pkcs7/pk7_attr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_attr.c b/src/lib/libssl/src/crypto/pkcs7/pk7_attr.c index 5ff5a88b5c..039141027a 100644 --- a/src/lib/libssl/src/crypto/pkcs7/pk7_attr.c +++ b/src/lib/libssl/src/crypto/pkcs7/pk7_attr.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * project 2001. | 3 | * project 2001. |
4 | */ | 4 | */ |
5 | /* ==================================================================== | 5 | /* ==================================================================== |
6 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | 6 | * Copyright (c) 2001-2004 The OpenSSL Project. All rights reserved. |
7 | * | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions |
@@ -94,17 +94,18 @@ int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, STACK_OF(X509_ALGOR) *cap) | |||
94 | } | 94 | } |
95 | 95 | ||
96 | STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si) | 96 | STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si) |
97 | { | 97 | { |
98 | ASN1_TYPE *cap; | 98 | ASN1_TYPE *cap; |
99 | unsigned char *p; | 99 | unsigned char *p; |
100 | cap = PKCS7_get_signed_attribute(si, NID_SMIMECapabilities); | 100 | cap = PKCS7_get_signed_attribute(si, NID_SMIMECapabilities); |
101 | if (!cap) return NULL; | 101 | if (!cap || (cap->type != V_ASN1_SEQUENCE)) |
102 | return NULL; | ||
102 | p = cap->value.sequence->data; | 103 | p = cap->value.sequence->data; |
103 | return d2i_ASN1_SET_OF_X509_ALGOR(NULL, &p, | 104 | return d2i_ASN1_SET_OF_X509_ALGOR(NULL, &p, |
104 | cap->value.sequence->length, | 105 | cap->value.sequence->length, |
105 | d2i_X509_ALGOR, X509_ALGOR_free, | 106 | d2i_X509_ALGOR, X509_ALGOR_free, |
106 | V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL); | 107 | V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL); |
107 | } | 108 | } |
108 | 109 | ||
109 | /* Basic smime-capabilities OID and optional integer arg */ | 110 | /* Basic smime-capabilities OID and optional integer arg */ |
110 | int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg) | 111 | int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg) |