Skip to content

Conversation

@rlm2002
Copy link
Contributor

@rlm2002 rlm2002 commented Jan 12, 2026

Description

Update WC_CALLOC_VAR_EX, now calls XMEMSET properly. Uses sizeof(VAR_TYPE)
(CID 556176-556182: Uninitialized scalar variable)

Add length checks for TLS extensions supported_versions and KeyShare based on RFC 8446 and 9147
(CID 487950/487948: Untrusted loop bound)

Add cleanup for table and iTable variables in sakke_kat_derive_test() once set by XMALLOC().
CID 420937: Resource leak

Testing

./configure --enable-all && make check
./configure --enable-all --enable-sakke && make check

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@rlm2002 rlm2002 changed the title Coverity 20260112 Coverity: update macros and add length checks Jan 12, 2026
@rlm2002 rlm2002 self-assigned this Jan 13, 2026
@rlm2002
Copy link
Contributor Author

rlm2002 commented Jan 13, 2026

retest this please jenkins: PRB-generic-config-parser: was not stable -> Found unhandled org.jenkinsci.plugins.workflow.support.steps.AgentOfflineException exception:

@rlm2002 rlm2002 marked this pull request as ready for review January 13, 2026 16:30
@rlm2002 rlm2002 assigned wolfSSL-Bot and unassigned rlm2002 Jan 13, 2026
switch WC_ALLOC_VAR_EX with XMEMSET to WC_CALLOC_VAR_EX

fix XMEMSET call for WC_CALLOC_VAR_EX
@rlm2002 rlm2002 force-pushed the coverity branch 2 times, most recently from f212690 to 8b275a6 Compare January 14, 2026 19:49
@rlm2002
Copy link
Contributor Author

rlm2002 commented Jan 14, 2026

retest this please Jenkins. PRB-generic-config-parser was unstable: Found unhandled org.jenkinsci.plugins.workflow.support.steps.AgentOfflineException exception

iTable = (byte*)XMALLOC(iTableLen, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
if (iTable == NULL)
return WC_TEST_RET_ENC_ERRNO;
if (iTable == NULL){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting, space after bracket, before brace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

MAX_REQUEST_SZ = 256, /* Maximum cert req len (no auth yet */
SESSION_FLUSH_COUNT = 256, /* Flush session cache unless user turns off */
TLS_MAX_PAD_SZ = 255, /* Max padding in TLS */
MAX_EXT_LEN = 63535, /* Max extension data length */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did this value come from?
An explanation in the comment would be good!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added RFC and section (RFC 8446, Sec. 4.2) to comment.

@rlm2002 rlm2002 force-pushed the coverity branch 2 times, most recently from 15b50a4 to b89ec81 Compare January 14, 2026 23:41
MAX_REQUEST_SZ = 256, /* Maximum cert req len (no auth yet */
SESSION_FLUSH_COUNT = 256, /* Flush session cache unless user turns off */
TLS_MAX_PAD_SZ = 255, /* Max padding in TLS */
MAX_EXT_DATA_LEN = 63535,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2^16 - 1 = 65535
The maximum value of length is 65535 as it is type word16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants