From bf57d7177d54c1e6ded245d95b12d56c690a5632 Mon Sep 17 00:00:00 2001 From: Reda Chouk Date: Thu, 28 Nov 2024 14:52:51 +0100 Subject: [PATCH] Addressing CI/CD before continuing with the fixing --- wolfcrypt/src/evp.c | 4 +++- wolfcrypt/src/port/Renesas/renesas_fspsm_util.c | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index 336c7db746..ad3253e85b 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -4871,8 +4871,10 @@ int wolfSSL_PKCS5_PBKDF2_HMAC(const char *pass, int passlen, passlen = (int)XSTRLEN(pass); } + enum wc_HashType pbkdf2HashType = EvpMd2MacType(digest); + ret = wc_PBKDF2((byte*)out, (byte*)pass, passlen, (byte*)salt, saltlen, - iter, keylen, (int)EvpMd2MacType(digest)); + iter, keylen, pbkdf2HashType); if (ret == 0) return WOLFSSL_SUCCESS; else diff --git a/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c b/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c index da1ff1aaf8..7f4544d145 100644 --- a/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c +++ b/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c @@ -246,7 +246,8 @@ static int fspsm_ServerKeyExVerify(uint32_t type, WOLFSSL* ssl, } /* make peer ecc key data for SCE */ /* 0padding(24bit) || 04(8bit) || Qx(256bit) || Qy(256bit) */ - peerkey = (byte*)XMALLOC((3 + 1 + qxLen + qyLen), NULL, DYNAMIC_TYPE_TMP_BUFFER); + peerkey = (byte*)XMALLOC((3 + 1 + qxLen + qyLen), NULL, + DYNAMIC_TYPE_TMP_BUFFER); if (peerkey == NULL) { WOLFSSL_MSG("failed to malloc ecc key"); return WOLFSSL_FAILURE; @@ -336,7 +337,7 @@ WOLFSSL_LOCAL int wc_fspsm_EccVerifyTLS(WOLFSSL* ssl, const uint8_t* sig, } if ((sigforSCE = (uint8_t*)XMALLOC(HW_SCE_ECDSA_DATA_BYTE_SIZE, NULL, - DYNAMIC_TYPE_TEMP)) == NULL) { + DYNAMIC_TYPE_TMP_BUFFER)) == NULL) { WOLFSSL_MSG("failed to malloc memory"); return MEMORY_E; } @@ -371,7 +372,7 @@ WOLFSSL_LOCAL int wc_fspsm_EccVerifyTLS(WOLFSSL* ssl, const uint8_t* sig, ret = fspsm_ServerKeyExVerify(2, ssl, sigforSCE, 64, ctx); - XFREE(sigforSCE, NULL, DYNAMIC_TYPE_TEMP); + XFREE(sigforSCE, NULL, DYNAMIC_TYPE_TMP_BUFFER); if (ret == WOLFSSL_SUCCESS) { *result = 1; @@ -1019,7 +1020,7 @@ WOLFSSL_LOCAL int wc_fspsm_tls_CertVerify( SCE_TLS_PUBLIC_KEY_TYPE_ECDSA_P256/*ECDSA*/) { if ((sigforSCE = (uint8_t*)XMALLOC(HW_SCE_ECDSA_DATA_BYTE_SIZE, NULL, - DYNAMIC_TYPE_TEMP)) == NULL) { + DYNAMIC_TYPE_TMP_BUFFER)) == NULL) { WOLFSSL_MSG("failed to malloc memory"); return MEMORY_E; } @@ -1071,7 +1072,7 @@ WOLFSSL_LOCAL int wc_fspsm_tls_CertVerify( if (ret != FSP_SUCCESS) { WOLFSSL_MSG(" R_XXX_TlsCertificateVerification() failed"); } - XFREE(sigforSCE, NULL, DYNAMIC_TYPE_TEMP); + XFREE(sigforSCE, NULL, DYNAMIC_TYPE_TMP_BUFFER); wc_fspsm_hw_unlock(); } else {