mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-27 06:35:22 +00:00
Update test
Testing the hash length in this context is not applicable because there is no way to specify it when calling mbedtls_psa_hkdf_extract. Change to test invalid `alg` parameter. Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
ebc9368173
commit
5d7d201b87
@ -4420,7 +4420,7 @@ SSL TLS 1.3 Key schedule: HKDF RFC5869 Test Vector #7 Extract
|
|||||||
depends_on:PSA_WANT_ALG_SHA_1
|
depends_on:PSA_WANT_ALG_SHA_1
|
||||||
psa_hkdf_extract:PSA_ALG_HMAC(PSA_ALG_SHA_1):"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c":"":"2adccada18779e7c2077ad2eb19d3f3e731385dd"
|
psa_hkdf_extract:PSA_ALG_HMAC(PSA_ALG_SHA_1):"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c":"":"2adccada18779e7c2077ad2eb19d3f3e731385dd"
|
||||||
|
|
||||||
SSL TLS 1.3 Key schedule: HKDF extract fails with hash_len of 0
|
SSL TLS 1.3 Key schedule: HKDF extract fails with wrong hash alg
|
||||||
psa_hkdf_extract_ret:0:MBEDTLS_ERR_SSL_BAD_INPUT_DATA
|
psa_hkdf_extract_ret:0:MBEDTLS_ERR_SSL_BAD_INPUT_DATA
|
||||||
|
|
||||||
SSL TLS 1.3 Key schedule: HKDF RFC5869 Test Vector #1 Expand
|
SSL TLS 1.3 Key schedule: HKDF RFC5869 Test Vector #1 Expand
|
||||||
|
@ -3842,7 +3842,7 @@ exit:
|
|||||||
/* END_CASE */
|
/* END_CASE */
|
||||||
|
|
||||||
/* BEGIN_CASE depends_on:MBEDTLS_TEST_HOOKS:MBEDTLS_SSL_PROTO_TLS1_3 */
|
/* BEGIN_CASE depends_on:MBEDTLS_TEST_HOOKS:MBEDTLS_SSL_PROTO_TLS1_3 */
|
||||||
void psa_hkdf_extract_ret( int hash_len, int ret )
|
void psa_hkdf_extract_ret( int alg, int ret )
|
||||||
{
|
{
|
||||||
int output_ret;
|
int output_ret;
|
||||||
unsigned char *salt = NULL;
|
unsigned char *salt = NULL;
|
||||||
@ -3850,13 +3850,13 @@ void psa_hkdf_extract_ret( int hash_len, int ret )
|
|||||||
unsigned char *prk = NULL;
|
unsigned char *prk = NULL;
|
||||||
size_t salt_len, ikm_len, prk_len;
|
size_t salt_len, ikm_len, prk_len;
|
||||||
|
|
||||||
salt_len = hash_len;
|
|
||||||
ASSERT_ALLOC( prk, PSA_MAC_MAX_SIZE);
|
ASSERT_ALLOC( prk, PSA_MAC_MAX_SIZE);
|
||||||
|
salt_len = 0;
|
||||||
ikm_len = 0;
|
ikm_len = 0;
|
||||||
prk_len = 0;
|
prk_len = 0;
|
||||||
|
|
||||||
PSA_ASSERT( psa_crypto_init() );
|
PSA_ASSERT( psa_crypto_init() );
|
||||||
output_ret = mbedtls_psa_hkdf_extract( 0, salt, salt_len,
|
output_ret = mbedtls_psa_hkdf_extract( alg, salt, salt_len,
|
||||||
ikm, ikm_len,
|
ikm, ikm_len,
|
||||||
prk, PSA_MAC_MAX_SIZE, &prk_len );
|
prk, PSA_MAC_MAX_SIZE, &prk_len );
|
||||||
TEST_ASSERT( output_ret == ret );
|
TEST_ASSERT( output_ret == ret );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user