Skip to content

Fixes for SM2/3 and FindMultiAttrib#10641

Open
rlm2002 wants to merge 4 commits into
wolfSSL:masterfrom
rlm2002:zd21890
Open

Fixes for SM2/3 and FindMultiAttrib#10641
rlm2002 wants to merge 4 commits into
wolfSSL:masterfrom
rlm2002:zd21890

Conversation

@rlm2002

@rlm2002 rlm2002 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

Prevent potential heap-buffer-overflow (out of bounds read) when SM2/SM3 is enabled. Reject a certificate with an SM3wSM2 signatureAlgorithm and a public key shorter than 65 bytes, (cert->publicKey + cert->pubKeySize - 65 underflows and CalcHashId_ex reads up to 64 bytes before the key buffer) in ParseCertRelative().

Adds regression test for this issue.

Fixes zd#21890

Adds negative value check to SetAuthKeyIdFromDcert().
Adds defensive i >= 0 check to FindMultiAttrib() to for statement to clear Coverity false positives.

Fixes zd#21938

@rlm2002 rlm2002 self-assigned this Jun 8, 2026
@rlm2002 rlm2002 changed the title Add pubKeySize check for SM3-with-SM2 Fixes for SM2/3 builds Jun 9, 2026

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10641

Scan targets checked: wolfcrypt-bugs, wolfcrypt-src

No new issues found in the changed files. ✅

@rlm2002 rlm2002 marked this pull request as ready for review June 9, 2026 20:43
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

retest this please

@rlm2002 rlm2002 changed the title Fixes for SM2/3 builds Checks for SM2/3 and FindMultiAttrib Jun 9, 2026
@rlm2002 rlm2002 changed the title Checks for SM2/3 and FindMultiAttrib Fixes for SM2/3 and FindMultiAttrib Jun 9, 2026
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m0plus

  • FLASH: .text +20 B (+0.0%, 63,495 B / 262,144 B, total: 24% used)

gcc-arm-cortex-m3

  • FLASH: .text +16 B (+0.0%, 121,277 B / 262,144 B, total: 46% used)

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text +64 B (+0.0%, 766,316 B / 1,048,576 B, total: 73% used)

gcc-arm-cortex-m4-rsa-only

@rlm2002 rlm2002 assigned wolfSSL-Bot and unassigned rlm2002 Jun 10, 2026
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