From d978a57020e35fb5809637fb3bff52f102b86093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikolai=20G=C3=BCtschow?= Date: Tue, 6 Feb 2024 17:55:40 +0100 Subject: [PATCH] sys/psa_crypto: return proper error code for psa_verify_msg --- pkg/c25519/psa_c25519/edsign.c | 2 +- pkg/driver_cryptocell_310/psa_cryptocell_310/error_conversion.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/c25519/psa_c25519/edsign.c b/pkg/c25519/psa_c25519/edsign.c index 51b61c6b98..35f67a4664 100644 --- a/pkg/c25519/psa_c25519/edsign.c +++ b/pkg/c25519/psa_c25519/edsign.c @@ -73,7 +73,7 @@ psa_status_t psa_ecc_ed25519_verify_message(const uint8_t *key_buffer, ret = edsign_verify(signature, key_buffer, input, input_length); if (!ret) { - return PSA_ERROR_GENERIC_ERROR; + return PSA_ERROR_INVALID_SIGNATURE; } (void)key_buffer_size; diff --git a/pkg/driver_cryptocell_310/psa_cryptocell_310/error_conversion.c b/pkg/driver_cryptocell_310/psa_cryptocell_310/error_conversion.c index 418694b185..a470566120 100644 --- a/pkg/driver_cryptocell_310/psa_cryptocell_310/error_conversion.c +++ b/pkg/driver_cryptocell_310/psa_cryptocell_310/error_conversion.c @@ -133,7 +133,7 @@ psa_status_t CRYS_to_psa_error(CRYSError_t error) case CRYS_ECMONT_PKI_ERROR: case CRYS_ECMONT_IS_NOT_SUPPORTED: case CRYS_ECEDW_IS_NOT_SUPPORTED: - return PSA_ERROR_INVALID_ARGUMENT; + return PSA_ERROR_INVALID_ARGUMENT; default: return PSA_ERROR_GENERIC_ERROR; }