Skip to content

fix(aws-lc-rs): offer exactly aws-lc-rs 1.x's API - #522

Merged
kixelated merged 2 commits into
mainfrom
quest/m0/adapters/aws-lc-rs
Nov 10, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m0/adapters/aws-lc-rs

Conversation

@kixelated

@kixelated kixelated commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/adapters/aws-lc-rs.md (epic quest/m0/adapters/README.md): rind-aws-lc-rs now offers exactly aws-lc-rs 1.x's API, adding only its wipe feature.

Changes

  • aead::LessSafeKey::open_in_place_separate_tag takes aws-lc-rs 1.17+'s (nonce, aad, tag: &[u8], in_out) instead of ring's (nonce, aad, Tag, in_out, RangeFrom). A tag of the wrong length fails with Unspecified, as upstream's does.
  • cipher::OperatingMode and rsa::KeySize are #[non_exhaustive].
  • pbkdf2::Algorithm no longer implements Debug.
  • PublicKeyComponents<B> implements TryInto<PublicEncryptingKey> directly, not TryFrom.
  • kem::AlgorithmIdentifier gains nid(); AlgorithmId::MlKem768 returns AWS-LC's NID_MLKEM768 (989).
  • kem::DecapsulationKey::{generate, encapsulation_key}, EncapsulationKey::new, and key_wrap::KeyEncryptionKey::new are generic over the algorithm, as upstream's are. The sealed traits mean only this crate's algorithms reach them.
  • Error for Unspecified and KeyRejected overrides description() and cause() as upstream does.
  • The cpu module (check, MissingFeature) is gone, per the epic.
  • ring-io gates io, rsa::PublicKey::{modulus, exponent}, and From<&PublicKey> for PublicKeyComponents<Vec<u8>>; ring-sig-verify (already) gates VerificationAlgorithm::verify; either gates From<untrusted::EndOfInput> for Unspecified, matching upstream. The quest named only io; upstream gates the two PublicKey methods and the From impl with ring-io too, so they follow.
  • README, MIGRATING.md, and MIGRATE.md drop the cpu::check() advice for this adapter. MIGRATING.md's aead row now shows aws-lc-rs's open_in_place_separate_tag signature, with ring's noted.
  • Tests: the differential AEAD test opens with a separate tag (full length and one byte short) through code compiled against both crates, which also pins the signature; the KEM test compares nid().

Public API

Breaking for rind-aws-lc-rs 1.0.2 users of the items above, but each change restores aws-lc-rs's API, so per CONTRIBUTING.md's Releases this is a fix: the version is set by hand to 1.0.3 and the title carries no !. Migration: write the code as for aws-lc-rs 1.19. The maintainer may yank 1.0.0 through 1.0.2. No wire impact.

Choices made without asking

  • untrusted stays a required dependency (upstream makes it optional behind ring-io and ring-sig-verify), since the adapter's private DER reader uses it; it is not API.
  • Id maps to rind's algorithm through nid(), rather than through a hidden method on the public trait.
  • Version 1.0.3 set by hand. moq-dev/rind#511, the open release PR, also proposes 1.0.3 and will regenerate after this merges.

Checks

just check passes, as do cargo test -p rind-aws-lc-rs with default features and with --no-default-features, and the wipe zeroing test.

Caused by

  • No single PR: the adapter was written with some ring-shaped signatures, found by a rustdoc diff against aws-lc-rs 1.19.0.

Models

Size: M
Implementer: Claude Code, claude-opus-5-5, medium effort

(Written by Claude Opus 5.5 with medium)

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, medium effort
  • Session: 01a1bf3a-028d-7543-a88c-4b2e1fe70696, round 1
  • Head: 2dbe83d
  • Base: origin/main at ccdda85
  • Score: 9/10, The changes appear ready to land based on code review, with no actionable defects found and API changes matching inspected upstream definitions, though builds and tests were not run as instructed.
  • Findings: none

