mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Move is_sign and mac_size checking back to PSA core scope
It makes sense to do the length checking in the core rather than expect each driver to deal with it themselves. This puts the onus on the core to dictate which algorithm/key combinations are valid before calling a driver. Additionally, this commit also updates the psa_mac_sign_finish function to better deal with output buffer sanitation, as per the review comments on #4247. Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
@ -62,8 +62,6 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
psa_algorithm_t alg;
|
||||
unsigned int is_sign : 1;
|
||||
uint8_t mac_size;
|
||||
union
|
||||
{
|
||||
unsigned dummy; /* Make the union non-empty even with no supported algorithms. */
|
||||
@ -76,7 +74,7 @@ typedef struct
|
||||
} ctx;
|
||||
} mbedtls_psa_mac_operation_t;
|
||||
|
||||
#define MBEDTLS_PSA_MAC_OPERATION_INIT {0, 0, 0, 0, {0}}
|
||||
#define MBEDTLS_PSA_MAC_OPERATION_INIT {0, {0}}
|
||||
|
||||
/*
|
||||
* BEYOND THIS POINT, TEST DRIVER DECLARATIONS ONLY.
|
||||
|
Reference in New Issue
Block a user