forked from wolfSSL/wolfssl
Merge pull request #6934 from SparkiDev/regression_fixes_8
Regression test fixes
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);
|
ret = AddCRL(crl, dcrl, myBuffer, ret != ASN_CRL_NO_SIGNER_E);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
WOLFSSL_MSG("AddCRL error");
|
WOLFSSL_MSG("AddCRL error");
|
||||||
|
crl->currentEntry = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -943,8 +943,10 @@ static int Dtls13SendFragmentedInternal(WOLFSSL* ssl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = CheckAvailableSize(ssl, recordLength + MAX_MSG_EXTRA);
|
ret = CheckAvailableSize(ssl, recordLength + MAX_MSG_EXTRA);
|
||||||
if (ret != 0)
|
if (ret != 0) {
|
||||||
|
Dtls13FreeFragmentsBuffer(ssl);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
output = GetOutputBuffer(ssl);
|
output = GetOutputBuffer(ssl);
|
||||||
|
|
||||||
|
@@ -35991,6 +35991,9 @@ PKCS7* wolfSSL_d2i_PKCS7_ex(PKCS7** p7, const unsigned char** in, int len,
|
|||||||
!= 0) {
|
!= 0) {
|
||||||
WOLFSSL_MSG("wc_PKCS7_VerifySignedData failed");
|
WOLFSSL_MSG("wc_PKCS7_VerifySignedData failed");
|
||||||
wolfSSL_PKCS7_free((PKCS7*)pkcs7);
|
wolfSSL_PKCS7_free((PKCS7*)pkcs7);
|
||||||
|
if (p7 != NULL) {
|
||||||
|
*p7 = NULL;
|
||||||
|
}
|
||||||
return 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)
|
#if !defined(NO_FILESYSTEM)
|
||||||
{
|
{
|
||||||
const char* ca_cert = "./certs/ca-cert.pem";
|
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";
|
const char* ca_cert_der = "./certs/ca-cert.der";
|
||||||
|
#endif
|
||||||
const char* ca_path = "./certs";
|
const char* ca_path = "./certs";
|
||||||
|
|
||||||
#if !defined(NO_WOLFSSL_CLIENT) || !defined(WOLFSSL_NO_CLIENT_AUTH)
|
#if !defined(NO_WOLFSSL_CLIENT) || !defined(WOLFSSL_NO_CLIENT_AUTH)
|
||||||
@@ -41785,8 +41787,10 @@ static int test_wolfSSL_BIO_gets(void)
|
|||||||
ExpectNotNull(emp_bm = BUF_MEM_new());
|
ExpectNotNull(emp_bm = BUF_MEM_new());
|
||||||
ExpectNotNull(msg_bm = BUF_MEM_new());
|
ExpectNotNull(msg_bm = BUF_MEM_new());
|
||||||
ExpectIntEQ(BUF_MEM_grow(msg_bm, sizeof(msg)), sizeof(msg));
|
ExpectIntEQ(BUF_MEM_grow(msg_bm, sizeof(msg)), sizeof(msg));
|
||||||
if (EXPECT_SUCCESS())
|
if (EXPECT_SUCCESS()) {
|
||||||
XFREE(msg_bm->data, NULL, DYNAMIC_TYPE_OPENSSL);
|
XFREE(msg_bm->data, NULL, DYNAMIC_TYPE_OPENSSL);
|
||||||
|
msg_bm->data = NULL;
|
||||||
|
}
|
||||||
/* emp size is 1 for terminator */
|
/* emp size is 1 for terminator */
|
||||||
ExpectIntEQ(BUF_MEM_grow(emp_bm, sizeof(emp)), sizeof(emp));
|
ExpectIntEQ(BUF_MEM_grow(emp_bm, sizeof(emp)), sizeof(emp));
|
||||||
if (EXPECT_SUCCESS()) {
|
if (EXPECT_SUCCESS()) {
|
||||||
@@ -43619,6 +43623,7 @@ static int test_wolfSSL_GENERAL_NAME_print(void)
|
|||||||
ExpectIntEQ(XSTRNCMP((const char*)outbuf, dnsStr, XSTRLEN(dnsStr)), 0);
|
ExpectIntEQ(XSTRNCMP((const char*)outbuf, dnsStr, XSTRLEN(dnsStr)), 0);
|
||||||
|
|
||||||
sk_GENERAL_NAME_pop_free(sk, GENERAL_NAME_free);
|
sk_GENERAL_NAME_pop_free(sk, GENERAL_NAME_free);
|
||||||
|
gn = NULL;
|
||||||
sk = NULL;
|
sk = NULL;
|
||||||
X509_free(x509);
|
X509_free(x509);
|
||||||
x509 = NULL;
|
x509 = NULL;
|
||||||
@@ -59053,12 +59058,12 @@ static int test_openssl_generate_key_and_cert(void)
|
|||||||
{
|
{
|
||||||
EXPECT_DECLS;
|
EXPECT_DECLS;
|
||||||
#if defined(OPENSSL_EXTRA)
|
#if defined(OPENSSL_EXTRA)
|
||||||
|
int expectedDerSz;
|
||||||
EVP_PKEY* pkey = NULL;
|
EVP_PKEY* pkey = NULL;
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
EC_KEY* ec_key = NULL;
|
EC_KEY* ec_key = NULL;
|
||||||
#endif
|
#endif
|
||||||
#if !defined(NO_RSA)
|
#if !defined(NO_RSA)
|
||||||
int expectedDerSz;
|
|
||||||
int key_length = 2048;
|
int key_length = 2048;
|
||||||
BIGNUM* exponent = NULL;
|
BIGNUM* exponent = NULL;
|
||||||
RSA* rsa = NULL;
|
RSA* rsa = NULL;
|
||||||
@@ -59103,7 +59108,6 @@ static int test_openssl_generate_key_and_cert(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)expectedDerSz;
|
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
pkey = NULL;
|
pkey = NULL;
|
||||||
BN_free(exponent);
|
BN_free(exponent);
|
||||||
@@ -59133,6 +59137,7 @@ static int test_openssl_generate_key_and_cert(void)
|
|||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
#endif /* HAVE_ECC */
|
#endif /* HAVE_ECC */
|
||||||
(void)pkey;
|
(void)pkey;
|
||||||
|
(void)expectedDerSz;
|
||||||
#endif /* OPENSSL_EXTRA */
|
#endif /* OPENSSL_EXTRA */
|
||||||
|
|
||||||
return EXPECT_RESULT();
|
return EXPECT_RESULT();
|
||||||
@@ -59266,10 +59271,10 @@ static int test_wolfSSL_CTX_LoadCRL(void)
|
|||||||
#define SUCC_T(x, y, z, p, d) ExpectIntEQ((int) x(y, z, p, d), \
|
#define SUCC_T(x, y, z, p, d) ExpectIntEQ((int) x(y, z, p, d), \
|
||||||
WOLFSSL_SUCCESS)
|
WOLFSSL_SUCCESS)
|
||||||
#ifndef NO_WOLFSSL_CLIENT
|
#ifndef NO_WOLFSSL_CLIENT
|
||||||
#define NEW_CTX(ctx) AssertNotNull( \
|
#define NEW_CTX(ctx) ExpectNotNull( \
|
||||||
(ctx) = wolfSSL_CTX_new(wolfSSLv23_client_method()))
|
(ctx) = wolfSSL_CTX_new(wolfSSLv23_client_method()))
|
||||||
#elif !defined(NO_WOLFSSL_SERVER)
|
#elif !defined(NO_WOLFSSL_SERVER)
|
||||||
#define NEW_CTX(ctx) AssertNotNull( \
|
#define NEW_CTX(ctx) ExpectNotNull( \
|
||||||
(ctx) = wolfSSL_CTX_new(wolfSSLv23_server_method()))
|
(ctx) = wolfSSL_CTX_new(wolfSSLv23_server_method()))
|
||||||
#else
|
#else
|
||||||
#define NEW_CTX(ctx) return
|
#define NEW_CTX(ctx) return
|
||||||
|
Reference in New Issue
Block a user