ed25519 and ed448: fix incorrect OSSL_PKEY_PARAM_MAX_SIZE
authorTomas Mraz <tomas@openssl.org>
Tue, 1 Jun 2021 12:54:43 +0000 (14:54 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 2 Jun 2021 15:17:51 +0000 (17:17 +0200)
Fixes #15552

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15566)

providers/implementations/keymgmt/ecx_kmgmt.c
test/evp_pkey_provided_test.c

index 9de954651bf91149fa2f403133d2257a394261f8..b088c03b301c99b55a7281a62727b10e27125aad 100644 (file)
@@ -309,14 +309,14 @@ static int x448_get_params(void *key, OSSL_PARAM params[])
 static int ed25519_get_params(void *key, OSSL_PARAM params[])
 {
     return ecx_get_params(key, params, ED25519_BITS, ED25519_SECURITY_BITS,
-                          ED25519_KEYLEN)
+                          ED25519_SIGSIZE)
         && ed_get_params(key, params);
 }
 
 static int ed448_get_params(void *key, OSSL_PARAM params[])
 {
     return ecx_get_params(key, params, ED448_BITS, ED448_SECURITY_BITS,
-                          ED448_KEYLEN)
+                          ED448_SIGSIZE)
         && ed_get_params(key, params);
 }
 
index 92b3614f6e67b0664fa5fd5da6b682a76eadfab2..bdfa3cd754b6118953f38df09b097ae25b7eadb4 100644 (file)
@@ -979,7 +979,7 @@ static int test_fromdata_ecx(int tst)
         fromdata_params = ed25519_fromdata_params;
         bits = ED25519_BITS;
         security_bits = ED25519_SECURITY_BITS;
-        size = ED25519_KEYLEN;
+        size = ED25519_SIGSIZE;
         alg = "ED25519";
         break;
 
@@ -987,7 +987,7 @@ static int test_fromdata_ecx(int tst)
         fromdata_params = ed448_fromdata_params;
         bits = ED448_BITS;
         security_bits = ED448_SECURITY_BITS;
-        size = ED448_KEYLEN;
+        size = ED448_SIGSIZE;
         alg = "ED448";
         break;
     default: