diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs7/pk7_attr.c')
-rw-r--r-- | src/lib/libcrypto/pkcs7/pk7_attr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/libcrypto/pkcs7/pk7_attr.c b/src/lib/libcrypto/pkcs7/pk7_attr.c index 039141027a..5ff5a88b5c 100644 --- a/src/lib/libcrypto/pkcs7/pk7_attr.c +++ b/src/lib/libcrypto/pkcs7/pk7_attr.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * project 2001. | 3 | * project 2001. |
4 | */ | 4 | */ |
5 | /* ==================================================================== | 5 | /* ==================================================================== |
6 | * Copyright (c) 2001-2004 The OpenSSL Project. All rights reserved. | 6 | * Copyright (c) 2001 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,18 +94,17 @@ 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 || (cap->type != V_ASN1_SEQUENCE)) | 101 | if (!cap) return NULL; |
102 | return NULL; | ||
103 | p = cap->value.sequence->data; | 102 | p = cap->value.sequence->data; |
104 | return d2i_ASN1_SET_OF_X509_ALGOR(NULL, &p, | 103 | return d2i_ASN1_SET_OF_X509_ALGOR(NULL, &p, |
105 | cap->value.sequence->length, | 104 | cap->value.sequence->length, |
106 | d2i_X509_ALGOR, X509_ALGOR_free, | 105 | d2i_X509_ALGOR, X509_ALGOR_free, |
107 | V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL); | 106 | V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL); |
108 | } | 107 | } |
109 | 108 | ||
110 | /* Basic smime-capabilities OID and optional integer arg */ | 109 | /* Basic smime-capabilities OID and optional integer arg */ |
111 | int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg) | 110 | int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg) |