feat: sync remaining esdk/ changes from unreviewed to mainline#938
Merged
lucasmcdonald3 merged 1 commit intoJul 10, 2026
Merged
Conversation
21911a2 to
8599b30
Compare
Adds legacy_compat (required: lib.rs declares it unconditionally and materials.rs imports it) and syncs decrypt, lib, and message/* changes plus the shared test helpers and updated unit tests. Excludes the feature-gated test_vectors runner and its integration test; those will be wired into a separate test-vector framework later.
8599b30 to
1e2987b
Compare
kessplas
approved these changes
Jul 10, 2026
There was a problem hiding this comment.
Pull request overview
This PR syncs a set of “unreviewed” branch updates into mainline, primarily focusing on aligning spec-trace annotations in tests and exposing additional internal helpers to enable deeper byte-level / cross-implementation test coverage.
Changes:
- Updated spec-trace links from
specification/...tospec/...across message body AAD and footer tests/implementation. - Added large shared integration-test helper and fixtures modules (including external nonframed test vectors and parsing helpers).
- Exposed additional internal message/header/key-derivation helpers via
__test_internalsand introduced a legacy type conversion module.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| esdk/tests/test_message_body_aad.rs | Updates spec-trace anchors and adds additional spec-justified assertions. |
| esdk/tests/test_helpers.rs | Introduces shared integration-test utilities for encryption/decryption, parsing, and fixtures/vectors. |
| esdk/tests/test_footer.rs | Updates spec-trace anchors and strengthens expectations for unrecognized suites. |
| esdk/tests/fixtures.rs | Adds shared test fixture constants and small encryption-context builders. |
| esdk/src/message/mod.rs | Makes DigestWriter public for test-internal re-export. |
| esdk/src/message/header.rs | Makes header parsing/message-id generation available for test internals; adds documentation and a constant-time verification spec note. |
| esdk/src/message/header_types.rs | Makes header body/auth types public (for test-internal usage) and adds documentation. |
| esdk/src/message/header_auth.rs | Makes header-auth deserialization public (for test-internal usage) and adds documentation. |
| esdk/src/message/footer.rs | Updates spec-trace anchors for footer serialization/deserialization. |
| esdk/src/message/body/body_aad.rs | Updates spec-trace anchors and clarifies spec implications on serialization. |
| esdk/src/lib.rs | Expands __test_internals exports to support integration tests. |
| esdk/src/legacy_compat.rs | Adds legacy conversion utilities between Dafny legacy types and suite/material representations. |
| esdk/src/decrypt.rs | Adds spec implication annotations for key-derivation inputs and documents get_ecdsa_alg. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+958
to
+968
| pub fn find_footer_offset(ct: &[u8]) -> (usize, u16) { | ||
| // Try signature lengths in the expected range for ECDSA P384 DER signatures | ||
| for candidate_len in 90..=110 { | ||
| let offset = ct.len() - 2 - candidate_len; | ||
| let sig_len = u16::from_be_bytes([ct[offset], ct[offset + 1]]); | ||
| if sig_len as usize == candidate_len { | ||
| return (offset, sig_len); | ||
| } | ||
| } | ||
| panic!("Could not find footer in ciphertext"); | ||
| } |
Comment on lines
+972
to
+981
| pub fn find_footer_offset_only(ct: &[u8]) -> usize { | ||
| for candidate_len in 90..=110 { | ||
| let offset = ct.len() - 2 - candidate_len; | ||
| let sig_len = u16::from_be_bytes([ct[offset], ct[offset + 1]]); | ||
| if sig_len as usize == candidate_len { | ||
| return offset; | ||
| } | ||
| } | ||
| panic!("Could not find footer in ciphertext"); | ||
| } |
d592c28
into
aws-crypto-rust/mainline
1 of 2 checks passed
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.
Summary
misc changes from unreviewed branch