mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 01:18:06 +00:00
Add SW_WRONG_DATA return on bad tag for Chachapoly.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
13755cb4d5
commit
efba39adc5
1 changed files with 3 additions and 0 deletions
|
|
@ -308,6 +308,9 @@ int cmd_cipher_sym() {
|
|||
mbedtls_platform_zeroize(kdata, sizeof(kdata));
|
||||
mbedtls_chachapoly_free(&ctx);
|
||||
if (r != 0) {
|
||||
if (r == MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED) {
|
||||
return SW_WRONG_DATA();
|
||||
}
|
||||
return SW_EXEC_ERROR();
|
||||
}
|
||||
if (algo == ALGO_EXT_CIPHER_ENCRYPT) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue