CryptoPkg/BaseCryptLib: EdDsa updates

Include validation checks for Context and ContextSize in
sign and verify functions.
Returned FALSE for EdDsaGeneratePubKey.
Updated ReadMe to show EdDsa support

Signed-off-by: Michael G.A. Holland <michael.holland@intel.com>
This commit is contained in:
Michael G.A. Holland 2026-07-17 10:39:18 -07:00 committed by mergify[bot]
parent 8f5a348a9d
commit 5309cdb92c
3 changed files with 14 additions and 5 deletions

View file

@ -255,7 +255,7 @@ EdDsaGeneratePubKey (
IN UINTN PublicKeySize
)
{
return TRUE;
return FALSE;
}
/**
@ -454,6 +454,10 @@ EdDsaSign (
return FALSE;
}
if ((ContextSize > 0) && (Context == NULL)) {
return FALSE;
}
Ctx = (KEY_CONTEXT *)EdDsaContext;
if (Ctx == NULL) {
return FALSE;
@ -569,6 +573,10 @@ EdDsaVerify (
return FALSE;
}
if ((ContextSize > 0) && (Context == NULL)) {
return FALSE;
}
Ctx = (KEY_CONTEXT *)EdDsaContext;
if (Ctx == NULL) {
return FALSE;

View file

@ -234,6 +234,7 @@ also configured.
| Bn | N | N | | | C | C | |
| Ec | N | N | | | C-Full | C-Full | |
| Camellia | N | N | | | C-Full | C-Full | |
| EdDsa | N | N | | | C-Full | C-Full | |
## Platform Configuration of Cryptographic Services

View file

@ -809,16 +809,16 @@ TestVerifyEdDsaGeneratePubKey (
UT_ASSERT_NOT_NULL (EdDsaContext1);
//
// EdDsaGeneratePubKey is a placeholder that always returns TRUE
// EdDsaGeneratePubKey is a placeholder that always returns FALSE
//
Status = EdDsaGeneratePubKey (EdDsaContext1, PublicKey, ED448_KEY_SIZE);
UT_ASSERT_TRUE (Status);
UT_ASSERT_FALSE (Status);
//
// It should return TRUE even with NULL parameters
// It should return FALSE even with NULL parameters
//
Status = EdDsaGeneratePubKey (NULL, NULL, 0);
UT_ASSERT_TRUE (Status);
UT_ASSERT_FALSE (Status);
return UNIT_TEST_PASSED;
}