assert,crypto: make KeyObject and CryptoKey testable for equality#50897
assert,crypto: make KeyObject and CryptoKey testable for equality#50897panva wants to merge 2 commits intonodejs:mainfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
0965ede to
5327861
Compare
5327861 to
ca444db
Compare
This comment was marked as outdated.
This comment was marked as outdated.
ca444db to
b008047
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
cc @nodejs/crypto |
|
cc @nodejs/crypto |
aduh95
left a comment
There was a problem hiding this comment.
I think the use case makes sense, and I'm not able to able to suggest a better implementation, so let's roll with this.
| const a = crypto.createSecretKey(Buffer.alloc(1, 0)); | ||
| const b = crypto.createSecretKey(Buffer.alloc(1, 1)); |
There was a problem hiding this comment.
nit: I find Buffer.from easier to understand (I had to go read the docs to get what the second argument of Buffer.alloc was for)
| const a = crypto.createSecretKey(Buffer.alloc(1, 0)); | |
| const b = crypto.createSecretKey(Buffer.alloc(1, 1)); | |
| const a = crypto.createSecretKey(Buffer.from([0])); | |
| const b = crypto.createSecretKey(Buffer.from([1])); |
Commit Queue failed- Loading data for nodejs/node/pull/50897 ✔ Done loading data for nodejs/node/pull/50897 ----------------------------------- PR info ------------------------------------ Title assert,crypto: make KeyObject and CryptoKey testable for equality (#50897) Author Filip Skokan (@panva) Branch panva:crypto-objects-equal -> nodejs:main Labels crypto, assert, util, needs-ci, review wanted, webcrypto, commit-queue-rebase Commits 2 - crypto: update CryptoKey symbol properties - assert,crypto: make KeyObject and CryptoKey testable for equality Committers 1 - Filip Skokan PR-URL: https://github.com/nodejs/node/pull/50897 Reviewed-By: Antoine du Hamel ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/50897 Reviewed-By: Antoine du Hamel -------------------------------------------------------------------------------- ℹ This PR was created on Fri, 24 Nov 2023 16:50:43 GMT ✔ Approvals: 1 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/50897#pullrequestreview-1785408839 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2023-11-25T19:19:00Z: https://ci.nodejs.org/job/node-test-pull-request/55920/ ⚠ Commits were pushed after the last Full PR CI run: ⚠ - crypto: update CryptoKey symbol properties ⚠ - assert,crypto: make KeyObject and CryptoKey testable for equality - Querying data for job/node-test-pull-request/55920/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/7237974363 |
|
Landed in 154afbe...0afe731 |
PR-URL: #50897 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50897 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50897 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50897 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50897 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #50897 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
|
Not sure if this is the right place to comment but I noticed a regression from v18 to v20, and this PR seems vaguely related. const a = ['a'];
assert.deepStrictEqual(new Set([a, ['b']]), new Set([a, ['b']]));
The bug seems to occur only when comparing |
|
@chharvey can you open a new issue to track this please? (FWIW I'm able to reproduce) |
|
@aduh95 thanks for your reply. I think I found the culprit and left a comment: #46593 (comment) |
|
@chharvey can you open a new issue to track this please? |
This makes CryptoKey and KeyObject instances testable using
assert.deepStrictEqualandassert.deepEqual.The state before was that