Repository navigation
Export a constant-time compare to applications - #1337
Open
ejohnstown wants to merge 5 commits into
Open
ejohnstown wants to merge 5 commits into
ejohnstown wants to merge 5 commits into
Conversation
Userauth callbacks compare passwords and digests outside the library, where the internal ConstantCompare() is hidden. Export a wrapper, and add WS_CONSTANTCOMPARE(), which, like WS_FORCEZERO(), maps to wolfCrypt's wc_ConstantCompare() when the wolfSSL build provides it (v5.9.4 and later) and to the local loop otherwise. - misc.c: build the local loop only as the fallback, with a volatile accumulator - internal.c: compare MACs and the CBC check block with the macro - ssh.h: point the userauth callback documentation at the export - api.c: test match, mismatch, length and argument handling Issue: F-7513, F-7514
auth.c called the library-internal ConstantCompare(), which does not resolve when the library is built with --disable-inline. Call wolfSSH_ConstantCompare() instead. Issue: F-7514
The echoserver and tpmcertserver userauth callbacks compare the stored digest or password with wolfSSH_ConstantCompare(). The echoserver callback now wipes its digest buffer on every return. Issue: F-8858, F-12630
wsUserAuth parses the peer certificate to print its FASC-N and UUID. Free the DecodedCert before leaving that block, on success and on failure alike. Issue: F-13997
The copy read one byte past the username; the terminator is written explicitly after it. Issue: F-13329
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1337
Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 6 of 9 in-scope changed file(s) opened by the reviewer; not opened: apps/wolfsshd/auth.c, src/internal.c, wolfssh/ssh.h
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wolfSSH_ConstantCompare() gives userauth callbacks the library's
constant-time compare. Like WS_FORCEZERO(), the internal
WS_CONSTANTCOMPARE() maps to wolfCrypt's wc_ConstantCompare() on
wolfSSL v5.9.4 and later and to a volatile local loop otherwise.
link failure.
echoserver wipes its digest buffer on every return.
reads past the username in PwMapNew.
Issue: F-7513, F-7514, F-8858, F-12630, F-13997, F-13329