Lines Matching refs:keys

17     /**< Terminate and reinitialize without closing/destroying keys */
50 /* Closing the key invalidate only volatile keys, not persistent ones. */
59 /* Purging the key just purges RAM data of persistent keys. */
83 /* All keys must have been closed. */
87 /* Some keys may remain behind, and we're testing that this
825 mbedtls_svc_key_id_t *keys = NULL;
833 TEST_CALLOC(keys, max_keys);
844 &keys[i]);
846 TEST_ASSERT(!mbedtls_svc_key_id_is_null(keys[i]));
848 TEST_ASSERT(!mbedtls_svc_key_id_equal(keys[i], keys[j]));
854 PSA_ASSERT(psa_close_key(keys[i - 1]));
855 PSA_ASSERT(psa_export_key(keys[i],
861 PSA_ASSERT(psa_close_key(keys[i - 1]));
865 mbedtls_free(keys);
871 * 1. Fill the key store with volatile keys.
882 mbedtls_svc_key_id_t *keys = NULL;
900 TEST_CALLOC(keys, max_keys + 1);
911 &keys[i]);
913 TEST_ASSERT(!mbedtls_svc_key_id_is_null(keys[i]));
915 TEST_ASSERT(!mbedtls_svc_key_id_equal(keys[i], keys[j]));
923 &keys[max_keys]);
925 TEST_ASSERT(mbedtls_svc_key_id_is_null(keys[max_keys]));
927 /* Check that the keys are not corrupted. */
930 PSA_ASSERT(psa_export_key(keys[i],
941 mbedtls_svc_key_id_t reused_id = keys[key_to_destroy];
943 PSA_ASSERT(psa_destroy_key(keys[key_to_destroy]));
944 keys[key_to_destroy] = MBEDTLS_SVC_KEY_ID_INIT;
947 &keys[key_to_destroy]);
951 * Since volatile keys IDs are assigned based on which slot contains
954 TEST_ASSERT(mbedtls_svc_key_id_equal(reused_id, keys[key_to_destroy]));
956 /* Check that the keys are not corrupted and destroy them. */
959 PSA_ASSERT(psa_export_key(keys[i],
969 PSA_ASSERT(psa_destroy_key(keys[i]));
970 keys[i] = MBEDTLS_SVC_KEY_ID_INIT;
975 mbedtls_free(keys);
999 * Create MBEDTLS_PSA_KEY_SLOT_COUNT persistent keys.
1012 * one of the descriptions of the previously created persistent keys
1032 * Check that we can export all ( MBEDTLS_PSA_KEY_SLOT_COUNT + 1 ) keys,
1069 mbedtls_svc_key_id_t *keys = NULL;
1079 TEST_CALLOC(keys, available_key_slots);
1098 * Create the maximum available number of keys that are locked in
1100 * - volatile keys, when MBEDTLS_PSA_KEY_STORE_DYNAMIC is disabled;
1101 * - opened persistent keys (could work, but not currently implemented
1103 * - keys in use by another thread (we don't do this because it would
1104 * be hard to arrange and we can't control how long the keys are
1111 &keys[i]));
1117 * occupied by volatile keys and the implementation needs to load the
1127 PSA_ASSERT(psa_export_key(keys[available_key_slots - 1],
1132 PSA_ASSERT(psa_destroy_key(keys[available_key_slots - 1]));
1143 * by the persistent key and the volatile keys and the slot containing the
1152 * Check we can export the remaining volatile keys and that they have the
1156 PSA_ASSERT(psa_export_key(keys[i],
1161 PSA_ASSERT(psa_destroy_key(keys[i]));
1182 mbedtls_free(keys);