mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-02-03 23:25:05 +01:00
generalize sce protect impl to fsp sm(secure module)
This commit is contained in:
@@ -259,7 +259,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
#endif /* !WOLFSSL_NO_TLS12 */
|
||||
|
||||
|
||||
#if defined(WOLFSSL_RENESAS_SCEPROTECT) || defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
#if defined(WOLFSSL_RENESAS_FSPSM_TLS) || defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
#include <wolfssl/wolfcrypt/port/Renesas/renesas_cmn.h>
|
||||
#endif
|
||||
|
||||
@@ -1926,7 +1926,7 @@ int wolfSSL_session_import_internal(WOLFSSL* ssl, const unsigned char* buf,
|
||||
/* set hmac function to use when verifying */
|
||||
if (ret == 0 && (ssl->options.tls == 1 || ssl->options.tls1_1 == 1 ||
|
||||
ssl->options.dtls == 1)) {
|
||||
#if !defined(WOLFSSL_RENESAS_SCEPROTECT) && \
|
||||
#if !defined(WOLFSSL_RENESAS_FSPSM_TLS) && \
|
||||
!defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
ssl->hmac = TLS_hmac;
|
||||
#else
|
||||
@@ -4850,7 +4850,7 @@ int RsaVerify(WOLFSSL* ssl, byte* in, word32 inSz, byte** out, int sigAlgo,
|
||||
void* ctx = wolfSSL_GetRsaVerifyCtx(ssl);
|
||||
ret = ssl->ctx->RsaVerifyCb(ssl, in, inSz, out, keyBuf, keySz, ctx);
|
||||
}
|
||||
#if !defined(WOLFSSL_RENESAS_SCEPROTECT) && \
|
||||
#if !defined(WOLFSSL_RENESAS_FSPSM_TLS) && \
|
||||
!defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
else
|
||||
#else
|
||||
@@ -5109,7 +5109,7 @@ int RsaEnc(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out, word32* outSz,
|
||||
void* ctx = wolfSSL_GetRsaEncCtx(ssl);
|
||||
ret = ssl->ctx->RsaEncCb(ssl, in, inSz, out, outSz, keyBuf, keySz, ctx);
|
||||
}
|
||||
#if !defined(WOLFSSL_RENESAS_SCEPROTECT) && \
|
||||
#if !defined(WOLFSSL_RENESAS_FSPSM_TLS) && \
|
||||
!defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
else
|
||||
#else
|
||||
@@ -5237,7 +5237,7 @@ int EccVerify(WOLFSSL* ssl, const byte* in, word32 inSz, const byte* out,
|
||||
ret = ssl->ctx->EccVerifyCb(ssl, in, inSz, out, outSz, keyBuf, keySz,
|
||||
&ssl->eccVerifyRes, ctx);
|
||||
}
|
||||
#if !defined(WOLFSSL_RENESAS_SCEPROTECT) && \
|
||||
#if !defined(WOLFSSL_RENESAS_FSPSM_TLS) && \
|
||||
!defined(WOLFSSL_RENESAS_TSIP_TLS) && \
|
||||
!defined(WOLFSSL_MAXQ108X)
|
||||
else
|
||||
@@ -7216,7 +7216,7 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
|
||||
#ifndef NO_OLD_TLS
|
||||
ssl->hmac = SSL_hmac; /* default to SSLv3 */
|
||||
#elif !defined(WOLFSSL_NO_TLS12) && !defined(NO_TLS)
|
||||
#if !defined(WOLFSSL_RENESAS_SCEPROTECT) && \
|
||||
#if !defined(WOLFSSL_RENESAS_FSPSM_TLS) && \
|
||||
!defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
ssl->hmac = TLS_hmac;
|
||||
#else
|
||||
@@ -7974,7 +7974,7 @@ void SSL_ResourceFree(WOLFSSL* ssl)
|
||||
FreeKey(ssl, DYNAMIC_TYPE_RSA, (void**)&ssl->peerRsaKey);
|
||||
ssl->peerRsaKeyPresent = 0;
|
||||
#endif
|
||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_SCEPROTECT)
|
||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_FSPSM_TLS)
|
||||
XFREE(ssl->peerSceTsipEncRsaKeyIndex, ssl->heap, DYNAMIC_TYPE_RSA);
|
||||
Renesas_cmn_Cleanup(ssl);
|
||||
#endif
|
||||
@@ -12698,7 +12698,7 @@ int InitSigPkCb(WOLFSSL* ssl, SignatureCtx* sigCtx)
|
||||
|
||||
/* only setup the verify callback if a PK is set */
|
||||
#ifdef HAVE_ECC
|
||||
#if defined(WOLFSSL_RENESAS_SCEPROTECT) || defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
#if defined(WOLFSSL_RENESAS_FSPSM_TLS) || defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
sigCtx->pkCbEcc = Renesas_cmn_SigPkCbEccVerify;
|
||||
sigCtx->pkCtxEcc = (void*)&sigCtx->CertAtt;
|
||||
(void)SigPkCbEccVerify;
|
||||
@@ -12712,7 +12712,7 @@ int InitSigPkCb(WOLFSSL* ssl, SignatureCtx* sigCtx)
|
||||
#endif
|
||||
#ifndef NO_RSA
|
||||
/* only setup the verify callback if a PK is set */
|
||||
#if defined(WOLFSSL_RENESAS_SCEPROTECT) || defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
#if defined(WOLFSSL_RENESAS_FSPSM_TLS) || defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
sigCtx->pkCbRsa = Renesas_cmn_SigPkCbRsaVerify;
|
||||
sigCtx->pkCtxRsa = (void*)&sigCtx->CertAtt;
|
||||
(void)SigPkCbRsaVerify;
|
||||
@@ -14673,7 +14673,7 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||
else {
|
||||
ssl->peerRsaKeyPresent = 1;
|
||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS) || \
|
||||
defined(WOLFSSL_RENESAS_SCEPROTECT)
|
||||
defined(WOLFSSL_RENESAS_FSPSM_TLS)
|
||||
/* copy encrypted tsip key index into ssl object */
|
||||
if (args->dCert->sce_tsip_encRsaKeyIdx) {
|
||||
if (!ssl->peerSceTsipEncRsaKeyIndex) {
|
||||
@@ -14738,7 +14738,7 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||
{
|
||||
int keyRet = 0;
|
||||
word32 idx = 0;
|
||||
#if defined(WOLFSSL_RENESAS_SCEPROTECT) || \
|
||||
#if defined(WOLFSSL_RENESAS_FSPSM_TLS) || \
|
||||
defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
/* copy encrypted tsip/sce key index into ssl object */
|
||||
if (args->dCert->sce_tsip_encRsaKeyIdx) {
|
||||
@@ -29780,8 +29780,8 @@ static int DoServerKeyExchange(WOLFSSL* ssl, const byte* input,
|
||||
#endif
|
||||
case rsa_sa_algo:
|
||||
{
|
||||
#if (defined(WOLFSSL_RENESAS_SCEPROTECT) && \
|
||||
defined(WOLFSSL_RENESAS_SCEPROTECT_ECC)) || \
|
||||
#if (defined(WOLFSSL_RENESAS_FSPSM_TLS) && \
|
||||
defined(WOLFSSL_RENESAS_FSPSM_ECC)) || \
|
||||
defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
/* already checked signature result by SCE */
|
||||
/* skip the sign checks below */
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_RENESAS_SCEPROTECT) || defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
#if defined(WOLFSSL_RENESAS_FSPSM_TLS) || defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
#include <wolfssl/wolfcrypt/port/Renesas/renesas_cmn.h>
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,7 @@ int SetCipherSpecs(WOLFSSL* ssl)
|
||||
#ifndef NO_TLS
|
||||
ssl->options.tls = 1;
|
||||
#if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
|
||||
#if !defined(WOLFSSL_RENESAS_SCEPROTECT) && \
|
||||
#if !defined(WOLFSSL_RENESAS_FSPSM_TLS) && \
|
||||
!defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
ssl->hmac = TLS_hmac;
|
||||
#else
|
||||
@@ -77,7 +77,7 @@ int SetCipherSpecs(WOLFSSL* ssl)
|
||||
#if defined(WOLFSSL_DTLS)
|
||||
if (ssl->options.dtls && ssl->version.major == DTLS_MAJOR) {
|
||||
#ifndef WOLFSSL_AEAD_ONLY
|
||||
#if !defined(WOLFSSL_RENESAS_SCEPROTECT) && \
|
||||
#if !defined(WOLFSSL_RENESAS_FSPSM_TLS) && \
|
||||
!defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
ssl->hmac = TLS_hmac;
|
||||
#else
|
||||
|
||||
@@ -1057,7 +1057,7 @@ int GetEchConfigsEx(WOLFSSL_EchConfig* configs, byte* output, word32* outputLen)
|
||||
#endif /* WOLFSSL_TLS13 && HAVE_ECH */
|
||||
|
||||
|
||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_SCEPROTECT)
|
||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_FSPSM_TLS)
|
||||
#include <wolfssl/wolfcrypt/port/Renesas/renesas_cmn.h>
|
||||
#endif
|
||||
|
||||
@@ -5933,7 +5933,7 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify)
|
||||
ret = BAD_MUTEX_E;
|
||||
}
|
||||
}
|
||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_SCEPROTECT)
|
||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_FSPSM_TLS)
|
||||
/* Verify CA by TSIP so that generated tsip key is going to be able to */
|
||||
/* be used for peer's cert verification */
|
||||
/* TSIP is only able to handle USER CA, and only one CA. */
|
||||
|
||||
Reference in New Issue
Block a user