summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-04-24 17:40:31 +0100
committerMatt Caswell <matt@openssl.org>2020-05-04 09:30:55 +0100
commit48b4b1044906b6bdbf948f11bf54c5b2733c0c94 (patch)
tree30949366f2cc517f2ec962e5bf7499d71e6d85d6 /crypto/ec
parentd4fe478df04073abf0657506b58ed3f67443fcaf (diff)
Fix the KEYNID2TYPE macro
This macro was not correctly handling Ed25519 keys Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11635)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ecx_backend.h6
1 files 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)