MBEDTLS_PSA_INJECT_ENTROPY: check the seed file UID

The seed file UID is part of the library's stable interface.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2023-04-28 21:13:43 +02:00
parent f13469da48
commit b377229b65

View File

@ -33,6 +33,12 @@
*/ */
int check_random_seed_file(size_t expected_size) int check_random_seed_file(size_t expected_size)
{ {
/* The value of the random seed UID must not change. Otherwise that would
* break upgrades of the library on devices that already contain a seed
* file. If this test assertion fails, you've presumably broken backward
* compatibility! */
TEST_EQUAL(PSA_CRYPTO_ITS_RANDOM_SEED_UID, 0xFFFFFF52);
struct psa_storage_info_t info = { 0, 0 }; struct psa_storage_info_t info = { 0, 0 };
psa_status_t status = psa_its_get_info(PSA_CRYPTO_ITS_RANDOM_SEED_UID, psa_status_t status = psa_its_get_info(PSA_CRYPTO_ITS_RANDOM_SEED_UID,
&info); &info);