aboutsummaryrefslogtreecommitdiffstats
path: root/hs20
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2017-09-12 17:43:36 (GMT)
committerJouni Malinen <j@w1.fi>2019-01-01 17:56:19 (GMT)
commita898113823a3b76e0078764edabfac916de7e539 (patch)
treededdb2bbcc173a526c5980a1b8489d1192c87603 /hs20
parentb2f1e5458b48001d3d20e58e8ebb07616501cab8 (diff)
downloadhostap-a898113823a3b76e0078764edabfac916de7e539.zip
hostap-a898113823a3b76e0078764edabfac916de7e539.tar.gz
hostap-a898113823a3b76e0078764edabfac916de7e539.tar.bz2
HS 2.0: Fix EST compilation with OpenSSL 1.1.0 and newer
SKM_sk_value() is not available anymore, so use DEFINE_STACK_OF() to get the appropriate accessor functions. Signed-off-by: Ben Greear <greearb@candelatech.com>
Diffstat (limited to 'hs20')
-rw-r--r--hs20/client/est.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hs20/client/est.c b/hs20/client/est.c
index b1aacb8..db65334 100644
--- a/hs20/client/est.c
+++ b/hs20/client/est.c
@@ -16,6 +16,7 @@
#include <openssl/asn1t.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
+#include <openssl/opensslv.h>
#ifdef OPENSSL_IS_BORINGSSL
#include <openssl/buf.h>
#endif /* OPENSSL_IS_BORINGSSL */
@@ -219,6 +220,10 @@ typedef struct {
} d;
} AttrOrOID;
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_IS_BORINGSSL)
+DEFINE_STACK_OF(AttrOrOID)
+#endif
+
typedef struct {
int type;
STACK_OF(AttrOrOID) *attrs;
@@ -352,9 +357,17 @@ static void add_csrattrs(struct hs20_osu_client *ctx, CsrAttrs *csrattrs,
}
}
#else /* OPENSSL_IS_BORINGSSL */
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_IS_BORINGSSL)
+ num = sk_AttrOrOID_num(csrattrs->attrs);
+#else
num = SKM_sk_num(AttrOrOID, csrattrs->attrs);
+#endif
for (i = 0; i < num; i++) {
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_IS_BORINGSSL)
+ AttrOrOID *ao = sk_AttrOrOID_value(csrattrs->attrs, i);
+#else
AttrOrOID *ao = SKM_sk_value(AttrOrOID, csrattrs->attrs, i);
+#endif
switch (ao->type) {
case 0:
add_csrattrs_oid(ctx, ao->d.oid, exts);