initialization error
diff --git a/api-tests/dev_apis/crypto/test_c021/test_c021.c b/api-tests/dev_apis/crypto/test_c021/test_c021.c
index ef6ace2..477ff16 100644
--- a/api-tests/dev_apis/crypto/test_c021/test_c021.c
+++ b/api-tests/dev_apis/crypto/test_c021/test_c021.c
@@ -103,6 +103,12 @@
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(7));
}
+ status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_INPUT_BYTES, &operation,
+ check1[i].info.step,
+ check1[i].info.data,
+ check1[i].info.data_length);
+ TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(8));
+
/* Setup the attributes for the key */
val->crypto_function(VAL_CRYPTO_SET_KEY_TYPE, &derv_attributes, check1[i].derive_key_type);
val->crypto_function(VAL_CRYPTO_SET_KEY_BITS, &derv_attributes, check1[i].derive_key_bits);
@@ -114,19 +120,19 @@
/* Derive a key from an ongoing key derivation operation */
status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_OUTPUT_KEY, &derv_attributes,
&operation, &keys[SLOT_1]);
- TEST_ASSERT_EQUAL(status, check1[i].expected_status, TEST_CHECKPOINT_NUM(8));
+ TEST_ASSERT_EQUAL(status, check1[i].expected_status, TEST_CHECKPOINT_NUM(9));
if (check1[i].step == PSA_KEY_DERIVATION_INPUT_SECRET)
{
status = val->crypto_function(VAL_CRYPTO_DESTROY_KEY, key);
- TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(9));
+ TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(10));
}
if (check1[i].expected_status != PSA_SUCCESS)
{
status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_ABORT, &operation);
- TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(10));
+ TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(11));
continue;
}
@@ -134,16 +140,16 @@
/* Read some key from a key derivation operation with no data in the operation */
status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_OUTPUT_KEY, &derv_attributes,
&operation, &keys[SLOT_2]);
- TEST_ASSERT_EQUAL(status, PSA_ERROR_INSUFFICIENT_DATA, TEST_CHECKPOINT_NUM(11));
+ TEST_ASSERT_EQUAL(status, PSA_ERROR_INSUFFICIENT_DATA, TEST_CHECKPOINT_NUM(12));
/* Abort the derivation operation */
status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_ABORT, &operation);
- TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(12));
+ TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(13));
/* Expect bad state when derivation is called on an aborted operation */
status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_OUTPUT_KEY, &derv_attributes,
&operation, &keys[SLOT_2]);
- TEST_ASSERT_EQUAL(status, PSA_ERROR_BAD_STATE, TEST_CHECKPOINT_NUM(13));
+ TEST_ASSERT_EQUAL(status, PSA_ERROR_BAD_STATE, TEST_CHECKPOINT_NUM(14));
}
return VAL_STATUS_SUCCESS;
diff --git a/api-tests/dev_apis/crypto/test_c021/test_data.h b/api-tests/dev_apis/crypto/test_c021/test_data.h
index 17bc455..4d09ab3 100644
--- a/api-tests/dev_apis/crypto/test_c021/test_data.h
+++ b/api-tests/dev_apis/crypto/test_c021/test_data.h
@@ -17,6 +17,13 @@
#include "val_crypto.h"
+#include "test_crypto_common.h"
+typedef struct {
+ psa_key_derivation_step_t step;
+ const uint8_t *data;
+ size_t data_length;
+} key_derivation_input_t;
+
typedef struct {
char test_desc[75];
psa_key_type_t key_type;
@@ -32,6 +39,7 @@
size_t derive_key_bits;
psa_key_usage_t derive_usage;
psa_algorithm_t derive_key_alg;
+ key_derivation_input_t info;
psa_status_t expected_status;
} test_data;
@@ -44,9 +52,14 @@
PSA_KEY_DERIVATION_INPUT_SECRET, 32, {0}, 0,
PSA_KEY_TYPE_AES, BYTES_TO_BITS(AES_32B_KEY_SIZE), PSA_KEY_USAGE_EXPORT,
PSA_ALG_CTR,
+ {
+ .step = PSA_KEY_DERIVATION_INPUT_INFO,
+ .data = input_info,
+ .data_length = INPUT_INFO_LEN
+ },
PSA_SUCCESS
},
-
+#if 0
{"Test psa_key_derivation_output_key - Info\n", PSA_KEY_TYPE_DERIVE,
{0x49, 0x8E, 0xC7, 0x7D, 0x01, 0x95, 0x0D, 0x94, 0x2C, 0x16, 0xA5, 0x3E, 0x99,
0x5F, 0xC9, 0x77},
@@ -145,4 +158,5 @@
PSA_ALG_CTR,
PSA_ERROR_NOT_SUPPORTED
},
+#endif
};
diff --git a/api-tests/dev_apis/crypto/test_c027/test_c027.c b/api-tests/dev_apis/crypto/test_c027/test_c027.c
index 18eb796..f2bf4a1 100644
--- a/api-tests/dev_apis/crypto/test_c027/test_c027.c
+++ b/api-tests/dev_apis/crypto/test_c027/test_c027.c
@@ -33,7 +33,7 @@
int32_t num_checks = sizeof(check1)/sizeof(check1[0]);
int32_t i, status;
psa_mac_operation_t operation;
- psa_key_attributes_t attributes;
+ psa_key_attributes_t attributes=PSA_KEY_ATTRIBUTES_INIT;
psa_key_id_t key;
if (num_checks == 0)
diff --git a/api-tests/dev_apis/crypto/test_c030/test_c030.c b/api-tests/dev_apis/crypto/test_c030/test_c030.c
index b9a842c..58a13ec 100644
--- a/api-tests/dev_apis/crypto/test_c030/test_c030.c
+++ b/api-tests/dev_apis/crypto/test_c030/test_c030.c
@@ -33,7 +33,7 @@
int32_t num_checks = sizeof(check1)/sizeof(check1[0]);
int32_t i, status;
psa_mac_operation_t operation;
- psa_key_attributes_t attributes;
+ psa_key_attributes_t attributes=PSA_KEY_ATTRIBUTES_INIT;
psa_key_id_t key;
if (num_checks == 0)
diff --git a/api-tests/dev_apis/crypto/test_c031/test_c031.c b/api-tests/dev_apis/crypto/test_c031/test_c031.c
index 9f43f31..fbb1a10 100644
--- a/api-tests/dev_apis/crypto/test_c031/test_c031.c
+++ b/api-tests/dev_apis/crypto/test_c031/test_c031.c
@@ -36,8 +36,8 @@
int32_t num_checks = sizeof(check1)/sizeof(check1[0]);
int32_t i, status;
psa_mac_operation_t operation;
- psa_key_attributes_t attributes;
- psa_key_id_t key;
+ psa_key_attributes_t attributes=PSA_KEY_ATTRIBUTES_INIT;
+ psa_key_id_t key=0;
if (num_checks == 0)
{
diff --git a/api-tests/dev_apis/crypto/test_c053/test_c053.c b/api-tests/dev_apis/crypto/test_c053/test_c053.c
index a9c4435..55ccbe3 100644
--- a/api-tests/dev_apis/crypto/test_c053/test_c053.c
+++ b/api-tests/dev_apis/crypto/test_c053/test_c053.c
@@ -32,7 +32,7 @@
{
int32_t i, status;
int32_t num_checks = sizeof(check1)/sizeof(check1[0]);
- psa_key_attributes_t attributes;
+ psa_key_attributes_t attributes=PSA_KEY_ATTRIBUTES_INIT;
psa_aead_operation_t operation;
psa_key_id_t key;