mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-16 17:43:14 +00:00
PSA_DONE: account for MBEDTLS_TEST_PSA_INTERNAL_KEYS
Replace the hard-coded 1 by the proper constant now that the proper constant exists. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
5eca4029c2
commit
a9083b752c
@ -74,7 +74,12 @@ const char *mbedtls_test_helper_is_psa_leaking(void)
|
|||||||
|
|
||||||
mbedtls_psa_get_stats(&stats);
|
mbedtls_psa_get_stats(&stats);
|
||||||
|
|
||||||
if (stats.volatile_slots > 1) {
|
/* Some volatile slots may be used for internal purposes. Generally
|
||||||
|
* we'll have exactly MBEDTLS_TEST_PSA_INTERNAL_KEYS at this point,
|
||||||
|
* but in some cases we might have less, e.g. if a code path calls
|
||||||
|
* PSA_DONE more than once, or if there has only been a partial or
|
||||||
|
* failed initialization. */
|
||||||
|
if (stats.volatile_slots > MBEDTLS_TEST_PSA_INTERNAL_KEYS) {
|
||||||
return "A volatile slot has not been closed properly.";
|
return "A volatile slot has not been closed properly.";
|
||||||
}
|
}
|
||||||
if (stats.persistent_slots != 0) {
|
if (stats.persistent_slots != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user