Skip to content

Commit

Permalink
Fix TSIP TLS. Call rsa_pad crypt cb in the case of TSIP
Browse files Browse the repository at this point in the history
  • Loading branch information
miyazakh committed Nov 9, 2024
1 parent 43879f9 commit 2831eb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions wolfcrypt/src/port/Renesas/renesas_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,11 @@ static int Renesas_cmn_CryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
info->pk.rsa.type == RSA_PRIVATE_DECRYPT) {
ret = tsip_SignRsaPkcs(info, cbInfo);
}
#ifdef WOLFSSL_RENESAS_TSIP_CRYPTONLY
else {
ret = wc_tsip_RsaVerifyPkcs(info, cbInfo);
}
#endif
}
#ifdef WOLFSSL_RENESAS_TSIP_CRYPTONLY
else if (pad && pad->pad_value == RSA_BLOCK_TYPE_2) {
Expand Down
7 changes: 6 additions & 1 deletion wolfcrypt/src/rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -3578,7 +3578,12 @@ static int RsaPrivateDecryptEx(const byte* in, word32 inLen, byte* out,

case RSA_STATE_DECRYPT_EXPTMOD:
#if defined(WOLF_CRYPTO_CB) && defined(WOLF_CRYPTO_CB_RSA_PAD)
if ((key->devId != INVALID_DEVID) && (rsa_type != RSA_PUBLIC_DECRYPT)) {
if ((key->devId != INVALID_DEVID)
#if !defined(WOLFSSL_RENESAS_FSPSM_CRYPTONLY) && \
!defined(WOLFSSL_RENESAS_TSIP_CRYPTONLY)
&& (rsa_type != RSA_PUBLIC_DECRYPT)
#endif
) {
/* Everything except verify goes to crypto cb if
* WOLF_CRYPTO_CB_RSA_PAD defined */
XMEMSET(&padding, 0, sizeof(RsaPadding));
Expand Down

0 comments on commit 2831eb3

Please sign in to comment.