mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-09 21:44:28 +00:00
Add cost and password steps to derive_output_test function
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
This commit is contained in:
parent
f6a0d57e4d
commit
81797fc270
@ -8713,6 +8713,20 @@ void derive_output(int alg_arg,
|
||||
switch (steps[i]) {
|
||||
case 0:
|
||||
break;
|
||||
case PSA_KEY_DERIVATION_INPUT_COST:
|
||||
TEST_EQUAL(psa_key_derivation_input_integer(
|
||||
&operation, steps[i],
|
||||
parse_binary_string(inputs[i])),
|
||||
statuses[i]);
|
||||
if (statuses[i] != PSA_SUCCESS) {
|
||||
goto exit;
|
||||
}
|
||||
break;
|
||||
case PSA_KEY_DERIVATION_INPUT_PASSWORD:
|
||||
if (!PSA_ALG_IS_PBKDF2_HMAC(alg)) {
|
||||
goto exit;
|
||||
}
|
||||
// fall through
|
||||
case PSA_KEY_DERIVATION_INPUT_SECRET:
|
||||
switch (key_input_type) {
|
||||
case 0: // input bytes
|
||||
@ -8740,9 +8754,14 @@ void derive_output(int alg_arg,
|
||||
PSA_TLS12_PSK_TO_MS_PSK_MAX_SIZE);
|
||||
}
|
||||
|
||||
PSA_ASSERT(psa_key_derivation_input_key(&operation,
|
||||
TEST_EQUAL(psa_key_derivation_input_key(&operation,
|
||||
steps[i],
|
||||
keys[i]));
|
||||
keys[i]),
|
||||
statuses[i]);
|
||||
|
||||
if (statuses[i] != PSA_SUCCESS) {
|
||||
goto exit;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
TEST_ASSERT(!"default case not supported");
|
||||
|
Loading…
x
Reference in New Issue
Block a user