From 4d6186beb0bca06096be6424daa2c618fb787c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 25 Nov 2019 10:53:24 +0100 Subject: [PATCH] Rename ATTACK_DETECTED to FAULT_DETECTED We don't know for sure it's an attack, it could be the hardware failing randomly as well. --- include/tinycrypt/ecc.h | 2 +- library/pk.c | 2 +- tinycrypt/ecc_dsa.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tinycrypt/ecc.h b/include/tinycrypt/ecc.h index d50183813..b19958944 100644 --- a/include/tinycrypt/ecc.h +++ b/include/tinycrypt/ecc.h @@ -88,7 +88,7 @@ extern "C" { * attacks flipping a low number of bits. */ #define UECC_SUCCESS 0 #define UECC_FAILURE 0x75555555 -#define UECC_ATTACK_DETECTED 0x7aaaaaaa +#define UECC_FAULT_DETECTED 0x7aaaaaaa /* Word size (4 bytes considering 32-bits architectures) */ #define uECC_WORD_SIZE 4 diff --git a/library/pk.c b/library/pk.c index 05ffe1c70..fbe711dc2 100644 --- a/library/pk.c +++ b/library/pk.c @@ -592,7 +592,7 @@ static int uecc_eckey_verify_wrap( void *ctx, mbedtls_md_type_t md_alg, ret_fi = uECC_verify( keypair->public_key, hash, (unsigned) hash_len, signature ); - if( ret_fi == UECC_ATTACK_DETECTED ) + if( ret_fi == UECC_FAULT_DETECTED ) return( MBEDTLS_ERR_PLATFORM_FAULT_DETECTED ); if( ret_fi == UECC_SUCCESS ) diff --git a/tinycrypt/ecc_dsa.c b/tinycrypt/ecc_dsa.c index 87fa53bf3..0d6683be0 100644 --- a/tinycrypt/ecc_dsa.c +++ b/tinycrypt/ecc_dsa.c @@ -304,7 +304,7 @@ int uECC_verify(const uint8_t *public_key, const uint8_t *message_hash, return UECC_SUCCESS; } else { - return UECC_ATTACK_DETECTED; + return UECC_FAULT_DETECTED; } }