mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-22 11:45:37 +02:00
Don't assert anything about uninitialized parts of structures
In a PAKE operation that has been initialized with `PSA_PAKE_OPERATION_INIT` or `psa_pake_operation_init()`, the content of the driver-specific part is indeterminate. It is actually all-bits-zero on most platforms, but not all, e.g. not with GCC 15 or CompCert. So don't assert anything about it. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@@ -1058,9 +1058,6 @@ void pake_input_getters_cipher_suite()
|
||||
psa_pake_cs_set_primitive(&cipher_suite, primitive);
|
||||
psa_pake_cs_set_hash(&cipher_suite, PSA_ALG_SHA_256);
|
||||
|
||||
TEST_EQUAL(psa_crypto_driver_pake_get_cipher_suite(&operation.data.inputs, &cipher_suite_ret),
|
||||
PSA_ERROR_BAD_STATE);
|
||||
|
||||
PSA_ASSERT(psa_pake_setup(&operation, &cipher_suite));
|
||||
|
||||
TEST_EQUAL(psa_crypto_driver_pake_get_cipher_suite(&operation.data.inputs, &cipher_suite_ret),
|
||||
@@ -1069,6 +1066,10 @@ void pake_input_getters_cipher_suite()
|
||||
TEST_MEMORY_COMPARE(&cipher_suite_ret, sizeof(cipher_suite_ret),
|
||||
&cipher_suite, sizeof(cipher_suite));
|
||||
|
||||
PSA_ASSERT(psa_pake_abort(&operation));
|
||||
TEST_EQUAL(psa_crypto_driver_pake_get_cipher_suite(&operation.data.inputs, &cipher_suite_ret),
|
||||
PSA_ERROR_BAD_STATE);
|
||||
|
||||
exit:
|
||||
PSA_ASSERT(psa_pake_abort(&operation));
|
||||
PSA_DONE();
|
||||
|
||||
Reference in New Issue
Block a user