Skip to content

Commit

Permalink
Fix OpenSSL 1.1 build of EC workaround
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 6, 2016
1 parent 85ff68a commit 6468a77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openssl-pkcs11.c
Expand Up @@ -479,6 +479,9 @@ static PKCS11_KEY *slot_find_key(struct openconnect_info *vpninfo, PKCS11_CTX *c
}

#ifndef OPENSSL_NO_EC
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
#define EVP_PKEY_id(k) ((k)->type)
#endif
static int validate_ecdsa_key(struct openconnect_info *vpninfo, EC_KEY *priv_ec)
{
EVP_PKEY *pub_pkey;
Expand Down Expand Up @@ -660,7 +663,7 @@ int load_pkcs11_key(struct openconnect_info *vpninfo)
* a signature and validating it against the cert, then
* copying the EC_POINT public key information from the cert.
*/
if (pkey->type == EVP_PKEY_EC) {
if (EVP_PKEY_id(pkey) == EVP_PKEY_EC) {
EC_KEY *priv_ec = EVP_PKEY_get1_EC_KEY(pkey);

ret = 0;
Expand Down

0 comments on commit 6468a77

Please sign in to comment.