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

All PKEY methods implementing signing or secure hashing should fail if the value for siglen is too small #12609

Open
reiniert opened this issue Aug 7, 2020 · 1 comment
Labels
triaged: bug The issue/pr is/fixes a bug

Comments

@reiniert
Copy link

reiniert commented Aug 7, 2020

The documentation for EVP_DigestSignFinal() mentions the following precondition:

If sig is not NULL then before the call the siglen parameter should contain the length of the sig buffer.

This implies that the siglen parameter actually has some significance and is being checked to be sufficiently large by the function(s) that fill(s) the sig buffer. The expectation is that the function fails if that check fails. Indeed, this mechanism can be observed here:

if (*siglen < (size_t)sig_sz) {

However, most PKEY sign(-like) methods do not seem to include such a check. For example see

*siglen = l;

@reiniert reiniert added the issue: bug report The issue was opened to report a bug label Aug 7, 2020
@reiniert reiniert changed the title All PKEY methods implementing signing or secure hashing should check the siglen parameter and fail if its value is too small All PKEY methods implementing signing or secure hashing should fail if the value for siglen is too small Aug 7, 2020
@mattcaswell mattcaswell added triaged: bug The issue/pr is/fixes a bug and removed issue: bug report The issue was opened to report a bug labels Aug 10, 2020
@nhorman
Copy link
Contributor

nhorman commented Jun 12, 2024

the hmac code is significantly altered in openssl-3.x, is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants