deps: unify control-channel crypto on one RustCrypto generation (LAN-582) - #151
Merged
Conversation
control_crypto.rs pinned chacha20poly1305 0.10 / hkdf 0.12 and, with them, a second copy of the crypto-common 0.1 stack (renamed sha2_010 / hmac_012) alongside the sha2 0.11 / hmac 0.13 that PSK auth already used. The two generations don't interoperate at the type level, so the pair could not be bumped in isolation and blocked the dependency train. Take chacha20poly1305 0.11 and hkdf 0.13, drop the renamed duplicates, and qualify the one HMAC constructor whose trait moved (new_from_slice lives on KeyInit in hmac 0.13; chacha20poly1305::KeyInit is also in scope here). The wire format is unchanged. wire_bytes_match_v0_9_22_vectors pins the derived keys, both sealed frames of a codec, the reverse-direction frame, and the server proof to vectors captured from the previous release, so a future bump that alters any peer-visible byte fails loudly instead of silently breaking interop. Confirmed live as well: PSK-protected tests run clean in both directions between a pre-port and a post-port binary, with a wrong-PSK negative control still rejected.
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.
Takes the
chacha20poly13050.10 → 0.11 andhkdf0.12 → 0.13 bumps that were split out of the last dependency refresh, and removes the reason they were stuck.Why it was blocked
src/control_crypto.rssat on thecrypto-common0.1 generation (chacha20poly13050.10,hkdf0.12) and carried its own renamed copies ofsha20.10 andhmac0.12 to match — whilesrc/auth.rshad already moved tosha20.11 /hmac0.13 on thedigest0.11 generation. Bumping just the AEAD pair drags indigest0.11 types that can't meet the 0.1-generation bounds, which is why #144 (and now #149) fails every job.What changed
chacha20poly13050.11,hkdf0.13; the renamedsha2_010/hmac_012dependencies are deleted, so control crypto now sharessha20.11 /hmac0.13 with PSK auth.new_from_slicemoved fromMactoKeyInitinhmac0.13, andchacha20poly1305::KeyInitis also in scope in that module, so the call is fully qualified.crypto-common/digest/block-buffer(cargo tree -i digest@0.10.7now reports nothing).Interop
The wire format is unchanged, and this is worth being sure about rather than assuming — the protected control channel has to keep talking to older peers.
wire_bytes_match_v0_9_22_vectorspins the three derived keys, two sealed frames from one codec (seq 0 and seq 1, so nonce and AAD derivation are covered too), the same plaintext sealed in the other direction, and the server proof. The values were captured by running the same inputs through the pre-port crate versions; they pass unchanged on the new ones. The existing tests all seal and open with the same code, so they'd have passed on a silently-changed KDF — this one wouldn't.seal/openacross the version boundary.Also validated:
cargo fmt --check,clippy -D warningsand the full test suite in both--all-featuresand--no-default-features.Supersedes #149.
Closes LAN-582