Skip to content

feat: sync remaining esdk/ changes from unreviewed to mainline#938

Merged
lucasmcdonald3 merged 1 commit into
aws-crypto-rust/mainlinefrom
aws-crypto-rust/esdk-mainline-pr
Jul 10, 2026
Merged

feat: sync remaining esdk/ changes from unreviewed to mainline#938
lucasmcdonald3 merged 1 commit into
aws-crypto-rust/mainlinefrom
aws-crypto-rust/esdk-mainline-pr

Conversation

@lucasmcdonald3

@lucasmcdonald3 lucasmcdonald3 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

misc changes from unreviewed branch

@lucasmcdonald3 lucasmcdonald3 force-pushed the aws-crypto-rust/esdk-mainline-pr branch from 21911a2 to 8599b30 Compare July 10, 2026 18:10
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.
@lucasmcdonald3 lucasmcdonald3 force-pushed the aws-crypto-rust/esdk-mainline-pr branch from 8599b30 to 1e2987b Compare July 10, 2026 20:47
@lucasmcdonald3 lucasmcdonald3 changed the title Add esdk/ (AWS Encryption SDK for Rust) to mainline feat: sync remaining esdk/ changes from unreviewed to mainline Jul 10, 2026
@lucasmcdonald3 lucasmcdonald3 requested a review from Copilot July 10, 2026 21:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/... to spec/... 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_internals and 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");
}
@lucasmcdonald3 lucasmcdonald3 merged commit d592c28 into aws-crypto-rust/mainline Jul 10, 2026
1 of 2 checks passed
@lucasmcdonald3 lucasmcdonald3 deleted the aws-crypto-rust/esdk-mainline-pr branch July 10, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants