Skip to content

Commit 9884379

Browse files
Merge pull request #6934 from SparkiDev/regression_fixes_8
Regression test fixes
2 parents 59e947d + 0eab70f commit 9884379

4 files changed

Lines changed: 17 additions & 6 deletions

File tree

src/crl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz, int type,
628628
ret = AddCRL(crl, dcrl, myBuffer, ret != ASN_CRL_NO_SIGNER_E);
629629
if (ret != 0) {
630630
WOLFSSL_MSG("AddCRL error");
631+
crl->currentEntry = NULL;
631632
}
632633
}
633634

src/dtls13.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,10 @@ static int Dtls13SendFragmentedInternal(WOLFSSL* ssl)
943943
}
944944

945945
ret = CheckAvailableSize(ssl, recordLength + MAX_MSG_EXTRA);
946-
if (ret != 0)
946+
if (ret != 0) {
947+
Dtls13FreeFragmentsBuffer(ssl);
947948
return ret;
949+
}
948950

949951
output = GetOutputBuffer(ssl);
950952

src/ssl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35991,6 +35991,9 @@ PKCS7* wolfSSL_d2i_PKCS7_ex(PKCS7** p7, const unsigned char** in, int len,
3599135991
!= 0) {
3599235992
WOLFSSL_MSG("wc_PKCS7_VerifySignedData failed");
3599335993
wolfSSL_PKCS7_free((PKCS7*)pkcs7);
35994+
if (p7 != NULL) {
35995+
*p7 = NULL;
35996+
}
3599435997
return NULL;
3599535998
}
3599635999
}

tests/api.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,9 @@ static int test_wolfSSL_CertManagerAPI(void)
18591859
#if !defined(NO_FILESYSTEM)
18601860
{
18611861
const char* ca_cert = "./certs/ca-cert.pem";
1862+
#if !defined(NO_WOLFSSL_CLIENT) || !defined(WOLFSSL_NO_CLIENT_AUTH)
18621863
const char* ca_cert_der = "./certs/ca-cert.der";
1864+
#endif
18631865
const char* ca_path = "./certs";
18641866

18651867
#if !defined(NO_WOLFSSL_CLIENT) || !defined(WOLFSSL_NO_CLIENT_AUTH)
@@ -41785,8 +41787,10 @@ static int test_wolfSSL_BIO_gets(void)
4178541787
ExpectNotNull(emp_bm = BUF_MEM_new());
4178641788
ExpectNotNull(msg_bm = BUF_MEM_new());
4178741789
ExpectIntEQ(BUF_MEM_grow(msg_bm, sizeof(msg)), sizeof(msg));
41788-
if (EXPECT_SUCCESS())
41790+
if (EXPECT_SUCCESS()) {
4178941791
XFREE(msg_bm->data, NULL, DYNAMIC_TYPE_OPENSSL);
41792+
msg_bm->data = NULL;
41793+
}
4179041794
/* emp size is 1 for terminator */
4179141795
ExpectIntEQ(BUF_MEM_grow(emp_bm, sizeof(emp)), sizeof(emp));
4179241796
if (EXPECT_SUCCESS()) {
@@ -43619,6 +43623,7 @@ static int test_wolfSSL_GENERAL_NAME_print(void)
4361943623
ExpectIntEQ(XSTRNCMP((const char*)outbuf, dnsStr, XSTRLEN(dnsStr)), 0);
4362043624

4362143625
sk_GENERAL_NAME_pop_free(sk, GENERAL_NAME_free);
43626+
gn = NULL;
4362243627
sk = NULL;
4362343628
X509_free(x509);
4362443629
x509 = NULL;
@@ -59053,12 +59058,12 @@ static int test_openssl_generate_key_and_cert(void)
5905359058
{
5905459059
EXPECT_DECLS;
5905559060
#if defined(OPENSSL_EXTRA)
59061+
int expectedDerSz;
5905659062
EVP_PKEY* pkey = NULL;
5905759063
#ifdef HAVE_ECC
5905859064
EC_KEY* ec_key = NULL;
5905959065
#endif
5906059066
#if !defined(NO_RSA)
59061-
int expectedDerSz;
5906259067
int key_length = 2048;
5906359068
BIGNUM* exponent = NULL;
5906459069
RSA* rsa = NULL;
@@ -59103,7 +59108,6 @@ static int test_openssl_generate_key_and_cert(void)
5910359108
#endif
5910459109
}
5910559110

59106-
(void)expectedDerSz;
5910759111
EVP_PKEY_free(pkey);
5910859112
pkey = NULL;
5910959113
BN_free(exponent);
@@ -59133,6 +59137,7 @@ static int test_openssl_generate_key_and_cert(void)
5913359137
EVP_PKEY_free(pkey);
5913459138
#endif /* HAVE_ECC */
5913559139
(void)pkey;
59140+
(void)expectedDerSz;
5913659141
#endif /* OPENSSL_EXTRA */
5913759142

5913859143
return EXPECT_RESULT();
@@ -59266,10 +59271,10 @@ static int test_wolfSSL_CTX_LoadCRL(void)
5926659271
#define SUCC_T(x, y, z, p, d) ExpectIntEQ((int) x(y, z, p, d), \
5926759272
WOLFSSL_SUCCESS)
5926859273
#ifndef NO_WOLFSSL_CLIENT
59269-
#define NEW_CTX(ctx) AssertNotNull( \
59274+
#define NEW_CTX(ctx) ExpectNotNull( \
5927059275
(ctx) = wolfSSL_CTX_new(wolfSSLv23_client_method()))
5927159276
#elif !defined(NO_WOLFSSL_SERVER)
59272-
#define NEW_CTX(ctx) AssertNotNull( \
59277+
#define NEW_CTX(ctx) ExpectNotNull( \
5927359278
(ctx) = wolfSSL_CTX_new(wolfSSLv23_server_method()))
5927459279
#else
5927559280
#define NEW_CTX(ctx) return

0 commit comments

Comments
 (0)