You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No actionable comments were generated in the recent review.
Walkthrough
The change adds native NIST ECDH, ML-KEM-1024, and SNTRUP761 operations, exposes them through the Flutter Rust Bridge and SSH crypto APIs, and adds ECDSA P-384/P-521 key generation. It also adds SSH key-exchange and ECDSA integration tests.
Changes: SSH Cryptography
Layer / File(s)
Summary
Rust ECDH and KEM operations crates/sbm_ffi/Cargo.toml, crates/sbm_ffi/src/api/ssh_asym.rs
Rust adds ECDH for P-256, P-384, and P-521, ML-KEM-1024, and SNTRUP761 operations. Shared ML-KEM helpers serve ML-KEM-768 and ML-KEM-1024. Tests cover round trips and invalid inputs.
The Dart SSH crypto layer adds native methods for ECDH, ML-KEM-1024, and SNTRUP761. Key generation and its UI add ECDSA P-384/P-521 options and labels.
Tests cover configured KEX algorithms, NIST ECDH, hybrid key exchanges, and ECDSA P-384/P-521 keys. The dartssh2 submodule pointer changes.
Sequence Diagram(s)
sequenceDiagram
participant NativeSshCrypto
participant RustLibApi
participant ssh_asym
NativeSshCrypto->>RustLibApi: Request ECDH keypair or shared secret
RustLibApi->>ssh_asym: Call the ECDH operation
ssh_asym-->>RustLibApi: Return keypair or shared secret
RustLibApi-->>NativeSshCrypto: Return decoded result or error
Loading
Merge Risk: Minimal · up to 3086e · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
TruffleHog (3.99.8)
lib/src/rust/frb_generated.dart
TruffleHog scan timed out
lib/src/rust/frb_generated.io.dart
TruffleHog scan timed out
lib/src/rust/frb_generated.web.dart
TruffleHog scan timed out
4 others
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Essentials
Run ID: ee33a1b3-e56d-433a-b38b-a956e46881d3
Commits
Reviewing files that changed from the base of the PR and between 03e3f33 and 3086e1a.
Files ignored due to path filters: 1
Cargo.lock is excluded by !**/*.lock
Files selected for processing: 15
crates/sbm_ffi/Cargo.toml
crates/sbm_ffi/src/api/ssh_asym.rs
crates/sbm_ffi/src/frb_generated.rs
lib/core/ssh/algorithms.dart
lib/core/ssh/keygen.dart
lib/core/ssh/native_crypto.dart
lib/src/rust/api/ssh_asym.dart
lib/src/rust/frb_generated.dart
lib/src/rust/frb_generated.io.dart
lib/src/rust/frb_generated.web.dart
lib/view/page/private_key/generate.dart
packages/dartssh2
test/e2e/ssh_pqc_openssh106_e2e_test.dart
test/unit/ssh/ssh_native_crypto_test.dart
test/widget/ssh_keygen_page_test.dart
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
Source excerpt: `api/ssh_crypto.rs` is the **record layer** — AES-CTR, AES-CBC, HMAC, and AES-GCM through dartssh2's `createAead` (keyed once per direction, one `seal`/`open` per packet) — run on every packet.
Source excerpt: **In `lib/`, a page is `AppRoute.go`, `AppPageRoute` or `AppPage` (fl_lib), never a bare `MaterialPageRoute` / `MaterialPage`**: a predictive back (Android, and the iOS/macOS edge swipe) pops every route current in its own n...
CodeRabbit inference engine (CLAUDE.md)
Files:
lib/core/ssh/algorithms.dart
lib/core/ssh/keygen.dart
lib/core/ssh/native_crypto.dart
lib/src/rust/api/ssh_asym.dart
lib/src/rust/frb_generated.dart
lib/src/rust/frb_generated.io.dart
lib/src/rust/frb_generated.web.dart
lib/view/page/private_key/generate.dart
Learnings: 2
Learning: 2026-10-19T12:04:33.194Z
Learnt from: CR
Repo: lollipopkit/flutter_server_box PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-10-19T12:04:33.194Z
Learning: Source excerpt:
# CLAUDE.md
## Architecture
### Connection methods
- SSH is direct, jump server or `ProxyCommand` (`genClient`); host keys are always verified.
Applied to files:
lib/core/ssh/algorithms.dart
test/e2e/ssh_pqc_openssh106_e2e_test.dart
Learning: 2026-11-15T05:29:17.858Z
Learnt from: CR
Repo: lollipopkit/flutter_server_box PR: 0
File: .claude/skills/serverbox-onboarding/SKILL.md:0-0
Timestamp: 2026-11-15T05:29:17.858Z
Learning: Applies to {**/*.g.dart,**/*.freezed.dart,lib/src/rust/**} : Source excerpt:
# ServerBox onboarding
## What costs people an afternoon
- **Regenerate after changing an annotated model** (`freezed`,
`json_serializable`, `riverpod`, hive): `make gen`. Never hand-edit
`*.g.dart`, `*.freezed.dart` or anything under `lib/src/rust/`.
Applied to files:
lib/src/rust/api/ssh_asym.dart
lib/src/rust/frb_generated.dart
lib/src/rust/frb_generated.io.dart
lib/src/rust/frb_generated.web.dart
Additional comments: 2
packages/dartssh2: 2
1-1: Stability & Availability
The claimed failure does not occur at this pinned revision. _supportedKexAlgorithms removes SNTRUP key exchanges when the installed backend does not support them, and _sendKexInit advertises only that filtered list. The server therefore cannot select an SNTRUP name that the client did not offer, so the connection does not fail for this reason. The review finding is based on a premise that the inspected code contradicts.
1-1: Functional Correctness
The pinned submodule registers all three requested KEX names.
At 40a925fc74322ff8806b5706fbf149e2455b0775, ssh_kex_type.dart defines sntrup761x25519-sha512, sntrup761x25519-sha512@openssh.com, and diffie-hellman-group18-sha512. The sntrup names have an implementation in kex_sntrup761_x25519.dart, and the group18 path is exercised by a test in the pinned tree. A server that offers one of these names is not rejected because the name is missing from the pin.
The sntrup names depend on an installed SSHCryptoBackend that reports supportsSntrup761. This is the documented gating behavior, and this submodule update does not change it. Checking whether the application installs such a backend belongs to the parent repository's wiring, not this pin.
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
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.
Depends on lollipopkit/dartssh2#37.
Summary by CodeRabbit