From 48b4b1044906b6bdbf948f11bf54c5b2733c0c94 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 24 Apr 2020 17:40:31 +0100 Subject: [PATCH] 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) --- crypto/ec/ecx_backend.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.25.1