Complain about bad initialization of operation structures

In every existing test driver entry point that is the setup for a multipart
operation, check that the driver operation structure is all-bits-zero on
entry, as guaranteed by the driver specification.

There is a risk that this isn't the case, mostly, on platforms where
initializing a union to `{0}` initializes only the default member and not
all members.

Signed-off-by: Gilles Peskine <[email protected]>
This commit is contained in:
Gilles Peskine
2025-05-07 17:22:50 +02:00
parent 1a83e0c84d
commit 97de10533d
5 changed files with 35 additions and 6 deletions
@@ -8,4 +8,10 @@
#include "mbedtls/build_info.h"
/** Error code that test drivers return when they detect that an input
* parameter was not initialized properly. This normally indicates a
* bug in the core.
*/
#define PSA_ERROR_TEST_DETECTED_BAD_INITIALIZATION ((psa_status_t)-0x0201)
#endif /* test_driver_common.h */