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

chore: use more restrictive types for timingSafeEqual #936

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

EvanHahn
Copy link
Contributor

This is a types-only change.

crypto.timingSafeEqual has some subtle behavior (highlighted in bold red in the docs!) when passing a Float32Array or Float64Array. Rather than adapt our wrapper to support this unusual situation, this updates the types to avoid it.

We never took advantage of this unusual case, and now we are even less likely to.

I plan to yolo-merge this if CI passes.

This is a types-only change.

[`crypto.timingSafeEqual`][0] has some subtle behavior (highlighted in
bold red in the docs!) when passing a `Float32Array` or `Float64Array`.
Rather than adapt our wrapper to support this unusual situation, this
updates the types to avoid it.

We never took advantage of this unusual case, and now we are even less
likely to.

[0]: https://nodejs.org/api/crypto.html#cryptotimingsafeequala-b
@EvanHahn EvanHahn enabled auto-merge (squash) October 22, 2024 23:10
@EvanHahn EvanHahn disabled auto-merge October 22, 2024 23:10
@EvanHahn EvanHahn merged commit bddf7be into main Oct 22, 2024
6 checks passed
@EvanHahn EvanHahn deleted the timingsafeequal-types branch October 22, 2024 23:10
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