Add support for get_(bit)len on opaque keys
diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function
index 64f1fec..8f6abf5 100644
--- a/tests/suites/test_suite_pk.function
+++ b/tests/suites/test_suite_pk.function
@@ -101,9 +101,11 @@
void pk_psa_utils( )
{
mbedtls_pk_context pk;
- const char * const name = "Opaque (PSA)";
psa_key_slot_t key;
+ const char * const name = "Opaque (PSA)";
+ const size_t bitlen = 256; /* harcoded in genkey() */
+
mbedtls_pk_init( &pk );
key = pk_psa_genkey();
@@ -114,6 +116,9 @@
TEST_ASSERT( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_OPAQUE_PSA );
TEST_ASSERT( strcmp( mbedtls_pk_get_name( &pk), name ) == 0 );
+ TEST_ASSERT( mbedtls_pk_get_bitlen( &pk ) == bitlen );
+ TEST_ASSERT( mbedtls_pk_get_len( &pk ) == bitlen / 8 );
+
/* test that freeing the context does not destroy the key */
mbedtls_pk_free( &pk );
TEST_ASSERT( PSA_SUCCESS == psa_destroy_key( key ) );