Repository navigation
Add the chacha20-poly1305 cipher - #1396
ejohnstown wants to merge 4 commits into
Conversation
SendUserAuthRequest() writes the keyboard-interactive language tag and submethods without counting them in the payload size it reserves. The padding reserve hid the 8 bytes for 16-byte block ciphers; an 8-byte block cipher overruns the output buffer. - Add the two fields to payloadSz for ID_USERAUTH_KEYBOARD - Bound the AEAD tag write in BundlePacketPad() as the MAC write is
b6b6ef7 to
5de55ce
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1396
Scan targets checked: wolfssh-src, wolfssh-bugs
Not reviewed (no scan target covers them): scripts/openssh-interop.test
Coverage: 5 of 6 in-scope changed file(s) opened by the reviewer; not opened: tests/api.c
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Max
8bff6ec to
f4a248b
Compare
|
@claude review |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1396
Scan targets checked: wolfssh-src, wolfssh-bugs
Not reviewed (no scan target covers them): README.md, scripts/openssh-interop.test
Coverage: 1 of 3 in-scope changed file(s) opened by the reviewer; not opened: tests/unit.c, wolfssh/internal.h
No new issues found in the changed files.
💬 1 finding(s) from an earlier review are still open and were not re-posted:
- The new ChaCha20 receive path in DoReceive has no test for tampered packets —
src/internal.c:15780
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
f4a248b to
7754bbe
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1396
Scan targets checked: none
Unchanged since last review (not re-run): wolfssh-src, wolfssh-bugs
Not reviewed (no scan target covers them): README.md, scripts/openssh-interop.test
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
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
PrepareUserAuthRequestMlDsaCert() leaves out the certificate length that BuildRFC6187Info() writes, so the userauth request reserves four bytes fewer than it sends. The padding reserve hides the shortfall today, with little to spare under an 8-byte block cipher.
Implement chacha20-poly1305@openssh.com, also offered under the IETF name chacha20-poly1305, as OpenSSH's PROTOCOL.chacha20poly1305 defines it. It is first in the default cipher list. The packet length is encrypted with its own key, and the sequence number is the nonce. - Key a payload and a header ChaCha20, in a union with the Aes, from 64 bytes of KDF output; DoReceive() decrypts the length apart and checks the tag before decrypting the payload - WOLFSSH_NO_AEAD is set only when both AES-GCM and chacha20-poly1305 are disabled; a wolfSSL built with NO_AES is still refused - With strict KEX off on the CTX, the default list leaves chacha out; Terrapin tests needing an unauthenticated sequence number require GCM - Add a known-answer test, damaged-record and Terrapin tests, padding and keyboard request sizing tests, and an openssh-interop.test check
wolfSSH_SetHighwaterCb() takes a NULL callback, and HighwaterCheck() then set the flag and did nothing, so the session never rekeyed. A NULL callback now falls back to the default, which starts a key exchange. - Add a regress test that a NULL callback still rekeys
7754bbe to
26c057d
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1396
Scan targets checked: wolfssh-src, wolfssh-bugs
Not reviewed (no scan target covers them): README.md, scripts/openssh-interop.test
Coverage: 2 of 6 in-scope changed file(s) opened by the reviewer; not opened: tests/api.c, tests/unit.c, wolfssh/internal.h, 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
Add
chacha20-poly1305@openssh.com, also offered aschacha20-poly1305, perOpenSSH's PROTOCOL.chacha20poly1305. It goes first in the default cipher list.
request size; an 8-byte block cipher overran the output buffer without them
Poly1305 tag checked before the payload is decrypted
negotiate it