Skip to content

Check raw pubkey length in wc_ecc_import_x963 before copying to it for KCAPI case.#9988

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
kareem-wolfssl:zd21356
Mar 17, 2026
Merged

Check raw pubkey length in wc_ecc_import_x963 before copying to it for KCAPI case.#9988
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
kareem-wolfssl:zd21356

Conversation

@kareem-wolfssl
Copy link
Contributor

@kareem-wolfssl kareem-wolfssl commented Mar 16, 2026

Description

Fixes zd#21356
Thanks to Haruto Kimura (Stella) for the report.

Testing

Built in tests, provided reproducer

Checklist

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

@kareem-wolfssl kareem-wolfssl self-assigned this Mar 16, 2026
Copilot AI review requested due to automatic review settings March 16, 2026 22:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a bounds check to prevent overrunning key->pubkey_raw when importing an X9.63 public key under the WOLFSSL_KCAPI_ECC build configuration (fix for zd#21356).

Changes:

  • Guard XMEMCPY(key->pubkey_raw, ...) with a length check for the KCAPI ECC case.
  • Return an error when the provided public key blob is larger than the destination buffer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@JacobBarthelmeh
Copy link
Contributor

Retest this please Jenkins

@JacobBarthelmeh JacobBarthelmeh added For This Release Release version 5.9.0 and removed For This Release Release version 5.9.0 labels Mar 17, 2026
@JacobBarthelmeh JacobBarthelmeh merged commit 668d69b into wolfSSL:master Mar 17, 2026
485 of 488 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants