Skip to content

Commit 72d08a1

Browse files
authored
Merge pull request #8522 from douzzer/20250228-fixes
20250228-fixes
2 parents 7698546 + 058014b commit 72d08a1

7 files changed

Lines changed: 29 additions & 34 deletions

File tree

.wolfssl_known_macro_extras

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -826,11 +826,6 @@ WOLFSSL_XIL_MSG_NO_SLEEP
826826
WOLFSSL_XMSS_LARGE_SECRET_KEY
827827
WOLFSSL_ZEPHYR
828828
WOLF_ALLOW_BUILTIN
829-
WOLF_CONF_IO
830-
WOLF_CONF_KYBER
831-
WOLF_CONF_PK
832-
WOLF_CONF_RESUMPTION
833-
WOLF_CONF_TPM
834829
WOLF_CRYPTO_CB_CMD
835830
WOLF_CRYPTO_CB_FIND
836831
WOLF_CRYPTO_CB_ONLY_ECC

src/internal.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8379,7 +8379,7 @@ void FreeKeyExchange(WOLFSSL* ssl)
83798379
/* Free up all memory used by Suites structure from WOLFSSL */
83808380
void FreeSuites(WOLFSSL* ssl)
83818381
{
8382-
#ifdef OPENSSL_ALL
8382+
#ifdef OPENSSL_EXTRA
83838383
if (ssl->suitesStack != NULL) {
83848384
/* Enough to free stack structure since WOLFSSL_CIPHER
83858385
* isn't allocated separately. */
@@ -8392,8 +8392,6 @@ void FreeSuites(WOLFSSL* ssl)
83928392
wolfSSL_sk_SSL_CIPHER_free(ssl->clSuitesStack);
83938393
ssl->clSuitesStack = NULL;
83948394
}
8395-
#endif
8396-
#ifdef OPENSSL_EXTRA
83978395
XFREE(ssl->clSuites, ssl->heap, DYNAMIC_TYPE_SUITES);
83988396
ssl->clSuites = NULL;
83998397
#endif
@@ -25348,10 +25346,12 @@ int SendAsyncData(WOLFSSL* ssl)
2534825346
* 2 in SCR and we have plain data ready
2534925347
* Early data logic may bypass this logic in TLSv1.3 when appropriate.
2535025348
*/
25351-
static int ssl_in_handshake(WOLFSSL *ssl, int send)
25349+
static int ssl_in_handshake(WOLFSSL *ssl, int sending_data)
2535225350
{
25351+
int SendAsyncData = 1;
25352+
(void)SendAsyncData;
2535325353
if (IsSCR(ssl)) {
25354-
if (send) {
25354+
if (sending_data) {
2535525355
/* allow sending data in SCR */
2535625356
return 0;
2535725357
} else {

src/ssl.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21264,10 +21264,7 @@ void wolfSSL_print_all_errors_fp(XFILE fp)
2126421264

2126521265
/* Note: This is a huge section of API's - through
2126621266
* wolfSSL_X509_OBJECT_get0_X509_CRL */
21267-
#if defined(OPENSSL_ALL) || (defined(OPENSSL_EXTRA) && \
21268-
(defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || \
21269-
defined(HAVE_LIGHTY) || defined(WOLFSSL_HAPROXY) || \
21270-
defined(WOLFSSL_OPENSSH) || defined(HAVE_SBLIM_SFCB)))
21267+
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)
2127121268

2127221269
#if defined(USE_WOLFSSL_MEMORY) && !defined(WOLFSSL_DEBUG_MEMORY) && \
2127321270
!defined(WOLFSSL_STATIC_MEMORY)
@@ -21435,6 +21432,7 @@ int wolfSSL_set_tlsext_host_name(WOLFSSL* ssl, const char* host_name)
2143521432
return ret;
2143621433
}
2143721434

21435+
#ifndef NO_WOLFSSL_SERVER
2143821436
/* May be called by server to get the requested accepted name and by the client
2143921437
* to get the requested name. */
2144021438
const char * wolfSSL_get_servername(WOLFSSL* ssl, byte type)
@@ -21446,6 +21444,8 @@ const char * wolfSSL_get_servername(WOLFSSL* ssl, byte type)
2144621444
!wolfSSL_is_server(ssl));
2144721445
return (const char *)serverName;
2144821446
}
21447+
#endif
21448+
2144921449
#endif /* HAVE_SNI */
2145021450

2145121451
WOLFSSL_CTX* wolfSSL_set_SSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx)
@@ -21676,9 +21676,7 @@ void wolfSSL_THREADID_set_numeric(void* id, unsigned long val)
2167621676
}
2167721677
#endif
2167821678

21679-
#endif /* OPENSSL_ALL || (OPENSSL_EXTRA && (HAVE_STUNNEL || WOLFSSL_NGINX ||
21680-
* HAVE_LIGHTY || WOLFSSL_HAPROXY || WOLFSSL_OPENSSH ||
21681-
* HAVE_SBLIM_SFCB)) */
21679+
#endif /* OPENSSL_ALL || OPENSSL_EXTRA */
2168221680

2168321681
#ifdef HAVE_SNI
2168421682

