Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check r and s len before copying #8350

Merged
merged 4 commits into from
Jan 21, 2025
Merged

Check r and s len before copying #8350

merged 4 commits into from
Jan 21, 2025

Conversation

embhorn
Copy link
Member

@embhorn embhorn commented Jan 10, 2025

Description

DecodeECC_DSA_Sig_Bin() does not take into account the rLen and sLen values provided as input. These parameters are intended to represent the sizes of the buffers for r and s, as outlined in the documentation for wc_ecc_sig_to_rs().

Fix checks len values and returns ASN_PARSE_E if too small to hold sig component.

Fixes zd19220

Testing

./configure --enable-asn=original

  • confirmed same behavior with ASN_TEMPLATE

Checklist

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

@embhorn embhorn self-assigned this Jan 10, 2025
@embhorn
Copy link
Member Author

embhorn commented Jan 10, 2025

retest this please

@embhorn embhorn requested a review from SparkiDev January 10, 2025 23:52
@embhorn embhorn assigned wolfSSL-Bot and unassigned embhorn Jan 10, 2025
wolfcrypt/src/asn.c Show resolved Hide resolved
@embhorn embhorn requested a review from SparkiDev January 20, 2025 14:41
@embhorn embhorn assigned embhorn and SparkiDev and unassigned wolfSSL-Bot and embhorn Jan 20, 2025
@dgarske dgarske merged commit 5df6989 into wolfSSL:master Jan 21, 2025
152 checks passed
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.

4 participants