-
Notifications
You must be signed in to change notification settings - Fork 30k
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
crypto: fix generateKeyPair
with encoding 'jwk'
#39319
Conversation
enerateKeyPair
with encoding 'jwk'generateKeyPair
with encoding 'jwk'
8050957
to
68df3f7
Compare
@nodejs/crypto |
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.
The PR's on a good track, but lacks some of the details that are present in KeyObject.prototype.export
more concretely
- https://github.com/nodejs/node/blob/v16.4.2/lib/internal/crypto/keys.js#L240-L247
- https://github.com/nodejs/node/blob/v16.4.2/lib/internal/crypto/keys.js#L193-L213
I think there are a few ways of moving forward
- either moving these asserts to C and have export just call the appropriate C method
- having generate piggyback on a keyobject and then returning the results of calling export on those
- a combination of those, e.g. leave the passphrase part in JS but move the rest to C
I'd like to move these to the C part. because the second way must have performance regression. And the third way looks like a too complex struct. |
da40de3
to
790e4ff
Compare
Co-authored-by: Voltrex <mohammadkeyvanzade94@gmail.com>
Co-authored-by: Voltrex <mohammadkeyvanzade94@gmail.com>
Co-authored-by: Filip Skokan <panva.ip@gmail.com>
Co-authored-by: Filip Skokan <panva.ip@gmail.com>
790e4ff
to
5d0b081
Compare
I've moved |
Lines 790 to 812 in 95bd164
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/cc @nodejs/crypto |
This comment has been minimized.
This comment has been minimized.
Does anyone review this pr? I think this is a nice fix 🤔 |
cc @nodejs/crypto |
Landed in 257312a |
* chore: bump node in DEPS to v16.6.0 * chore: bump node in DEPS to v16.6.1 * crypto: fix generateKeyPair with encoding 'jwk' nodejs/node#39319 * build: add library_files to gyp variables nodejs/node#39293 * debugger: rename internal module nodejs/node#39378 * chore: fixup patch indices * deps: extract gtest source files to deps/googletest nodejs/node#39386 * crypto: fix generateKeyPair with encoding 'jwk' nodejs/node#39319 * deps: bump HdrHistogram_C to 0.11.2 nodejs/node#39462 * fixup! deps: extract gtest source files to deps/googletest * chore: bump node in DEPS to v16.6.2 * chore: update patches * deps: reflect c-ares source tree nodejs/node#39653 * deps: update c-ares to 1.17.2 nodejs/node#39724 * fix: _ReadBarrier undefined symbol error on WOA arm64 * chore: update patches * chore: bump node in DEPS to v16.7.0 * deps: upgrade to libuv 1.42.0 nodejs/node#39525 * chore: update filenames * src: remove extra semicolons outside fns * chore: fixup patch filenames * chore: sort and alphabetize disabled tests Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
* chore: bump node in DEPS to v16.6.0 * chore: bump node in DEPS to v16.6.1 * crypto: fix generateKeyPair with encoding 'jwk' nodejs/node#39319 * build: add library_files to gyp variables nodejs/node#39293 * debugger: rename internal module nodejs/node#39378 * chore: fixup patch indices * deps: extract gtest source files to deps/googletest nodejs/node#39386 * crypto: fix generateKeyPair with encoding 'jwk' nodejs/node#39319 * deps: bump HdrHistogram_C to 0.11.2 nodejs/node#39462 * fixup! deps: extract gtest source files to deps/googletest * chore: bump node in DEPS to v16.6.2 * chore: update patches * deps: reflect c-ares source tree nodejs/node#39653 * deps: update c-ares to 1.17.2 nodejs/node#39724 * fix: _ReadBarrier undefined symbol error on WOA arm64 * chore: update patches * chore: bump node in DEPS to v16.7.0 * deps: upgrade to libuv 1.42.0 nodejs/node#39525 * chore: update filenames * src: remove extra semicolons outside fns * chore: fixup patch filenames * chore: sort and alphabetize disabled tests Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Fixes: #39205