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
curl_sha512_256: add workaround for NetBSD bug #13133
Conversation
@mkauf, please check this PR. |
6ecef83
to
97282d6
Compare
PR has been updated with fixed code formatting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The code compiles on NetBSD 9.3 and test 1615 works.
If the NetBSD team fixes the bug, how long should curl keep the workaround?
If/When NetBSD fixed the bug, we can identify NetBSD version by |
@Karlson2k : Can you please change the commit message so that it does not mention me? e.g. just remove the "@". Last time this happened I got a lot of notification mails from GitHub... many projects copy commits and when they push, mentioned users get notifications. |
Based on Michael Kaufmann analysis and suggestion
97282d6
to
f1e1719
Compare
Done. |
I'm not sure we need to work around this issue. It's a security issue in NetBSD and (presumably), it will be fixed fairly quickly. Even if we keep it, I wouldn't keep it around past the next curl release. |
Failed tests 661 and 1541 with VS2010 seem to be unrelated. |
https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58039 This bug was fixed in NetBSD, but so far hasn't been pushed as update, so existing NetBSD installations still have this bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this works around a crash in existing netbsd I think it is worth merging.
FYI, we fixed this in the NetBSD 10.0 release that went out today, but it still affects all NetBSD 9.x versions. You may want to explicit_memset to zero the part of tmp_digest that you don't use -- some of the noteworthy security properties of SHA-512/256 rely on keeping the other half of the output secret. |
Based on @mkauf analysis and suggestion.
The details are here and here.
The macro
EVP_MAX_MD_SIZE
is not available (on my machine), so I usedSHA512_256_DIGEST_SIZE * 2
as a size of the temporal array which should be enough.