kixelated and others added 2 commits November 8, 2026 23:01
open_in_place_separate_tag takes aws-lc-rs's (nonce, aad, &[u8], in_out)
rather than ring's, the kem and key_wrap constructors are generic, ring-io
and ring-sig-verify gate what they gate upstream, and the cpu module, the
pbkdf2::Algorithm Debug impl, and the TryFrom impl upstream lacks are gone.
Set to 1.0.3 by hand, as a fix restoring upstream's API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title rind-aws-lc-rs's signatures are aws-lc-rs 1.x's fix(aws-lc-rs): offer exactly aws-lc-rs 1.x's API Nov 9, 2026
@kixelated
kixelated marked this pull request as ready for review November 9, 2026 07:34
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 91d96cf8-fadd-4a56-abcd-4babb0ef58fe
Commits

Reviewing files that changed from the base of the PR and between ccdda85 and 2dbe83d.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 17

  • MIGRATE.md
  • MIGRATING.md
  • quest/m0/adapters/aws-lc-rs.md
  • rind-aws-lc-rs/Cargo.toml
  • rind-aws-lc-rs/README.md
  • rind-aws-lc-rs/src/aead.rs
  • rind-aws-lc-rs/src/cipher.rs
  • rind-aws-lc-rs/src/cpu.rs
  • rind-aws-lc-rs/src/der.rs
  • rind-aws-lc-rs/src/error.rs
  • rind-aws-lc-rs/src/kem.rs
  • rind-aws-lc-rs/src/key_wrap.rs
  • rind-aws-lc-rs/src/lib.rs
  • rind-aws-lc-rs/src/pbkdf2.rs
  • rind-aws-lc-rs/src/rsa.rs
  • rind-aws-lc-rs/tests/differential.rs
  • rind-aws-lc-rs/tests/keys.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes — every API change in this PR verified line-for-line against the aws-lc-rs v1.19.0 tag sources, and the adapter's test matrix run locally (default features, --no-default-features, --features wipe, --all-features check, wycheproof HKDF): all pass.

  • aead::LessSafeKey::open_in_place_separate_tag now takes aws-lc-rs 1.17+'s (nonce, aad, tag: &[u8], in_out), matching upstream's signature exactly (including its #[allow(clippy::needless_pass_by_value)]); a wrong-length tag fails with Unspecified via Tag::try_from, and the differential test exercises the separate-tag path at full length and one byte short through code compiled against both crates.
  • cipher::OperatingMode and rsa::KeySize gain upstream's #[non_exhaustive], and pbkdf2::Algorithm drops Debug — all three match upstream's attributes and derive lists.
  • PublicKeyComponents<B> implements TryInto<PublicEncryptingKey> directly (with the explicit PublicEncryptingKey::new path, since Self is the components type), as upstream does.
  • kem::AlgorithmIdentifier gains nid() with the same supertrait bounds; NID_MLKEM768 = 989 confirmed against aws-lc-sys's bindings; the KEM and key_wrap constructors are now generic over the algorithm, as upstream's are.
  • Unspecified and KeyRejected override the deprecated description()/cause() with upstream's exact values.
  • The cpu module is gone; ring-io gates io, rsa::PublicKey::{modulus, exponent}, and From<&PublicKey> for PublicKeyComponents<Vec<u8>>, and From<untrusted::EndOfInput> carries upstream's any(ring-sig-verify, ring-io) gate — der.rs's explicit map_err(unspecified) keeps the error mapping identical when the impl is compiled out. The cfg_attr on PublicKey::e alone is correct: n stays live through the un-gated modulus_len().
  • Docs drop the cpu::check() advice consistently (README, MIGRATING.md, MIGRATE.md), with no stale references left repo-wide; the quest file deletion is clean — nothing in the tree links to it.
  • Version 1.0.3 set by hand with no ! in the title, matching CONTRIBUTING.md's restoring-upstream-is-a-bugfix policy; Cargo.lock updated in step.

Pullfrog  | View workflow run | Using glm-5.3 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit c74878a Nov 10, 2026
11 checks passed
@moq-bot moq-bot Bot mentioned this pull request Nov 10, 2026
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.

1 participant