Repository navigation
Conversation
Two defects make ConnectionTrafficSecrets unusable for every AES-GCM cipher suite except TLS 1.3 AES-256-GCM: - Tls13AeadAlgorithm::extract_keys returned Aes256Gcm for both macro instantiations, reporting a 32-byte key for the AES-128 suite. A 16-byte key is not valid AES-256 key material, so consumers such as kTLS SET_TLS_RX reject a TLS 1.3 AES-128 handoff. - Tls12AeadAlgorithm::extract_keys returned Aes128Gcm for both macro instantiations and converted the fixed_iv slice with try_into().unwrap() as though it were the full 12-byte IV. rustls passes the 4-byte fixed IV and the 8-byte explicit nonce separately (see KeyBlockShape), so every TLS 1.2 AES-GCM extract panicked with TryFromSliceError. The IV is now assembled as fixed_iv || explicit, the same construction the TLS 1.2 encrypter already uses, and a wrong-length input returns UnsupportedOperationError instead of panicking. Regression tests cover the TLS 1.3 secret shape, the TLS 1.2 IV assembly, and malformed key-block slices. Suite confidentiality limits are unchanged and handled separately.
The new test module was hand-formatted and disagrees with rustfmt's default settings in three places (import grouping and two wrapped calls). cargo fmt --all -- --check is clean now.
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.
Two defects make ConnectionTrafficSecrets unusable for every AES-GCM cipher suite except TLS 1.3 AES-256-GCM:
Regression tests cover the TLS 1.3 secret shape, the TLS 1.2 IV assembly, and malformed key-block slices.