]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Fix build with OpenSSL 1.0.2 (EVP_PKEY_get0_EC_KEY() wrapper)
authorJouni Malinen <j@w1.fi>
Sun, 29 Mar 2020 15:56:48 +0000 (18:56 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 29 Mar 2020 18:15:16 +0000 (21:15 +0300)
EVP_PKEY_get0_EC_KEY() was added in OpenSSL 1.1.0, so add a
compatibility wrapper for it when building with OpenSSL 1.0.2.

Fixes: c025c2eb5911 ("DPP: DPPEnvelopedData generation for Configurator backup")
Fixes: 7d9e3200544c ("DPP: Received Configurator backup processing")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/common/dpp.c

index f0636b4aca6e142efbb0dfcab8119fbdcb00f1dc..784961ddd75e390f1775be062a8cb0d321e2d4cd 100644 (file)
@@ -73,6 +73,14 @@ static void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr,
                *ps = sig->s;
 }
 
+
+static EC_KEY * EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey)
+{
+       if (pkey->type != EVP_PKEY_EC)
+               return NULL;
+       return pkey->pkey.ec;
+}
+
 #endif