Skip to content

fix(crypto): support string encryption algorithm identifiers - #1717

Merged
richarddavison merged 3 commits into
awslabs:mainfrom
dills122:fix/string-encryption-algorithm-identifiers
Aug 13, 2026
Merged

fix(crypto): support string encryption algorithm identifiers#1717
richarddavison merged 3 commits into
awslabs:mainfrom
dills122:fix/string-encryption-algorithm-identifiers

Conversation

@dills122

Copy link
Copy Markdown
Contributor

Issue # (if available)

Related to #968.

Description of changes

Accept case-insensitive DOMString algorithm identifiers for parameterless AES-KW wrap/unwrap and RSA-OAEP encrypt/decrypt operations.

WebCrypto AlgorithmIdentifier accepts either a DOMString or an algorithm dictionary. The encryption parser previously required an object unconditionally, so valid string identifiers failed before AES-KW or RSA-OAEP could be selected. The parser now reuses the existing algorithm-name normalization path and permits omitted parameter objects only for those operations.

AES-CBC, AES-CTR, and AES-GCM continue to reject string-only inputs with TypeError because their required parameter dictionaries are absent. Object-based RSA-OAEP labels are also covered to ensure the parser change preserves non-empty label handling.

Relevant standard:

Validation:

  • cargo test -p llrt_crypto — 23 passed
  • focused LLRT crypto.subtle runtime suite — 20 passed
  • cargo clippy -p llrt_crypto --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • Prettier check for tests/unit/crypto.subtle.test.ts
  • git diff --check
  • complete fork CI matrix passed, including the successful rerun of a transient Homebrew setup failure

Checklist

  • Created focused unit coverage for AES-KW, RSA-OAEP, required AES dictionaries, and RSA-OAEP labels
  • Ran targeted Rust and TypeScript formatting checks
  • Made sure the code adds no warnings with warning-denied Clippy and the CI check job
  • Confirmed type changes are not applicable
  • Confirmed documentation changes are not required

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment thread modules/llrt_crypto/src/subtle/encryption_algorithm.rs Outdated
@richarddavison
richarddavison merged commit 2e33481 into awslabs:main Aug 13, 2026
32 checks passed
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