Merge upstream v2.18.0#12
Conversation
(cherry picked from commit 67cbe8a)
This reverts commit 7a28b85.
…erprints and add tests
… and port forwarding
…rypick Preserve author of PR TerminalStudio#162: cherry-pick and revert
… packet SNs in SSHTransport
…-nonce-reset fix(gcm): reset AEAD packet/nonce counters during key exchanges
Resolved conflicts while merging TerminalStudio/dartssh2 master into lollipopkit/dartssh2 master. Key upstream changes: - Fixed AES-GCM cipher encryption/decryption sequence number/nonce counter resetting during key exchanges (TerminalStudio#165). - BREAKING: SSHHostkeyVerifyHandler now receives OpenSSH-style SHA256:<base64> fingerprints instead of raw MD5 digests (TerminalStudio#162). - Added regression tests for SHA256 host key fingerprint formatting. Preserved local changes: - ChaCha20-Poly1305 packet encryption/decryption support. - Encrypt-then-MAC (ETM) algorithm support. - Server-initiated and byte-limit rekeying with SSH_MSG_IGNORE CBC padding messages. - Host-based authentication challenge helper. - Constant-time MAC comparison. - Local onVerifyHostKey handler compatibility and extended handshake error assertions.
📝 WalkthroughWalkthrough将 ChangesSSHHostkeyVerifyHandler SHA256 指纹格式 BREAKING 变更
Possibly related issues
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/src/ssh_transport.dart (1)
29-33:⚠️ Potential issue | 🟡 Minor | ⚡ Quick win请同步更新主机密钥指纹注释,避免回调契约误导。
当前注释仍描述为 MD5 指纹/调试日志语义,但实现已经改为将
SHA256:<base64无填充>的 UTF-8 字节传给onVerifyHostKey。建议在此处明确新格式,避免调用方按旧协议处理。✏️ 建议修改
/// Function called when host key is received. /// [type] is the type of the host key, for example 'ssh-rsa'. -/// [fingerprint] is the MD5 fingerprint of the host key. The SHA256 -/// fingerprint is also logged via [printDebug] for user visibility. +/// [fingerprint] is an OpenSSH-style fingerprint in +/// `SHA256:<base64-without-padding>` format, encoded as UTF-8 bytes. Uint8List _hostkeyFingerprint(Uint8List hostkey) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/src/ssh_transport.dart` around lines 29 - 33, Update the documentation comment for the _hostkeyFingerprint function to accurately reflect the current implementation. The comment currently describes MD5 fingerprint and SHA256 debug logging semantics, but the actual implementation returns SHA256 fingerprint in the format SHA256:<base64-without-padding> as UTF-8 bytes that are passed to the onVerifyHostKey callback. Replace the outdated comment with an accurate description of the new format to prevent callers from misunderstanding the callback contract.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Line 38: In the CHANGELOG.md file at line 38, the phrase "server initiated
re-keying" is missing hyphens and should be formatted as "server-initiated
re-keying" to match standard technical writing conventions. Add hyphens to both
"server" and "initiated" to create the compound adjective "server-initiated".
In `@pubspec.yaml`:
- Line 2: The version in pubspec.yaml is currently set to 2.18.0 (a minor
version bump), but the CHANGELOG.md documents a BREAKING CHANGE to the
SSHHostkeyVerifyHandler fingerprint format. According to semantic versioning,
breaking changes require a major version increment. Change the version field in
pubspec.yaml from 2.18.0 to 3.0.0 to properly reflect the breaking change,
ensuring downstream users understand they may encounter incompatible behavior
when upgrading.
---
Outside diff comments:
In `@lib/src/ssh_transport.dart`:
- Around line 29-33: Update the documentation comment for the
_hostkeyFingerprint function to accurately reflect the current implementation.
The comment currently describes MD5 fingerprint and SHA256 debug logging
semantics, but the actual implementation returns SHA256 fingerprint in the
format SHA256:<base64-without-padding> as UTF-8 bytes that are passed to the
onVerifyHostKey callback. Replace the outdated comment with an accurate
description of the new format to prevent callers from misunderstanding the
callback contract.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c4479e3c-c713-41cd-8d5f-dbe63b6415d5
📒 Files selected for processing (5)
CHANGELOG.mdlib/src/ssh_transport.dartpubspec.yamltest/src/ssh_client_test.darttest/src/ssh_transport_fingerprint_test.dart
📜 Review details
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md
[grammar] ~38-~38: Use a hyphen to join words.
Context: ...exander-irion]. - Add support for server initiated re-keying [#125]. Thanks [@Mar...
(QB_NEW_EN_HYPHEN)
- Hyphenate 'server-initiated' in CHANGELOG. - Bump version to 3.0.0 to reflect the breaking fingerprint format change. - Update _hostkeyFingerprint doc comment to describe the SHA256:<base64> format actually passed to onVerifyHostKey. This commit is an addendum to the upstream v2.18.0 merge.
The upstream v2.18.0 merge changed the default host key verification behavior so that a null onVerifyHostKey rejects the host key. These tests intend to exercise authentication failure modes, not host key rejection, so provide acceptTestHostKey to reach the auth phase. Pubspec remains at 2.18.0 as this is an upstream merge, not a fork release.
lollipopkit/flutter_server_box/issues/1193
Summary by CodeRabbit
版本 2.18.0 发布
修复
破坏性变更
SHA256:<base64>。文档
发布信息