src/ssl_asn1.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,36 +1093,36 @@ static int wolfssl_asn1_integer_require_len(WOLFSSL_ASN1_INTEGER* a, int len,
10931093
*/
10941094
WOLFSSL_ASN1_INTEGER* wolfSSL_ASN1_INTEGER_dup(const WOLFSSL_ASN1_INTEGER* src)
10951095
{
1096-
WOLFSSL_ASN1_INTEGER* dup = NULL;
1096+
WOLFSSL_ASN1_INTEGER* dst = NULL;
10971097

10981098
WOLFSSL_ENTER("wolfSSL_ASN1_INTEGER_dup");
10991099

11001100
/* Check for object to duplicate. */
11011101
if (src != NULL) {
11021102
/* Create a new ASN.1 INTEGER object to be copied into. */
1103-
dup = wolfSSL_ASN1_INTEGER_new();
1103+
dst = wolfSSL_ASN1_INTEGER_new();
11041104
}
11051105
/* Check for object to copy into. */
1106-
if (dup != NULL) {
1106+
if (dst != NULL) {
11071107
/* Copy simple fields. */
1108-
dup->length = src->length;
1109-
dup->negative = src->negative;
1110-
dup->type = src->type;
1108+
dst->length = src->length;
1109+
dst->negative = src->negative;
1110+
dst->type = src->type;
11111111

11121112
if (!src->isDynamic) {
11131113
/* Copy over data from/to fixed buffer. */
1114-
XMEMCPY(dup->intData, src->intData, WOLFSSL_ASN1_INTEGER_MAX);
1114+
XMEMCPY(dst->intData, src->intData, WOLFSSL_ASN1_INTEGER_MAX);
11151115
}
1116-
else if (wolfssl_asn1_integer_require_len(dup, src->length, 0) == 0) {
1117-
wolfSSL_ASN1_INTEGER_free(dup);
1118-
dup = NULL;
1116+
else if (wolfssl_asn1_integer_require_len(dst, src->length, 0) == 0) {
1117+
wolfSSL_ASN1_INTEGER_free(dst);
1118+
dst = NULL;
11191119
}
11201120
else {
1121-
XMEMCPY(dup->data, src->data, (size_t)src->length);
1121+
XMEMCPY(dst->data, src->data, (size_t)src->length);
11221122
}
11231123
}
11241124

1125-
return dup;
1125+
return dst;
11261126
}
11271127
#endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */
11281128

src/ssl_sess.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4097,7 +4097,7 @@ void wolfSSL_FreeSession(WOLFSSL_CTX* ctx, WOLFSSL_SESSION* session)
40974097
ForceZero(session->sessionID, ID_LEN);
40984098

40994099
if (session->type == WOLFSSL_SESSION_TYPE_HEAP) {
4100-
XFREE(session, session->heap, DYNAMIC_TYPE_SESSION);
4100+
XFREE(session, session->heap, DYNAMIC_TYPE_SESSION); /* // NOLINT(clang-analyzer-unix.Malloc) */
41014101
}
41024102
}
41034103

tests/api.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66551,7 +66551,8 @@ static int test_wolfSSL_OCSP_parse_url(void)
6655166551

6655266552
#if defined(OPENSSL_ALL) && defined(HAVE_OCSP) && \
6655366553
defined(WOLFSSL_SIGNER_DER_CERT) && !defined(NO_FILESYSTEM) && \
66554-
!defined(NO_ASN_TIME)
66554+
!defined(NO_ASN_TIME) && \
66555+
!defined(WOLFSSL_SM2) && !defined(WOLFSSL_SM3)
6655566556
static time_t test_wolfSSL_OCSP_REQ_CTX_time_cb(time_t* t)
6655666557
{
6655766558
if (t != NULL) {
@@ -66566,7 +66567,8 @@ static int test_wolfSSL_OCSP_REQ_CTX(void)
6656666567
{
6656766568
EXPECT_DECLS;
6656866569
#if defined(OPENSSL_ALL) && defined(HAVE_OCSP) && \
66569-
defined(WOLFSSL_SIGNER_DER_CERT) && !defined(NO_FILESYSTEM)
66570+
defined(WOLFSSL_SIGNER_DER_CERT) && !defined(NO_FILESYSTEM) && \
66571+
!defined(WOLFSSL_SM2) && !defined(WOLFSSL_SM3)
6657066572
/* This buffer was taken from the ocsp-stapling.test test case 1. The ocsp
6657166573
* response was captured in wireshark. It contains both the http and binary
6657266574
* parts. The time test_wolfSSL_OCSP_REQ_CTX_time_cb is set exactly so that

wolfcrypt/src/sp_int.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8216,7 +8216,7 @@ int sp_addmod_ct(const sp_int* a, const sp_int* b, const sp_int* m, sp_int* r)
82168216
* @return MP_OKAY on success.
82178217
*/
82188218
static void _sp_submod_ct(const sp_int* a, const sp_int* b, const sp_int* m,
8219-
unsigned int max, sp_int* r)
8219+
unsigned int max_size, sp_int* r)
82208220
{
82218221
#ifndef SQR_MUL_ASM
82228222
sp_int_sword w;
@@ -8237,7 +8237,7 @@ static void _sp_submod_ct(const sp_int* a, const sp_int* b, const sp_int* m,
82378237
l = 0;
82388238
h = 0;
82398239
#endif
8240-
for (i = 0; i < max; i++) {
8240+
for (i = 0; i < max_size; i++) {
82418241
/* Values past 'used' are not initialized. */
82428242
mask_a += (i == a->used);
82438243
mask_b += (i == b->used);

0 commit comments

Comments
 (0)