Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: subtle importKey algorithm as string #293

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

boorad
Copy link
Collaborator

@boorad boorad commented Apr 30, 2024

subtle.importKey was not supporting AlgorithmIdentifier type of SubtleAlgorithm | AnyAlgorithm, just SubtleAlgorithm. So you would get an error when you try something like this:

const key = await subtle.importKey(
  'raw',
  keyData,
  'AES-GCM',   // <- string, not object
  false,
  ['encrypt', 'decrypt'],
);

Strings (of supported algorithms, i.e. AnyAlgorithm) should be valid for the algorithm argument. This PR fixes the bug.

@boorad boorad self-assigned this Apr 30, 2024
@boorad boorad merged commit 7086647 into margelo:main Apr 30, 2024
3 checks passed
@boorad boorad deleted the fix/subtle-importKey-algo-string branch April 30, 2024 22:01
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.

None yet

1 participant