diff --git a/src/src_cryptography/src_libgcrypt/cryptography_interface_libgcrypt.template.c b/src/src_cryptography/src_libgcrypt/cryptography_interface_libgcrypt.template.c index fd877ea1..725733b7 100644 --- a/src/src_cryptography/src_libgcrypt/cryptography_interface_libgcrypt.template.c +++ b/src/src_cryptography/src_libgcrypt/cryptography_interface_libgcrypt.template.c @@ -571,6 +571,7 @@ static int32_t cryptography_authenticate(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_mac_open error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; return status; } @@ -588,6 +589,7 @@ static int32_t cryptography_authenticate(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_mac_setkey error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; gcry_mac_close(tmp_mac_hd); return status; @@ -600,6 +602,7 @@ static int32_t cryptography_authenticate(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_mac_setiv error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERROR; return status; } @@ -625,6 +628,7 @@ static int32_t cryptography_authenticate(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_mac_read error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_MAC_RETRIEVAL_ERROR; return status; } @@ -669,6 +673,7 @@ static int32_t cryptography_validate_authentication(uint8_t* data_out, size_t le if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_mac_open error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; return status; } @@ -686,6 +691,7 @@ static int32_t cryptography_validate_authentication(uint8_t* data_out, size_t le if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_mac_setkey error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; gcry_mac_close(tmp_mac_hd); return status; @@ -697,6 +703,7 @@ static int32_t cryptography_validate_authentication(uint8_t* data_out, size_t le if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_mac_setiv error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERROR; return status; } @@ -721,6 +728,7 @@ static int32_t cryptography_validate_authentication(uint8_t* data_out, size_t le if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_mac_read error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_MAC_RETRIEVAL_ERROR; return status; } @@ -752,6 +760,7 @@ static int32_t cryptography_aead_encrypt(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_cipher_open error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; return status; } @@ -769,6 +778,7 @@ static int32_t cryptography_aead_encrypt(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_cipher_setkey error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; gcry_cipher_close(tmp_hd); return status; @@ -777,6 +787,7 @@ static int32_t cryptography_aead_encrypt(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_cipher_setiv error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; gcry_cipher_close(tmp_hd); return status; @@ -832,6 +843,7 @@ static int32_t cryptography_aead_encrypt(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_cipher_encrypt error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERROR; gcry_cipher_close(tmp_hd); return status; @@ -859,6 +871,7 @@ static int32_t cryptography_aead_encrypt(uint8_t* data_out, size_t len_data_out, { printf(KRED "ERROR: gcry_cipher_checktag error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_MAC_RETRIEVAL_ERROR; gcry_cipher_close(tmp_hd); return status; @@ -904,6 +917,7 @@ static int32_t cryptography_aead_decrypt(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_cipher_open error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; return status; } @@ -911,6 +925,7 @@ static int32_t cryptography_aead_decrypt(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_cipher_setkey error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; gcry_cipher_close(tmp_hd); return status; @@ -919,6 +934,7 @@ static int32_t cryptography_aead_decrypt(uint8_t* data_out, size_t len_data_out, if ((gcry_error & GPG_ERR_CODE_MASK) != GPG_ERR_NO_ERROR) { printf(KRED "ERROR: gcry_cipher_setiv error code %d\n" RESET, gcry_error & GPG_ERR_CODE_MASK); + printf(KRED "Failure: %s/%s\n", gcry_strsource(gcry_error), gcry_strerror(gcry_error)); status = CRYPTO_LIB_ERR_LIBGCRYPT_ERROR; gcry_cipher_close(tmp_hd); return status;