GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: add note about timingSafeEqual for TypedArray by tniessen · Pull Request #36323 · nodejs/node

Conversation

@tniessen

@tniessen tniessen commented Nov 30, 2020

Copy link
Copy Markdown
Member

Since #29657, timingSafeEqual uses byteLength instead of length. When comparing different types (e.g., Uint8Array and Uint16Array), the result can depend on the byte order of the system architecture.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss and ExE-Boss reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@tniessen
doc: add note about timingSafeEqual for TypedArray
89b0d23
@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to Node.js documentation. labels Nov 30, 2020
cjihrig
cjihrig approved these changes Nov 30, 2020
View reviewed changes
jasnell
jasnell approved these changes Nov 30, 2020
View reviewed changes
lpinca
lpinca approved these changes Nov 30, 2020
View reviewed changes
addaleax
addaleax reviewed Dec 1, 2020
View reviewed changes
Comment thread doc/api/crypto.md Outdated
must have the same byte length.

If at least one of `a` and `b` is a `TypedArray`, the result may depend on
the platform byte order.

@addaleax addaleax Dec 1, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

may depend sounds like this isn’t deterministic, but I assume it is? It’s always going to depend on the platform byte order, right?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tniessen tniessen Dec 2, 2020

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Good point! My thinking was that the result of some inputs (e.g., timingSafeEqual(new Uint8Array([1, 1]), new Uint16Array([0x0101]))) does not depend on the platform byte order, but that's probably not what others would take away from the way I worded it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@addaleax addaleax Dec 2, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yeah, I see … maybe I would say something like If at least one of `a` and `b` is a `TypedArray` with more than one byte per entry, like `Uint16Array`, the result will be computed using platform byte order?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ExE-Boss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@tniessen tniessen Dec 12, 2020

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sorry about the delay, fixed!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Trott
Trott approved these changes Dec 3, 2020
View reviewed changes

@Trott Trott left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM with the elimination of may from the text.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ExE-Boss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
mhdawson
mhdawson approved these changes Dec 9, 2020
View reviewed changes

@mhdawson mhdawson left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM with @addaleax's suggestion

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tniessen
fixup
dd16890
Thanks Anna!
@tniessen tniessen added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 17, 2020
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 17, 2020
@nodejs-github-bot

nodejs-github-bot commented Dec 17, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/34993/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tniessen added a commit that referenced this pull request Dec 17, 2020
@tniessen
doc: add note about timingSafeEqual for TypedArray
6255973
PR-URL: #36323
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@tniessen

tniessen commented Dec 17, 2020

Copy link
Copy Markdown
Member Author

Landed in 6255973, thank you for reviewing!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tniessen tniessen closed this Dec 17, 2020
targos pushed a commit that referenced this pull request Dec 21, 2020
@tniessen @targos
doc: add note about timingSafeEqual for TypedArray
ad75c78
PR-URL: #36323
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@targos targos mentioned this pull request Dec 22, 2020
v15.5.0 release proposal #36597
Merged
@tniessen
tniessen deleted the doc-note-about-timingsafeequal branch January 15, 2021 17:14
targos pushed a commit that referenced this pull request May 1, 2021
@tniessen @targos
doc: add note about timingSafeEqual for TypedArray
6198d74
PR-URL: #36323
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
v14.17.0 proposal #38507
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Sep 12, 2026
feat(duo): startup check authelia/authelia#10371
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax left review comments
@jasnell jasnell jasnell approved these changes
@Trott Trott Trott approved these changes
@lpinca lpinca lpinca approved these changes
@cjihrig cjihrig cjihrig approved these changes
+1 more reviewer
@mhdawson mhdawson mhdawson approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to Node.js documentation.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@tniessen @nodejs-github-bot @jasnell @Trott @addaleax @lpinca @cjihrig @mhdawson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.