mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
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:
parent
8f5a348a9d
commit
5309cdb92c
3 changed files with 14 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue