Skip to content

Commit

Permalink
wolfcrypt/src/sp_int.c. src/ssl_asn1.c. src/internal.c: rename severa…
Browse files Browse the repository at this point in the history
…l declarations to avoid shadowing global functions, for the convenience of obsolete (pre-4v8) gcc -Wshadow.
  • Loading branch information
douzzer committed Feb 28, 2025
1 parent f7b911f commit 50a3be6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -25346,12 +25346,12 @@ int SendAsyncData(WOLFSSL* ssl)
* 2 in SCR and we have plain data ready
* Early data logic may bypass this logic in TLSv1.3 when appropriate.
*/
static int ssl_in_handshake(WOLFSSL *ssl, int send)
static int ssl_in_handshake(WOLFSSL *ssl, int sending_data)
{
int SendAsyncData = 1;
(void)SendAsyncData;
if (IsSCR(ssl)) {
if (send) {
if (sending_data) {
/* allow sending data in SCR */
return 0;
} else {
Expand Down
26 changes: 13 additions & 13 deletions src/ssl_asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,36 +1093,36 @@ static int wolfssl_asn1_integer_require_len(WOLFSSL_ASN1_INTEGER* a, int len,
*/
WOLFSSL_ASN1_INTEGER* wolfSSL_ASN1_INTEGER_dup(const WOLFSSL_ASN1_INTEGER* src)
{
WOLFSSL_ASN1_INTEGER* dup = NULL;
WOLFSSL_ASN1_INTEGER* dst = NULL;

WOLFSSL_ENTER("wolfSSL_ASN1_INTEGER_dup");

/* Check for object to duplicate. */
/* Check for object to dstlicate. */
if (src != NULL) {
/* Create a new ASN.1 INTEGER object to be copied into. */
dup = wolfSSL_ASN1_INTEGER_new();
dst = wolfSSL_ASN1_INTEGER_new();
}
/* Check for object to copy into. */
if (dup != NULL) {
if (dst != NULL) {
/* Copy simple fields. */
dup->length = src->length;
dup->negative = src->negative;
dup->type = src->type;
dst->length = src->length;
dst->negative = src->negative;
dst->type = src->type;

if (!src->isDynamic) {
/* Copy over data from/to fixed buffer. */
XMEMCPY(dup->intData, src->intData, WOLFSSL_ASN1_INTEGER_MAX);
XMEMCPY(dst->intData, src->intData, WOLFSSL_ASN1_INTEGER_MAX);
}
else if (wolfssl_asn1_integer_require_len(dup, src->length, 0) == 0) {
wolfSSL_ASN1_INTEGER_free(dup);
dup = NULL;
else if (wolfssl_asn1_integer_require_len(dst, src->length, 0) == 0) {
wolfSSL_ASN1_INTEGER_free(dst);
dst = NULL;
}
else {
XMEMCPY(dup->data, src->data, (size_t)src->length);
XMEMCPY(dst->data, src->data, (size_t)src->length);
}
}

return dup;
return dst;
}
#endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */

Expand Down
4 changes: 2 additions & 2 deletions wolfcrypt/src/sp_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -8216,7 +8216,7 @@ int sp_addmod_ct(const sp_int* a, const sp_int* b, const sp_int* m, sp_int* r)
* @return MP_OKAY on success.
*/
static void _sp_submod_ct(const sp_int* a, const sp_int* b, const sp_int* m,
unsigned int max, sp_int* r)
unsigned int max_size, sp_int* r)
{
#ifndef SQR_MUL_ASM
sp_int_sword w;
Expand All @@ -8237,7 +8237,7 @@ static void _sp_submod_ct(const sp_int* a, const sp_int* b, const sp_int* m,
l = 0;
h = 0;
#endif
for (i = 0; i < max; i++) {
for (i = 0; i < max_size; i++) {
/* Values past 'used' are not initialized. */
mask_a += (i == a->used);
mask_b += (i == b->used);
Expand Down

0 comments on commit 50a3be6

Please sign in to comment.