mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Merge pull request #6150 from douzzer/20230301-fix-async-and-mips-and-kcapi
20230301-fix-async-and-mips-and-kcapi
This commit is contained in:
@@ -29260,15 +29260,10 @@ static int SignCert(int requestSz, int sType, byte* buf, word32 buffSz,
|
|||||||
{
|
{
|
||||||
int sigSz = 0;
|
int sigSz = 0;
|
||||||
void* heap = NULL;
|
void* heap = NULL;
|
||||||
CertSignCtx* certSignCtx;
|
|
||||||
#ifndef WOLFSSL_ASYNC_CRYPT
|
|
||||||
CertSignCtx certSignCtx_lcl;
|
CertSignCtx certSignCtx_lcl;
|
||||||
|
CertSignCtx* certSignCtx = &certSignCtx_lcl;
|
||||||
|
|
||||||
certSignCtx = &certSignCtx_lcl;
|
XMEMSET(certSignCtx, 0, sizeof(*certSignCtx));
|
||||||
XMEMSET(certSignCtx, 0, sizeof(CertSignCtx));
|
|
||||||
#else
|
|
||||||
certSignCtx = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (requestSz < 0)
|
if (requestSz < 0)
|
||||||
return requestSz;
|
return requestSz;
|
||||||
@@ -29295,12 +29290,6 @@ static int SignCert(int requestSz, int sType, byte* buf, word32 buffSz,
|
|||||||
#endif /* HAVE_ECC */
|
#endif /* HAVE_ECC */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
|
||||||
if (certSignCtx == NULL) {
|
|
||||||
return BAD_FUNC_ARG;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (certSignCtx->sig == NULL) {
|
if (certSignCtx->sig == NULL) {
|
||||||
certSignCtx->sig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, heap,
|
certSignCtx->sig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, heap,
|
||||||
DYNAMIC_TYPE_TMP_BUFFER);
|
DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
|
@@ -643,22 +643,35 @@ static void render_error_message(const char* msg, int es)
|
|||||||
break;
|
break;
|
||||||
case WC_TEST_RET_TAG_ERRNO:
|
case WC_TEST_RET_TAG_ERRNO:
|
||||||
{
|
{
|
||||||
#if defined(_GNU_SOURCE) || \
|
|
||||||
(defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L))
|
/* strerror_r() comes in two mutually incompatible flavors, a native glibc
|
||||||
|
* flavor that always returns a non-null char pointer that must be used
|
||||||
|
* directly, and a POSIX flavor that returns an error int, and iff success,
|
||||||
|
* stores an error string in the supplied buffer. this is all most
|
||||||
|
* infelicitous...
|
||||||
|
*/
|
||||||
|
#if !defined(STRING_USER) && !defined(NO_ERROR_STRINGS) && \
|
||||||
|
(defined(_GNU_SOURCE) || defined(__USE_GNU) || \
|
||||||
|
(defined(__USE_XOPEN2K) && \
|
||||||
|
defined(_POSIX_C_SOURCE) && \
|
||||||
|
(_POSIX_C_SOURCE >= 200112L)))
|
||||||
|
|
||||||
char errno_buf[64], *errno_string;
|
char errno_buf[64], *errno_string;
|
||||||
#if defined(_GNU_SOURCE)
|
/* precisely mirror the gate used in glibc string.h */
|
||||||
errno_string = strerror_r(WC_TEST_RET_DEC_I(es),
|
#if defined __USE_XOPEN2K && !defined __USE_GNU
|
||||||
errno_buf, sizeof(errno_buf));
|
|
||||||
#else
|
|
||||||
if (strerror_r(WC_TEST_RET_DEC_I(es),
|
if (strerror_r(WC_TEST_RET_DEC_I(es),
|
||||||
errno_buf, sizeof(errno_buf)) != 0)
|
errno_buf, sizeof(errno_buf)) != 0)
|
||||||
XSTRLCPY(errno_buf, "?", sizeof(errno_buf));
|
XSTRLCPY(errno_buf, "?", sizeof(errno_buf));
|
||||||
errno_string = errno_buf;
|
errno_string = errno_buf;
|
||||||
|
#else
|
||||||
|
errno_string = strerror_r(WC_TEST_RET_DEC_I(es),
|
||||||
|
errno_buf, sizeof(errno_buf));
|
||||||
#endif
|
#endif
|
||||||
err_sys_printf("%s error L=%d errno=%d (%s)\n", msg,
|
err_sys_printf("%s error L=%d errno=%d (%s)\n", msg,
|
||||||
WC_TEST_RET_DEC_LN(es), WC_TEST_RET_DEC_I(es),
|
WC_TEST_RET_DEC_LN(es), WC_TEST_RET_DEC_I(es),
|
||||||
errno_string);
|
errno_string);
|
||||||
#else
|
|
||||||
|
#else /* can't figure out how to strerror_r(), or don't want error strings */
|
||||||
err_sys_printf("%s error L=%d errno=%d\n", msg,
|
err_sys_printf("%s error L=%d errno=%d\n", msg,
|
||||||
WC_TEST_RET_DEC_LN(es), WC_TEST_RET_DEC_I(es));
|
WC_TEST_RET_DEC_LN(es), WC_TEST_RET_DEC_I(es));
|
||||||
#endif
|
#endif
|
||||||
|
@@ -202,7 +202,7 @@ typedef WOLFSSL_SHA256_CTX SHA256_CTX;
|
|||||||
#ifdef WOLFSSL_SHA384
|
#ifdef WOLFSSL_SHA384
|
||||||
typedef struct WOLFSSL_SHA384_CTX {
|
typedef struct WOLFSSL_SHA384_CTX {
|
||||||
/* big enough to hold wolfCrypt Sha384, but check on init */
|
/* big enough to hold wolfCrypt Sha384, but check on init */
|
||||||
void* holder[(268 + CTX_SHA_HW_ADDER + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
|
void* holder[(288 + CTX_SHA_HW_ADDER + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
|
||||||
#if defined(WOLFSSL_DEVCRYPTO_HASH) || defined(WOLFSSL_HASH_KEEP)
|
#if defined(WOLFSSL_DEVCRYPTO_HASH) || defined(WOLFSSL_HASH_KEEP)
|
||||||
void* keephash_holder[sizeof(void*) + (2 * sizeof(unsigned int))];
|
void* keephash_holder[sizeof(void*) + (2 * sizeof(unsigned int))];
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1928,6 +1928,11 @@ extern void uITRON4_free(void *p) ;
|
|||||||
#define XGEN_ALIGN
|
#define XGEN_ALIGN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__mips) || defined(__mips64) || \
|
||||||
|
defined(WOLFSSL_SP_MIPS64) || defined(WOLFSSL_SP_MIPS)
|
||||||
|
#undef WOLFSSL_SP_INT_DIGIT_ALIGN
|
||||||
|
#define WOLFSSL_SP_INT_DIGIT_ALIGN
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __INTEL_COMPILER
|
#ifdef __INTEL_COMPILER
|
||||||
#pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
|
#pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
|
||||||
|
Reference in New Issue
Block a user