mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
Regression test fixes
Fixes for different configurations and memory allocation failure testing.
This commit is contained in:
@@ -628,6 +628,7 @@ int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz, int type,
|
||||
ret = AddCRL(crl, dcrl, myBuffer, ret != ASN_CRL_NO_SIGNER_E);
|
||||
if (ret != 0) {
|
||||
WOLFSSL_MSG("AddCRL error");
|
||||
crl->currentEntry = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -943,8 +943,10 @@ static int Dtls13SendFragmentedInternal(WOLFSSL* ssl)
|
||||
}
|
||||
|
||||
ret = CheckAvailableSize(ssl, recordLength + MAX_MSG_EXTRA);
|
||||
if (ret != 0)
|
||||
if (ret != 0) {
|
||||
Dtls13FreeFragmentsBuffer(ssl);
|
||||
return ret;
|
||||
}
|
||||
|
||||
output = GetOutputBuffer(ssl);
|
||||
|
||||
|
@@ -35991,6 +35991,9 @@ PKCS7* wolfSSL_d2i_PKCS7_ex(PKCS7** p7, const unsigned char** in, int len,
|
||||
!= 0) {
|
||||
WOLFSSL_MSG("wc_PKCS7_VerifySignedData failed");
|
||||
wolfSSL_PKCS7_free((PKCS7*)pkcs7);
|
||||
if (p7 != NULL) {
|
||||
*p7 = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
15
tests/api.c
15
tests/api.c
@@ -1859,7 +1859,9 @@ static int test_wolfSSL_CertManagerAPI(void)
|
||||
#if !defined(NO_FILESYSTEM)
|
||||
{
|
||||
const char* ca_cert = "./certs/ca-cert.pem";
|
||||
#if !defined(NO_WOLFSSL_CLIENT) || !defined(WOLFSSL_NO_CLIENT_AUTH)
|
||||
const char* ca_cert_der = "./certs/ca-cert.der";
|
||||
#endif
|
||||
const char* ca_path = "./certs";
|
||||
|
||||
#if !defined(NO_WOLFSSL_CLIENT) || !defined(WOLFSSL_NO_CLIENT_AUTH)
|
||||
@@ -41784,8 +41786,10 @@ static int test_wolfSSL_BIO_gets(void)
|
||||
ExpectNotNull(emp_bm = BUF_MEM_new());
|
||||
ExpectNotNull(msg_bm = BUF_MEM_new());
|
||||
ExpectIntEQ(BUF_MEM_grow(msg_bm, sizeof(msg)), sizeof(msg));
|
||||
if (EXPECT_SUCCESS())
|
||||
if (EXPECT_SUCCESS()) {
|
||||
XFREE(msg_bm->data, NULL, DYNAMIC_TYPE_OPENSSL);
|
||||
msg_bm->data = NULL;
|
||||
}
|
||||
/* emp size is 1 for terminator */
|
||||
ExpectIntEQ(BUF_MEM_grow(emp_bm, sizeof(emp)), sizeof(emp));
|
||||
if (EXPECT_SUCCESS()) {
|
||||
@@ -43618,6 +43622,7 @@ static int test_wolfSSL_GENERAL_NAME_print(void)
|
||||
ExpectIntEQ(XSTRNCMP((const char*)outbuf, dnsStr, XSTRLEN(dnsStr)), 0);
|
||||
|
||||
sk_GENERAL_NAME_pop_free(sk, GENERAL_NAME_free);
|
||||
gn = NULL;
|
||||
sk = NULL;
|
||||
X509_free(x509);
|
||||
x509 = NULL;
|
||||
@@ -59052,12 +59057,12 @@ static int test_openssl_generate_key_and_cert(void)
|
||||
{
|
||||
EXPECT_DECLS;
|
||||
#if defined(OPENSSL_EXTRA)
|
||||
int expectedDerSz;
|
||||
EVP_PKEY* pkey = NULL;
|
||||
#ifdef HAVE_ECC
|
||||
EC_KEY* ec_key = NULL;
|
||||
#endif
|
||||
#if !defined(NO_RSA)
|
||||
int expectedDerSz;
|
||||
int key_length = 2048;
|
||||
BIGNUM* exponent = NULL;
|
||||
RSA* rsa = NULL;
|
||||
@@ -59102,7 +59107,6 @@ static int test_openssl_generate_key_and_cert(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
(void)expectedDerSz;
|
||||
EVP_PKEY_free(pkey);
|
||||
pkey = NULL;
|
||||
BN_free(exponent);
|
||||
@@ -59132,6 +59136,7 @@ static int test_openssl_generate_key_and_cert(void)
|
||||
EVP_PKEY_free(pkey);
|
||||
#endif /* HAVE_ECC */
|
||||
(void)pkey;
|
||||
(void)expectedDerSz;
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
|
||||
return EXPECT_RESULT();
|
||||
@@ -59265,10 +59270,10 @@ static int test_wolfSSL_CTX_LoadCRL(void)
|
||||
#define SUCC_T(x, y, z, p, d) ExpectIntEQ((int) x(y, z, p, d), \
|
||||
WOLFSSL_SUCCESS)
|
||||
#ifndef NO_WOLFSSL_CLIENT
|
||||
#define NEW_CTX(ctx) AssertNotNull( \
|
||||
#define NEW_CTX(ctx) ExpectNotNull( \
|
||||
(ctx) = wolfSSL_CTX_new(wolfSSLv23_client_method()))
|
||||
#elif !defined(NO_WOLFSSL_SERVER)
|
||||
#define NEW_CTX(ctx) AssertNotNull( \
|
||||
#define NEW_CTX(ctx) ExpectNotNull( \
|
||||
(ctx) = wolfSSL_CTX_new(wolfSSLv23_server_method()))
|
||||
#else
|
||||
#define NEW_CTX(ctx) return
|
||||
|
Reference in New Issue
Block a user