From: Matt Caswell Date: Fri, 24 Apr 2020 16:40:31 +0000 (+0100) Subject: Fix the KEYNID2TYPE macro X-Git-Tag: openssl-3.0.0-alpha2~86 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=48b4b1044906b6bdbf948f11bf54c5b2733c0c94;p=oweals%2Fopenssl.git Fix the KEYNID2TYPE macro This macro was not correctly handling Ed25519 keys Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11635) --- diff --git a/crypto/ec/ecx_backend.h b/crypto/ec/ecx_backend.h index 50ece17abb..2c01294789 100644 --- a/crypto/ec/ecx_backend.h +++ b/crypto/ec/ecx_backend.h @@ -13,8 +13,8 @@ : ((id) == EVP_PKEY_X448 ? X448_KEYLEN \ : ED448_KEYLEN)) #define KEYNID2TYPE(id) \ - (IS25519(id) ? ECX_KEY_TYPE_X25519 \ + (IS25519(id) ? ((id) == EVP_PKEY_X25519 ? ECX_KEY_TYPE_X25519 \ + : ECX_KEY_TYPE_ED25519) \ : ((id) == EVP_PKEY_X448 ? ECX_KEY_TYPE_X448 \ - : ((id) == EVP_PKEY_ED25519 ? ECX_KEY_TYPE_ED25519 \ - : ECX_KEY_TYPE_ED448))) + : ECX_KEY_TYPE_ED448)) #define KEYLEN(p) KEYLENID((p)->ameth->pkey_id)