Repository navigation
feat(str0m): rind-str0m, a str0m CryptoProvider on rind - #467
Merged
Merged
Conversation
Quest-Claim: 42549bbf6252f50d
Restores the crate #138 removed, ported to the published str0m 0.25, with its version set to 0.25.0 and a `MissingFeature` from `default_provider()`. AES-CM counts over the full 128-bit block, as RFC 3711 and aws-lc-rs do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dimpl's constructors assert a nonempty certificate and expect a key they can load, and str0m's RtcConfig::set_dtls_cert takes both from the caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 7, 2026 18:53
|
Your OpenCode Go account is out of credit. Top it up, then re-trigger Pullfrog. OpenCode Go's response
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.

Problem
str0m (2.9M downloads) defaults to aws-lc-rs, and its only pure-Rust backend is the slower RustCrypto one. Its
CryptoProvideris now released (str0m 0.25, str0m-proto 0.8), so rind can fill it with no upstream change. The maintainer reversed the 2026-10-31 call to drop the adapter on 2026-11-04 (quest).Decisions
Settled by the maintainer on 2026-11-07, on the two findings the Codex review kept:
srtp_aes_{128,256}_ecb_roundpanics on wrong-length slices: ✅ accept, documented on the methods (rejected: hold until str0m changes the trait). str0m-proto's trait returns(), so there is no error to return; str0m's only caller passes fixed arrays (src/rtp/srtp.rs:803-832).DtlsCertificate(pub private_key: Vec<u8>, noDrop, dimpl 0.9.0src/lib.rs:282-298) and isn't wiped when str0m drops it: ✅ accept, documented in the README (rejected: returnNonefromgenerate_certificate; hold until dimpl wipes it). It's an upstream type the adapter must use as is, and rind's own wiping is becoming opt-in (moq-dev/rind#461).Checked against moq-dev/rind#461: the adapter wipes nothing itself, so there is no unconditional wipe to put under rind's
wipefeature. The keys it builds (SRTP, HMAC, the rcgen key pair) are rind types and follow rind's rule; the one always-on wipe it touches is rind-rcgen'sto_pkcs8Zeroizing, which #461 keeps on purpose.Approach
rind-str0m, which moq-dev/rind#138 deleted while str0m's interface was unreleased, and ports it to the published str0m 0.25 and today's rind API.rind-dimpl. The self-signed ECDSA P-256 certificate comes fromrind-rcgen, shaped like dimpl's own generator: random serial, one-year validity, and key identifiers set as rcgen'scryptofeature would.rind::cipher::AesCtr, AEAD-AES-128/256-GCM onrind::aead::Key, key derivation onrind::cipher::Aes. HMAC-SHA1 (SRTP auth, STUN), SHA-1, and SHA-256 come from rind.CryptoError, not a panic: SRTP buffers too short or shorter than the tag, and an empty DTLS certificate or a private key rind-dimpl cannot load (dimpl itself panics on both). The onlyexpects are on lengths str0m fixes by type or from its own key schedule;srtp_aes_*_ecb_roundhas no error path in the trait, so their doc comments state the panic (Decision 1).DtlsCertificate(Decision 2).build.ymlandsh/armv7.sh.admin/ctgrind's adapter suite already runs every workspace crate'stests/ctgrind.rs.Choices made without asking
str0m(default features off), notstr0m-proto.sh/adapter-versions.shthen checks the 0.25 match against the dependency named after the crate directly, and users seestr0m::crypto::*types. str0m is a dependency every user already has. The cost: if str0m ever ships a breaking release without bumping str0m-proto, rind-str0m still needs a release to follow.AesCtr::new(.., 128)), RFC 3711'sIV + i mod 2^128, matching aws-lc-rs for every IV. The deleted crate refused a carry out of rind's 32-bit counter instead; str0m's IVs never carry, so the difference is only for other callers.differential.rsnow checks the carry against aws-lc-rs, replacing the old refusal test.dangerously_set_rng_seedunderis_test(), unlike str0m-aws-lc-rs. str0m's full suite passes without it (below), so rind doesn't take on a seeded-RNG path.tests/rtc.rskeeps the live interop path (ICE, DTLS 1.2/1.3 in both roles, SRTP/SRTCP both ways against aws-lc-rs) in every CI run, so a nightly job building str0m's 79 test binaries wouldn't catch much more.Impact
rind-str0m0.25.0:default_provider() -> Result<str0m::crypto::CryptoProvider, MissingFeature>andMissingFeature. It re-exports no rind types.rindor any other crate's API.Validation
just check: pass (rs, msrv, cross, deny, versions, fixtures, patch, gh, shell, nix).just checkon2bd6ec82, the docs commit merged with main (00610aff): pass, every module.cargo test -p rind-str0m: 22 tests and the crate-doc example. RFC 3711 (AES-CM keystream, key derivation) and RFC 7714 (GCM for SRTP and SRTCP) vectors, differential against str0m-aws-lc-rs over every length up to 300 B plus random ones up to MTU, forgeries refused with no plaintext released, short buffers and unusable DTLS certificates as errors, and str0m sessions between a rind peer and an aws-lc-rs peer over DTLS 1.2 and 1.3 in both roles.str0m 0.25.0's own suite (crates.io source,
--features _internal_test_exports, arindarm added totests/common.rs's provider switch): 1312 passed, 0 failed, 3 ignored, in each of three runs: rind as the process default;L_CRYPTO=rind R_CRYPTO=aws-lc-rs; andL_CRYPTO=aws-lc-rs R_CRYPTO=rind.SRTP benchmark through the trait, rind vs str0m-aws-lc-rs on an i7-8700 (no SHA-NI) under load 8 to 15, so indicative only:
str0m-aws-lc-rs re-keys AES-CM and ECB on every call, which accounts for most of the CM and key-derivation gap. For HMAC-SHA1, rind-bench's own
hmac-sha1/*/1200Bon the same host shows rind 1.57 µs vs aws-lc-rs 1.56 µs, and BENCHMARKS.md has rind ahead on every runner.admin/ctgrind adaptersunder valgrind: pass, including rind-str0m's 4 tests (AES-CM, both GCMs, key derivation, STUN HMAC).Follow-ups
rind-str0m(dimpl + rind, pure Rust, x86_64/aarch64/armv7), PR title "README: list rind-str0m as a third-party crypto backend". Recommendation: plan it after rind-str0m 0.25.0 is on crates.io, the same way rustls lists rind-rustls is tracked.DtlsCertificate's private key on drop (post to algesten/dimpl, for the maintainer). Recommendation: plan it, per Decision 2; it also covers rind-dimpl's users.tests/rtc.rscovers the live path in every CI run.Review
Rewritten by
quest reviewafter each round.01a1b504-abb6-7f92-8460-d1b2ab8d38ca, round 3No remaining findings after applying the recorded maintainer decisions; source inspection and diff checks found no additional issues, and runtime tests were not rerun.rind-str0m/src/srtp.rs:42:Remove caller-reachable panics from the ECB boundary;The saved PR body at .tmp/body.md, Decisions item 1, records maintainer acceptance of wrong-length ECB panics, now documented in rind-str0m/src/srtp.rs:30-44.rind-str0m/src/dtls.rs:95:Ensure exported DTLS private keys are wiped on drop;The saved PR body at .tmp/body.md, Decisions item 2, records maintainer acceptance of upstream-owned unwiped DTLS keys, now documented in rind-str0m/README.md:28.The head
2bd6ec82adds only a conflict-free merge of main (00610aff) to the reviewed head5f9eb293, so round 3 covers it.Models
Size: M
Implementer: Claude Code, claude-opus-5-5, high effort
(Written by Claude Opus 5.5 with high)