aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/openssl
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2016-06-27 17:22:34 +0200
committerTobias Brunner <tobias@strongswan.org>2016-06-29 11:09:37 +0200
commita9f388e368f5db4c910c57a30ec16170b9ade3c8 (patch)
tree9ec14ebfe9c9548df1d06353cd92b9d91cf52e88 /src/libstrongswan/plugins/openssl
parent989ba4b6cd16cf724c07434f5cbb5c3db4000d93 (diff)
downloadstrongswan-a9f388e368f5db4c910c57a30ec16170b9ade3c8.tar.bz2
strongswan-a9f388e368f5db4c910c57a30ec16170b9ade3c8.tar.xz
openssl: Update PKCS#7 API to OpenSSL 1.1.0
Diffstat (limited to 'src/libstrongswan/plugins/openssl')
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_pkcs7.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_pkcs7.c b/src/libstrongswan/plugins/openssl/openssl_pkcs7.c
index 891e829ae..f10987c8d 100644
--- a/src/libstrongswan/plugins/openssl/openssl_pkcs7.c
+++ b/src/libstrongswan/plugins/openssl/openssl_pkcs7.c
@@ -29,6 +29,10 @@
#include <openssl/cms.h>
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#define X509_ATTRIBUTE_get0_object(attr) ({ (attr)->object; })
+#endif
+
typedef struct private_openssl_pkcs7_t private_openssl_pkcs7_t;
/**
@@ -432,11 +436,11 @@ METHOD(pkcs7_t, get_attribute, bool,
for (i = 0; i < CMS_signed_get_attr_count(si); i++)
{
attr = CMS_signed_get_attr(si, i);
- if (!attr->single && sk_ASN1_TYPE_num(attr->value.set) == 1 &&
- openssl_asn1_known_oid(attr->object) == oid)
+ if (X509_ATTRIBUTE_count(attr) == 1 &&
+ openssl_asn1_known_oid(X509_ATTRIBUTE_get0_object(attr)) == oid)
{
/* get first value in SET */
- type = sk_ASN1_TYPE_value(attr->value.set, 0);
+ type = X509_ATTRIBUTE_get0_type(attr, 0);
chunk = wrapped = openssl_i2chunk(ASN1_TYPE, type);
if (asn1_unwrap(&chunk, &chunk) != 0x100 /* ASN1_INVALID */)
{