Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions doc/dox_comments/header_files/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ int wolfSSL_is_static_memory(WOLFSSL* ssl, WOLFSSL_MEM_CONN_STATS* mem_stats);
buffers to themselves for their lifetime.
WOLFMEM_TRACK_STATS - each SSL keeps track of memory stats while running

\return none This function does not return a value.
\return Returns 0 on success.
\return Returns a non-zero integer on failure.

\param pHint WOLFSSL_HEAP_HINT structure to use
\param buf memory to use for all operations.
Expand All @@ -396,7 +397,7 @@ int wolfSSL_is_static_memory(WOLFSSL* ssl, WOLFSSL_MEM_CONN_STATS* mem_stats);
// load in memory for use

ret = wc_LoadStaticMemory(&hint, memory, memorySz, flag, 0);
if (ret != SSL_SUCCESS) {
if (ret) {
// handle error case
}
...
Expand All @@ -419,7 +420,8 @@ int wc_LoadStaticMemory(WOLFSSL_HEAP_HINT** pHint, unsigned char* buf,
into functions. This extended version allows for custom bucket sizes and distributions
instead of using the default predefined sizes.

\return none This function does not return a value.
\return Returns 0 on success.
\return Returns a non-zero integer on failure.

\param pHint WOLFSSL_HEAP_HINT handle to initialize
\param listSz number of entries in the size and distribution lists
Expand Down Expand Up @@ -447,7 +449,7 @@ int wc_LoadStaticMemory(WOLFSSL_HEAP_HINT** pHint, unsigned char* buf,

ret = wc_LoadStaticMemory_ex(&hint, listSz, sizeList, distList,
memory, memorySz, flag, 0);
if (ret != SSL_SUCCESS) {
if (ret) {
// handle error case
}
...
Expand Down
2 changes: 1 addition & 1 deletion src/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -9894,7 +9894,7 @@ static int TLSX_KeyShareEntry_Parse(const WOLFSSL* ssl, const byte* input,
ato16(&input[offset], &keLen);
offset += OPAQUE16_LEN;
if (keLen == 0)
return INVALID_PARAMETER;
return BUFFER_ERROR;
if (keLen > length - offset)
return BUFFER_ERROR;

Expand Down
4 changes: 2 additions & 2 deletions src/tls13.c
Original file line number Diff line number Diff line change
Expand Up @@ -5497,8 +5497,8 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
suite[1] = ssl->options.cipherSuite;
if (!FindSuiteSSL(ssl, suite)) {
WOLFSSL_MSG("Cipher suite not supported on client");
WOLFSSL_ERROR_VERBOSE(MATCH_SUITE_ERROR);
return MATCH_SUITE_ERROR;
WOLFSSL_ERROR_VERBOSE(INVALID_PARAMETER);
return INVALID_PARAMETER;
}

#if defined(HAVE_ECH)
Expand Down
8 changes: 4 additions & 4 deletions wolfcrypt/src/ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13214,7 +13214,7 @@ int ecc_mul2add(ecc_point* A, mp_int* kA,
err = add_entry(idx1, A);
}
}
if (err == MP_OKAY && idx1 != -1) {
if (err == MP_OKAY && idx1 != -1 && fp_cache[idx1].lru_count < (INT_MAX-1)) {
/* increment LRU */
++(fp_cache[idx1].lru_count);
}
Expand All @@ -13231,7 +13231,7 @@ int ecc_mul2add(ecc_point* A, mp_int* kA,
}
}

if (err == MP_OKAY && idx2 != -1) {
if (err == MP_OKAY && idx2 != -1 && fp_cache[idx2].lru_count < (INT_MAX-1)) {
/* increment LRU */
++(fp_cache[idx2].lru_count);
}
Expand Down Expand Up @@ -13368,7 +13368,7 @@ int wc_ecc_mulmod_ex(const mp_int* k, ecc_point *G, ecc_point *R, mp_int* a,
if (idx >= 0)
err = add_entry(idx, G);
}
if (err == MP_OKAY && idx >= 0) {
if (err == MP_OKAY && idx >= 0 && fp_cache[idx].lru_count < (INT_MAX-1)) {
/* increment LRU */
++(fp_cache[idx].lru_count);
}
Expand Down Expand Up @@ -13539,7 +13539,7 @@ int wc_ecc_mulmod_ex2(const mp_int* k, ecc_point *G, ecc_point *R, mp_int* a,
if (idx >= 0)
err = add_entry(idx, G);
}
if (err == MP_OKAY && idx >= 0) {
if (err == MP_OKAY && idx >= 0 && fp_cache[idx].lru_count < (INT_MAX-1)) {
/* increment LRU */
++(fp_cache[idx].lru_count);
}
Expand Down
6 changes: 4 additions & 2 deletions wolfssl/wolfcrypt/asn.h
Original file line number Diff line number Diff line change
Expand Up @@ -2226,6 +2226,8 @@ typedef enum MimeStatus
#define GetShortInt wc_GetShortInt
#define SetShortInt wc_SetShortInt
#define GetLength wc_GetLength
#define SetLength wc_SetLength
#define SetSequence wc_SetSequence
#define GetASNInt wc_GetASNInt
#define GetASNTag wc_GetASNTag
#define SetAlgoID wc_SetAlgoID
Expand Down Expand Up @@ -2485,11 +2487,11 @@ WOLFSSL_LOCAL word32 SetASNImplicit(byte tag,byte number, word32 len,
WOLFSSL_LOCAL word32 SetASNExplicit(byte number, word32 len, byte* output);
WOLFSSL_LOCAL word32 SetASNSet(word32 len, byte* output);

WOLFSSL_LOCAL word32 SetLength(word32 length, byte* output);
WOLFSSL_ASN_API word32 SetLength(word32 length, byte* output);
WOLFSSL_LOCAL word32 SetLengthEx(word32 length, byte* output, byte isIndef);
WOLFSSL_LOCAL word32 SetHeader(byte tag, word32 len, byte* output,
byte isIndef);
WOLFSSL_LOCAL word32 SetSequence(word32 len, byte* output);
WOLFSSL_ASN_API word32 SetSequence(word32 len, byte* output);
WOLFSSL_LOCAL word32 SetSequenceEx(word32 len, byte* output, byte isIndef);
WOLFSSL_LOCAL word32 SetIndefEnd(byte* output);
WOLFSSL_LOCAL word32 SetOctetString(word32 len, byte* output);
Expand Down