Commit e28dcb14be for openssl.org
commit e28dcb14be537e388a440a8e65bc37450e3ac952
Author: Loganaden Velvindron <logan@cyberstorm.mu>
Date: Fri May 29 10:59:06 2026 +0400
crypto/ec/curve448/eddsa.c: check context length in ossl_ed448_verify()
Add a check that context_len doesn't overflow uint8_t, as it is the type
of the argument in c448_ed448_verify().
Complements: 4ea41daa073a "Add Ed448 tests"
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Merge-date: Wed Nov 4 11:38:17 2026
Merged-from: https://github.com/openssl/openssl/pull/31325
diff --git a/crypto/ec/curve448/eddsa.c b/crypto/ec/curve448/eddsa.c
index 1c375413ab..23803e3379 100644
--- a/crypto/ec/curve448/eddsa.c
+++ b/crypto/ec/curve448/eddsa.c
@@ -410,6 +410,9 @@ int ossl_ed448_verify(OSSL_LIB_CTX *ctx,
const uint8_t *context, size_t context_len,
const uint8_t phflag, const char *propq)
{
+ if (context_len > UINT8_MAX)
+ return C448_FAILURE;
+
return c448_ed448_verify(ctx, signature, public_key, message,
message_len, phflag, context, (uint8_t)context_len,
propq)