Merge pull request #4618 from douzzer/wc-port-h-linuxkm-XSNPRINTF-XATOI

linuxkm wc_port.h macro scoping fix
This commit is contained in:
David Garske 2021-11-30 08:25:06 -08:00 committed by GitHub
commit 7a41089b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 86 additions and 85 deletions

View File

@ -11079,7 +11079,7 @@ int InitSigPkCb(WOLFSSL* ssl, SignatureCtx* sigCtx)
sigCtx->pkCtxEcc = ssl;
}
#endif
#endif
#ifndef NO_RSA
/* only setup the verify callback if a PK is set */
@ -11093,7 +11093,7 @@ int InitSigPkCb(WOLFSSL* ssl, SignatureCtx* sigCtx)
sigCtx->pkCtxRsa = ssl;
}
#endif
#endif
return 0;
@ -16714,7 +16714,7 @@ static WC_INLINE int VerifyMac(WOLFSSL* ssl, const byte* input, word32 msgSz,
ret = PROTOCOLCB_UNAVAILABLE;
if(ssl->ctx->VerifyMacCb) {
void* ctx = wolfSSL_GetVerifyMacCtx(ssl);
ret = ssl->ctx->VerifyMacCb(ssl, input,
ret = ssl->ctx->VerifyMacCb(ssl, input,
(msgSz - ivExtra) - digestSz - pad - 1,
digestSz, content, ctx);
if (ret != 0 && ret != PROTOCOLCB_UNAVAILABLE) {
@ -25438,7 +25438,7 @@ int SendClientKeyExchange(WOLFSSL* ssl)
if (ret != 0) {
goto exit_scke;
}
ssl->arrays->preMasterSecret[0] = ssl->chVersion.major;
ssl->arrays->preMasterSecret[1] = ssl->chVersion.minor;

View File

@ -5003,9 +5003,9 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify)
signer->cm_idx = row;
if (type == WOLFSSL_USER_CA) {
if ((ret = wc_Renesas_cmn_RootCertVerify(cert->source, cert->maxIdx,
cert->sigCtx.CertAtt.pubkey_n_start,
cert->sigCtx.CertAtt.pubkey_n_start,
cert->sigCtx.CertAtt.pubkey_n_len - 1,
cert->sigCtx.CertAtt.pubkey_e_start,
cert->sigCtx.CertAtt.pubkey_e_start,
cert->sigCtx.CertAtt.pubkey_e_len - 1,
row/* cm index */))
< 0)
@ -5015,7 +5015,7 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify)
}
}
#endif /* TSIP or SCE */
WOLFSSL_MSG("\tFreeing Parsed CA");
FreeDecodedCert(cert);
#ifdef WOLFSSL_SMALL_STACK

View File

@ -213,7 +213,7 @@ int BuildTlsFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender)
#if !defined(NO_CERTS) && defined(HAVE_PK_CALLBACKS)
if (ssl->ctx->TlsFinishedCb) {
void* ctx = wolfSSL_GetTlsFinishedCtx(ssl);
ret = ssl->ctx->TlsFinishedCb(ssl, side, handshake_hash,
ret = ssl->ctx->TlsFinishedCb(ssl, side, handshake_hash,
(byte*)hashes, ctx);
}
if (!ssl->ctx->TlsFinishedCb || ret == PROTOCOLCB_UNAVAILABLE)

View File

@ -9715,7 +9715,7 @@ static int StoreRsaKey(DecodedCert* cert, const byte* source, word32* srcIdx,
return ASN_PARSE_E;
#if defined(WOLFSSL_RENESAS_TSIP) || defined(WOLFSSL_RENESAS_SCEPROTECT)
cert->sigCtx.CertAtt.pubkey_n_start =
cert->sigCtx.CertAtt.pubkey_n_start =
cert->sigCtx.CertAtt.pubkey_e_start = pubIdx;
#endif
cert->pubKeySize = pubLen;
@ -9743,7 +9743,7 @@ static int StoreRsaKey(DecodedCert* cert, const byte* source, word32* srcIdx,
#if defined(WOLFSSL_RENESAS_TSIP) || defined(WOLFSSL_RENESAS_SCEPROTECT)
/* Start of SEQUENCE. */
cert->sigCtx.CertAtt.pubkey_n_start =
cert->sigCtx.CertAtt.pubkey_n_start =
cert->sigCtx.CertAtt.pubkey_e_start = dataASN[1].offset;
#endif
#ifdef HAVE_OCSP
@ -9814,21 +9814,23 @@ static int StoreEccKey(DecodedCert* cert, const byte* source, word32* srcIdx,
if ((ret = CheckCurve(cert->pkCurveOID)) < 0)
return ECC_CURVE_OID_E;
#if defined(WOLFSSL_RENESAS_SCEPROTECT)
cert->sigCtx.CertAtt.curve_id = ret;
#else
(void)ret;
#endif
/* key header */
ret = CheckBitString(source, srcIdx, &length, maxIdx, 1, NULL);
if (ret != 0)
return ret;
#if defined(WOLFSSL_RENESAS_SCEPROTECT)
cert->sigCtx.CertAtt.pubkey_n_start =
cert->sigCtx.CertAtt.pubkey_n_start =
cert->sigCtx.CertAtt.pubkey_e_start = (*srcIdx + 1);
cert->sigCtx.CertAtt.pubkey_n_len = ((length - 1) >> 1);
cert->sigCtx.CertAtt.pubkey_e_start +=
cert->sigCtx.CertAtt.pubkey_n_len;
cert->sigCtx.CertAtt.pubkey_e_len =
cert->sigCtx.CertAtt.pubkey_e_len =
cert->sigCtx.CertAtt.pubkey_n_len;
#endif
#ifdef HAVE_OCSP
@ -13090,7 +13092,7 @@ static int ConfirmSignature(SignatureCtx* sigCtx,
const byte* sig, word32 sigSz, word32 sigOID, byte* rsaKeyIdx)
{
int ret = 0;
if (sigCtx == NULL || buf == NULL || bufSz == 0 || key == NULL ||
keySz == 0 || sig == NULL || sigSz == 0) {
return BAD_FUNC_ARG;
@ -13107,7 +13109,7 @@ static int ConfirmSignature(SignatureCtx* sigCtx,
(void)rsaKeyIdx;
#else
CertAttribute* certatt = NULL;
#if !defined(NO_RSA) || defined(HAVE_ECC)
certatt = (CertAttribute*)&sigCtx->CertAtt;
#endif
@ -13117,7 +13119,7 @@ static int ConfirmSignature(SignatureCtx* sigCtx,
certatt->certSz = bufSz;
}
#endif
#ifndef NO_ASN_CRYPT
switch (sigCtx->state) {
case SIG_STATE_BEGIN:
@ -18211,7 +18213,7 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
/* if the ca is verified as tsip root ca. */
/* TSIP can only handle 2048 bits(256 byte) key. */
if (cert->ca && Renesas_cmn_checkCA(cert->ca->cm_idx) != 0 &&
(cert->sigCtx.CertAtt.pubkey_n_len == 256 ||
(cert->sigCtx.CertAtt.pubkey_n_len == 256 ||
cert->sigCtx.CertAtt.curve_id == ECC_SECP256R1)) {
/* assign memory to encrypted tsip Rsa key index */
@ -18235,9 +18237,9 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
}
cert->sce_tsip_encRsaKeyIdx = NULL;
}
sce_tsip_encRsaKeyIdx = cert->sce_tsip_encRsaKeyIdx;
#else
sce_tsip_encRsaKeyIdx = NULL;
#endif

View File

@ -2490,7 +2490,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
}
#elif defined(WOLFSSL_RENESAS_SCEPROTECT)
#include "r_sce.h"
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
int ret;
@ -2513,7 +2513,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
}
return ret;
}
#elif defined(WOLFSSL_SCE) && !defined(WOLFSSL_SCE_NO_TRNG)
#include "hal_data.h"

View File

@ -184,7 +184,7 @@ where 0 <= L < 2^64.
!defined(WOLFSSL_PSOC6_CRYPTO) && !defined(WOLFSSL_IMXRT_DCP) && !defined(WOLFSSL_SILABS_SE_ACCEL) && \
!defined(WOLFSSL_KCAPI_HASH) && !defined(WOLFSSL_SE050_HASH) && \
(!defined(WOLFSSL_RENESAS_SCEPROTECT) || defined(NO_WOLFSSL_RENESAS_SCEPROTECT_HASH))
static int InitSha256(wc_Sha256* sha256)
@ -749,7 +749,7 @@ static int InitSha256(wc_Sha256* sha256)
!defined(NO_WOLFSSL_RENESAS_SCEPROTECT_HASH)
/* implemented in wolfcrypt/src/port/Renesas/renesas_sce_sha.c */
#elif defined(WOLFSSL_PSOC6_CRYPTO)
/* implemented in wolfcrypt/src/port/cypress/psoc6_crypto.c */
@ -1650,7 +1650,7 @@ void wc_Sha256Free(wc_Sha256* sha256)
!defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)) && \
(defined(WOLFSSL_RENESAS_SCEPROTECT) && \
!defined(NO_WOLFSSL_RENESAS_SCEPROTECT_HASH))
if (sha256->msg != NULL) {
XFREE(sha256->msg, sha256->heap, DYNAMIC_TYPE_TMP_BUFFER);
sha256->msg = NULL;

View File

@ -156,7 +156,7 @@ int wolfCrypt_Init(void)
return ret;
}
#endif
#if defined(WOLFSSL_RENESAS_SCEPROTECT)
ret = wc_sce_Open( );
if( ret != FSP_SUCCESS ) {
@ -166,7 +166,7 @@ int wolfCrypt_Init(void)
return ret;
}
#endif
#if defined(WOLFSSL_TRACK_MEMORY) && !defined(WOLFSSL_STATIC_MEMORY)
ret = InitMemoryTracker();
if (ret != 0) {
@ -366,13 +366,12 @@ int wolfCrypt_Cleanup(void)
#ifdef WOLFSSL_ASYNC_CRYPT
wolfAsync_HardwareStop();
#endif
#ifdef WOLFSSL_RENESAS_SCEPROTECT
wc_sce_Close();
#else
#ifdef WOLFSSL_SCE
WOLFSSL_SCE_GSCE_HANDLE.p_api->close(WOLFSSL_SCE_GSCE_HANDLE.p_ctrl);
#endif
#endif

View File

@ -1226,7 +1226,7 @@ initDefaultName();
test_pass("OPENSSL (EVP Sign/Verify) passed!\n");
#endif
#ifdef HAVE_ECC
PRIVATE_KEY_UNLOCK();
if ( (ret = ecc_test()) != 0)
@ -2316,7 +2316,7 @@ WOLFSSL_TEST_SUBROUTINE int sha_test(void)
/* BEGIN LARGE HASH TEST */ {
byte large_input[1024];
#if defined(WOLFSSL_RENESAS_TSIP) || defined(WOLFSSL_RENESAS_SCEPROTECT)
#if defined(WOLFSSL_RENESAS_TSIP) || defined(WOLFSSL_RENESAS_SCEPROTECT)
const char* large_digest =
"\x1d\x6a\x5a\xf6\xe5\x7c\x86\xce\x7f\x7c\xaf\xd5\xdb\x08\xcd\x59"
"\x15\x8c\x6d\xb6";
@ -2328,7 +2328,7 @@ WOLFSSL_TEST_SUBROUTINE int sha_test(void)
for (i = 0; i < (int)sizeof(large_input); i++) {
large_input[i] = (byte)(i & 0xFF);
}
#if defined(WOLFSSL_RENESAS_TSIP) || defined(WOLFSSL_RENESAS_SCEPROTECT)
#if defined(WOLFSSL_RENESAS_TSIP) || defined(WOLFSSL_RENESAS_SCEPROTECT)
times = 20;
#else
times = 100;
@ -2706,7 +2706,7 @@ WOLFSSL_TEST_SUBROUTINE int sha256_test(void)
/* BEGIN LARGE HASH TEST */ {
byte large_input[1024];
#if defined(WOLFSSL_RENESAS_TSIP_CRYPT) || defined(WOLFSSL_RENESAS_SCEPROTECT)
#if defined(WOLFSSL_RENESAS_TSIP_CRYPT) || defined(WOLFSSL_RENESAS_SCEPROTECT)
const char* large_digest =
"\xa4\x75\x9e\x7a\xa2\x03\x38\x32\x88\x66\xa2\xea\x17\xea\xf8\xc7"
"\xfe\x4e\xc6\xbb\xe3\xbb\x71\xce\xe7\xdf\x7c\x04\x61\xb3\xc2\x2f";

View File

@ -3211,32 +3211,32 @@ WOLFSSL_API void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl);
/* Protocol Callback */
typedef int (*CallbackGenMasterSecret)(WOLFSSL* ssl, void* ctx);
WOLFSSL_API void wolfSSL_CTX_SetGenMasterSecretCb(WOLFSSL_CTX*,
WOLFSSL_API void wolfSSL_CTX_SetGenMasterSecretCb(WOLFSSL_CTX*,
CallbackGenMasterSecret);
WOLFSSL_API void wolfSSL_SetGenMasterSecretCtx(WOLFSSL* ssl, void *ctx);
WOLFSSL_API void* wolfSSL_GetGenMasterSecretCtx(WOLFSSL* ssl);
typedef int (*CallbackGenPreMaster)(WOLFSSL* ssl, byte *premaster,
word32 preSz, void* ctx);
WOLFSSL_API void wolfSSL_CTX_SetGenPreMasterCb(WOLFSSL_CTX*,
WOLFSSL_API void wolfSSL_CTX_SetGenPreMasterCb(WOLFSSL_CTX*,
CallbackGenPreMaster);
WOLFSSL_API void wolfSSL_SetGenPreMasterCtx(WOLFSSL* ssl, void *ctx);
WOLFSSL_API void* wolfSSL_GetGenPreMasterCtx(WOLFSSL* ssl);
typedef int (*CallbackGenSessionKey)(WOLFSSL* ssl, void* ctx);
WOLFSSL_API void wolfSSL_CTX_SetGenSessionKeyCb(WOLFSSL_CTX*,
WOLFSSL_API void wolfSSL_CTX_SetGenSessionKeyCb(WOLFSSL_CTX*,
CallbackGenSessionKey);
WOLFSSL_API void wolfSSL_SetGenSessionKeyCtx(WOLFSSL* ssl, void *ctx);
WOLFSSL_API void* wolfSSL_GetGenSessionKeyCtx(WOLFSSL* ssl);
typedef int (*CallbackEncryptKeys)(WOLFSSL* ssl, void* ctx);
WOLFSSL_API void wolfSSL_CTX_SetEncryptKeysCb(WOLFSSL_CTX*,
WOLFSSL_API void wolfSSL_CTX_SetEncryptKeysCb(WOLFSSL_CTX*,
CallbackEncryptKeys);
WOLFSSL_API void wolfSSL_SetEncryptKeysCtx(WOLFSSL* ssl, void *ctx);
WOLFSSL_API void* wolfSSL_GetEncryptKeysCtx(WOLFSSL* ssl);
typedef int (*CallbackTlsFinished)(WOLFSSL* ssl,
const byte *side,
const byte *side,
const byte *handshake_hash,
byte *hashes, void* ctx);
WOLFSSL_API void wolfSSL_CTX_SetTlsFinishedCb(WOLFSSL_CTX*, CallbackTlsFinished);
@ -3244,7 +3244,7 @@ WOLFSSL_API void wolfSSL_SetTlsFinishedCtx(WOLFSSL* ssl, void *ctx);
WOLFSSL_API void* wolfSSL_GetTlsFinishedCtx(WOLFSSL* ssl);
#if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
typedef int (*CallbackVerifyMac)(WOLFSSL *ssl, const byte* message,
typedef int (*CallbackVerifyMac)(WOLFSSL *ssl, const byte* message,
word32 messageSz, word32 macSz, word32 content, void* ctx);
WOLFSSL_API void wolfSSL_CTX_SetVerifyMacCb(WOLFSSL_CTX*, CallbackVerifyMac);
WOLFSSL_API void wolfSSL_SetVerifyMacCtx(WOLFSSL* ssl, void *ctx);

View File

@ -3652,9 +3652,9 @@ typedef struct PkCbInfo {
} PkCbInfo;
#if defined(DEBUG_PK_CB) || defined(TEST_PK_PRIVKEY)
#define WOLFSSL_PKMSG(_f_, ...) printf(_f_, ##__VA_ARGS__)
#define WOLFSSL_PKMSG(...) printf(__VA_ARGS__)
#else
#define WOLFSSL_PKMSG(_f_, ...)
#define WOLFSSL_PKMSG(...)
#endif
#ifdef HAVE_ECC
@ -4610,15 +4610,15 @@ static WC_INLINE int myGenMaster(WOLFSSL* ssl, void* ctx)
{
int ret;
PkCbInfo* cbInfo = (PkCbInfo*)ctx;
(void)ssl;
(void)cbInfo;
WOLFSSL_PKMSG("Gen Master");
/* fall through to original routine */
ret = PROTOCOLCB_UNAVAILABLE;
WOLFSSL_PKMSG("Gen Master: ret %d\n", ret);
return ret;
}
@ -4627,17 +4627,17 @@ static WC_INLINE int myGenPreMaster(WOLFSSL* ssl, byte *premaster,
{
int ret;
PkCbInfo* cbInfo = (PkCbInfo*)ctx;
(void) ssl;
(void) cbInfo;
(void) premaster;
(void) preSz;
WOLFSSL_PKMSG("Gen Pre-Master Cb");
/* fall through to original routine */
ret = PROTOCOLCB_UNAVAILABLE;
WOLFSSL_PKMSG("Gen Pre-Master Cb: ret %d\n", ret);
return ret;
}
@ -4645,15 +4645,15 @@ static WC_INLINE int myGenSessionKey(WOLFSSL* ssl, void* ctx)
{
int ret;
PkCbInfo* cbInfo = (PkCbInfo*)ctx;
(void)ssl;
(void)cbInfo;
WOLFSSL_PKMSG("Gen Master Cb");
/* fall through to original routine */
ret = PROTOCOLCB_UNAVAILABLE;
WOLFSSL_PKMSG("Gen Master Cb: ret %d\n", ret);
return ret;
}
@ -4661,60 +4661,60 @@ static WC_INLINE int mySetEncryptKeys(WOLFSSL* ssl, void* ctx)
{
int ret;
PkCbInfo* cbInfo = (PkCbInfo*)ctx;
(void)ssl;
(void)cbInfo;
WOLFSSL_PKMSG("Set Encrypt Keys Cb");
/* fall through to original routine */
ret = PROTOCOLCB_UNAVAILABLE;
WOLFSSL_PKMSG("Set Encrypt Keys Cb: ret %d\n", ret);
return ret;
}
#if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
static WC_INLINE int myVerifyMac(WOLFSSL *ssl, const byte* message,
static WC_INLINE int myVerifyMac(WOLFSSL *ssl, const byte* message,
word32 messageSz, word32 macSz, word32 content, void* ctx)
{
int ret;
PkCbInfo* cbInfo = (PkCbInfo*)ctx;
(void)ssl;
(void)message;
(void)messageSz;
(void)macSz;
(void)content;
(void)cbInfo;
WOLFSSL_PKMSG("Verify Mac Cb");
/* fall through to original routine */
ret = PROTOCOLCB_UNAVAILABLE;
WOLFSSL_PKMSG("Verify Mac Cb: ret %d\n", ret);
return ret;
}
#endif
static WC_INLINE int myTlsFinished(WOLFSSL* ssl,
const byte *side,
const byte *side,
const byte *handshake_hash,
byte *hashes, void* ctx)
{
int ret;
PkCbInfo* cbInfo = (PkCbInfo*)ctx;
(void)ssl;
(void)cbInfo;
(void)side;
(void)handshake_hash;
(void)hashes;
WOLFSSL_PKMSG("Tls Finished Cb");
/* fall through to original routine */
ret = PROTOCOLCB_UNAVAILABLE;
WOLFSSL_PKMSG("Tls Finished Cb: ret %d\n", ret);
return ret;
}
@ -4767,17 +4767,17 @@ static WC_INLINE void SetupPkCallbacks(WOLFSSL_CTX* ctx)
wolfSSL_CTX_SetRsaEncCb(ctx, myRsaEnc);
wolfSSL_CTX_SetRsaDecCb(ctx, myRsaDec);
#endif /* NO_RSA */
#ifndef NO_CERTS
wolfSSL_CTX_SetGenMasterSecretCb(ctx, myGenMaster);
wolfSSL_CTX_SetGenPreMasterCb(ctx, myGenPreMaster);
wolfSSL_CTX_SetGenSessionKeyCb(ctx, myGenSessionKey);
wolfSSL_CTX_SetEncryptKeysCb(ctx, mySetEncryptKeys);
#if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
wolfSSL_CTX_SetVerifyMacCb(ctx, myVerifyMac);
#endif
wolfSSL_CTX_SetTlsFinishedCb(ctx, myTlsFinished);
#endif /* NO_CERTS */
}
@ -4819,17 +4819,17 @@ static WC_INLINE void SetupPkCallbackContexts(WOLFSSL* ssl, void* myCtx)
wolfSSL_SetRsaEncCtx(ssl, myCtx);
wolfSSL_SetRsaDecCtx(ssl, myCtx);
#endif /* NO_RSA */
#ifndef NO_CERTS
wolfSSL_SetGenMasterSecretCtx(ssl, myCtx);
wolfSSL_SetGenPreMasterCtx(ssl, myCtx);
wolfSSL_SetGenSessionKeyCtx(ssl, myCtx);
wolfSSL_SetEncryptKeysCtx(ssl, myCtx);
#if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
wolfSSL_SetVerifyMacCtx(ssl, myCtx);
#endif
wolfSSL_SetTlsFinishedCtx(ssl, myCtx);
#endif
}

View File

@ -1567,7 +1567,7 @@ struct DecodedCert {
#if defined(WOLFSSL_RENESAS_TSIP) || defined(WOLFSSL_RENESAS_SCEPROTECT)
byte* sce_tsip_encRsaKeyIdx;
#endif
int badDate;
int criticalExt;

View File

@ -247,7 +247,7 @@ enum {
ECC_PCT_E = -286, /* ECDHE Pairwise Consistency Test failure */
FIPS_PRIVATE_KEY_LOCKED_E = -287, /* Cannot export private key. */
PROTOCOLCB_UNAVAILABLE = -288, /* Protocol callback unavailable */
WC_LAST_E = -288, /* Update this to indicate last error */
MIN_CODE_E = -300 /* errors -101 - -299 */

0
wolfssl/wolfcrypt/port/Renesas/renesas_cmn.h Executable file → Normal file
View File

View File

@ -217,7 +217,7 @@
/* Uncomment next line if using RENESAS RA6M4 */
/* #define WOLFSSL_RENESAS_RA6M4 */
/* Uncomment next line if using Solaris OS*/
/* #define WOLFSSL_SOLARIS */
@ -339,7 +339,7 @@
#define SCE_TLS_CLIENTRANDOM_SZ 36 /* in bytes */
#define SCE_TLS_SERVERRANDOM_SZ 36 /* in bytes */
#define SCE_TLS_ENCRYPTED_ECCPUBKEY_SZ 96 /* in bytes */
#define WOLFSSL_RENESAS_SCEPROTECT_ECC
#if defined(WOLFSSL_RENESAS_SCEPROTECT_ECC)
#define HAVE_PK_CALLBACKS

View File

@ -579,20 +579,6 @@
extern void fipsEntry(void);
#endif
/* needed to suppress inclusion of stdio.h in wolfssl/wolfcrypt/types.h */
#define XSNPRINTF snprintf
/* the rigmarole around kstrtoll() here is to accommodate its warn-unused-result attribute. */
#define XATOI(s) ({ \
long long _xatoi_res = 0; \
int _xatoi_ret = kstrtoll(s, 10, &_xatoi_res); \
if (_xatoi_ret != 0) { \
_xatoi_res = 0; \
} \
(int)_xatoi_res; \
})
/* suppress false-positive "writing 1 byte into a region of size 0" warnings
* building old kernels with new gcc:
*/
@ -602,6 +588,20 @@
#endif /* BUILDING_WOLFSSL */
/* needed to suppress inclusion of stdio.h in wolfssl/wolfcrypt/types.h */
#define XSNPRINTF snprintf
/* the rigmarole around kstrtoll() here is to accommodate its warn-unused-result attribute. */
/* also needed to suppress inclusion of stdlib.h in wolfssl/wolfcrypt/types.h */
#define XATOI(s) ({ \
long long _xatoi_res = 0; \
int _xatoi_ret = kstrtoll(s, 10, &_xatoi_res); \
if (_xatoi_ret != 0) { \
_xatoi_res = 0; \
} \
(int)_xatoi_res; \
})
#endif /* WOLFSSL_LINUXKM */
/* THREADING/MUTEX SECTION */