Add sanity check for FFDH key excercise

Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
Przemek Stekiel 2022-12-01 15:09:40 +01:00
parent 9e65a81ef8
commit 7cf26dfca3

View File

@ -789,6 +789,9 @@ int mbedtls_test_psa_exported_key_sanity_check(
TEST_EQUAL(1 + 2 * PSA_BITS_TO_BYTES(bits), exported_length);
TEST_EQUAL(exported[0], 4);
}
} else
if (PSA_KEY_TYPE_IS_DH_PUBLIC_KEY(type) || PSA_KEY_TYPE_IS_DH_KEY_PAIR(type)) {
TEST_LE_U(exported_length, PSA_BITS_TO_BYTES(bits));
} else {
(void) exported;
TEST_ASSERT(!"Sanity check not implemented for this key type");