mirror of https://github.com/wolfSSL/wolfssl.git
Merge pull request #4511 from JacobBarthelmeh/Testing
build fixes and PKCS7 BER encoding fixpull/4525/head
commit
6bb7e3900e
15
src/ssl.c
15
src/ssl.c
|
@ -27503,7 +27503,7 @@ int wolfSSL_ASN1_TIME_to_tm(const WOLFSSL_ASN1_TIME* asnTime, struct tm* tm)
|
||||||
}
|
}
|
||||||
|
|
||||||
currentTime = XTIME(0);
|
currentTime = XTIME(0);
|
||||||
if (currentTime < 0) {
|
if (currentTime <= 0) {
|
||||||
WOLFSSL_MSG("Failed to get current time.");
|
WOLFSSL_MSG("Failed to get current time.");
|
||||||
return WOLFSSL_FAILURE;
|
return WOLFSSL_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -30259,7 +30259,7 @@ int wolfSSL_ASN1_TIME_diff(int *days, int *secs, const WOLFSSL_ASN1_TIME *from,
|
||||||
}
|
}
|
||||||
|
|
||||||
fromSecs = XMKTIME(fromTm);
|
fromSecs = XMKTIME(fromTm);
|
||||||
if (fromSecs < 0) {
|
if (fromSecs <= 0) {
|
||||||
WOLFSSL_MSG("XMKTIME for from time failed.");
|
WOLFSSL_MSG("XMKTIME for from time failed.");
|
||||||
return WOLFSSL_FAILURE;
|
return WOLFSSL_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -30278,7 +30278,7 @@ int wolfSSL_ASN1_TIME_diff(int *days, int *secs, const WOLFSSL_ASN1_TIME *from,
|
||||||
}
|
}
|
||||||
|
|
||||||
toSecs = XMKTIME(toTm);
|
toSecs = XMKTIME(toTm);
|
||||||
if (toSecs < 0) {
|
if (toSecs <= 0) {
|
||||||
WOLFSSL_MSG("XMKTIME for to time failed.");
|
WOLFSSL_MSG("XMKTIME for to time failed.");
|
||||||
return WOLFSSL_FAILURE;
|
return WOLFSSL_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -35689,6 +35689,7 @@ static int wolfSSL_RSA_To_Der(WOLFSSL_RSA* rsa, byte** outBuf, int publicKey, vo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(void)heap; /* unused if memory is disabled */
|
||||||
WOLFSSL_LEAVE("wolfSSL_RSA_To_Der", derSz);
|
WOLFSSL_LEAVE("wolfSSL_RSA_To_Der", derSz);
|
||||||
return derSz;
|
return derSz;
|
||||||
}
|
}
|
||||||
|
@ -46873,10 +46874,18 @@ int wolfSSL_CRYPTO_set_mem_functions(
|
||||||
wolfSSL_Realloc_cb r,
|
wolfSSL_Realloc_cb r,
|
||||||
wolfSSL_Free_cb f)
|
wolfSSL_Free_cb f)
|
||||||
{
|
{
|
||||||
|
#ifdef USE_WOLFSSL_MEMORY
|
||||||
if (wolfSSL_SetAllocators(m, f, r) == 0)
|
if (wolfSSL_SetAllocators(m, f, r) == 0)
|
||||||
return WOLFSSL_SUCCESS;
|
return WOLFSSL_SUCCESS;
|
||||||
else
|
else
|
||||||
return WOLFSSL_FAILURE;
|
return WOLFSSL_FAILURE;
|
||||||
|
#else
|
||||||
|
(void)m;
|
||||||
|
(void)r;
|
||||||
|
(void)f;
|
||||||
|
WOLFSSL_MSG("wolfSSL allocator callback functions not compiled in");
|
||||||
|
return WOLFSSL_FAILURE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WOLFSSL_KEY_GEN) && !defined(HAVE_SELFTEST) && !defined(NO_DH)
|
#if defined(WOLFSSL_KEY_GEN) && !defined(HAVE_SELFTEST) && !defined(NO_DH)
|
||||||
|
|
|
@ -28222,7 +28222,7 @@ static void test_wc_PKCS7_EncodeDecodeEnvelopedData (void)
|
||||||
static void test_wc_PKCS7_EncodeEncryptedData (void)
|
static void test_wc_PKCS7_EncodeEncryptedData (void)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_PKCS7) && !defined(NO_PKCS7_ENCRYPTED_DATA)
|
#if defined(HAVE_PKCS7) && !defined(NO_PKCS7_ENCRYPTED_DATA)
|
||||||
PKCS7* pkcs7;
|
PKCS7* pkcs7 = NULL;
|
||||||
byte* tmpBytePtr = NULL;
|
byte* tmpBytePtr = NULL;
|
||||||
byte encrypted[TWOK_BUF];
|
byte encrypted[TWOK_BUF];
|
||||||
byte decoded[TWOK_BUF];
|
byte decoded[TWOK_BUF];
|
||||||
|
|
|
@ -10186,7 +10186,7 @@ static int wc_PKCS7_ParseToRecipientInfoSet(PKCS7* pkcs7, byte* in,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
pkiMsg = in = pkcs7->der;
|
pkiMsg = in = pkcs7->der;
|
||||||
pkiMsgSz = pkcs7->derSz = len;
|
pkiMsgSz = pkcs7->derSz = inSz = len;
|
||||||
*idx = 0;
|
*idx = 0;
|
||||||
|
|
||||||
if (GetSequence(pkiMsg, idx, &length, pkiMsgSz) < 0)
|
if (GetSequence(pkiMsg, idx, &length, pkiMsgSz) < 0)
|
||||||
|
|
|
@ -3728,10 +3728,9 @@ int wc_RsaPSS_CheckPadding_ex2(const byte* in, word32 inSz, byte* sig,
|
||||||
if (sigCheck != NULL && sigCheck != sigCheckBuf) {
|
if (sigCheck != NULL && sigCheck != sigCheckBuf) {
|
||||||
XFREE(sigCheck, heap, DYNAMIC_TYPE_RSA_BUFFER);
|
XFREE(sigCheck, heap, DYNAMIC_TYPE_RSA_BUFFER);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
(void)heap;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
(void)heap; /* unused if memory is disabled */
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
int wc_RsaPSS_CheckPadding_ex(const byte* in, word32 inSz, byte* sig,
|
int wc_RsaPSS_CheckPadding_ex(const byte* in, word32 inSz, byte* sig,
|
||||||
|
|
|
@ -320,6 +320,9 @@
|
||||||
#elif defined(WOLFSSL_LINUXKM)
|
#elif defined(WOLFSSL_LINUXKM)
|
||||||
#define SEND_FUNCTION linuxkm_send
|
#define SEND_FUNCTION linuxkm_send
|
||||||
#define RECV_FUNCTION linuxkm_recv
|
#define RECV_FUNCTION linuxkm_recv
|
||||||
|
#elif defined(WOLFSSL_SGX)
|
||||||
|
#define SEND_FUNCTION send
|
||||||
|
#define RECV_FUNCTION recv
|
||||||
#else
|
#else
|
||||||
#define SEND_FUNCTION send
|
#define SEND_FUNCTION send
|
||||||
#define RECV_FUNCTION recv
|
#define RECV_FUNCTION recv
|
||||||
|
|
Loading…
Reference in New Issue