-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: cast oaepLabel to unsigned char* #30917
Conversation
Correction: this doesn't have anything to do with those signatures. We required unsigned char and uint8_t to be the same type, and it is true in every platform I'm aware of. The signatures are identical. Rather it's that OpenSSL doesn't use any type signature at all. It's documented with that signature, but it's really a macro without any type-checking. The cast is needed to conform Node to the OpenSSL's documentation because C++ does not implicitly cast void*. |
dfd12b7
to
e3b6c64
Compare
This comment has been minimized.
This comment has been minimized.
OpenSSL uses a macro without typechecking; since C++ does not implicitly cast void* this is needed to conform Node.js to the OpenSSL documentation. PR-URL: #30917 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Landed in cb76f27. |
OpenSSL uses a macro without typechecking; since C++ does not implicitly cast void* this is needed to conform Node.js to the OpenSSL documentation. PR-URL: #30917 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
OpenSSL uses a macro without typechecking; since C++ does not implicitly cast void* this is needed to conform Node.js to the OpenSSL documentation. PR-URL: #30917 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
OpenSSL uses a macro without typechecking; since C++ does not implicitly cast void* this is needed to conform Node.js to the OpenSSL documentation. PR-URL: #30917 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* chore: bump node in DEPS to v12.16.0 * Fixup asar support setup patch nodejs/node#30862 * Fixup InternalCallbackScope patch nodejs/node#30236 * Fixup GN buildfiles patch nodejs/node#30755 * Fixup low-level hooks patch nodejs/node#30466 * Fixup globals require patch nodejs/node#31643 * Fixup process stream patch nodejs/node#30862 * Fixup js2c modification patch nodejs/node#30755 * Fixup internal fs override patch nodejs/node#30610 * Fixup context-aware warn patch nodejs/node#30336 * Fixup Node.js with ltcg config nodejs/node#29388 * Fixup oaepLabel patch nodejs/node#30917 * Remove redundant ESM test patch nodejs/node#30997 * Remove redundant cli flag patch nodejs/node#30466 * Update filenames.json * Remove macro generation in GN build files nodejs/node#30755 * Fix some compilation errors upstream * Add uvwasi to deps nodejs/node#30258 * Fix BoringSSL incompatibilities * Fixup linked module patch nodejs/node#30274 * Add missing sources to GN uv build libuv/libuv#2347 * Patch some uvwasi incompatibilities * chore: bump Node.js to v12.6.1 * Remove mark_arraybuffer_as_untransferable.patch nodejs/node#30549 * Fix uvwasi build failure on win * Fixup --perf-prof cli option error * Fixup early cjs module loading * fix: initialize diagnostics properly nodejs/node#30025 * Disable new esm syntax specs nodejs/node#30219 * Fixup v8 weakref hook spec nodejs/node#29874 * Fix async context timer issue * Disable monkey-patch-main spec It relies on nodejs/node#29777, and we don't override prepareStackTrace. * Disable new tls specs nodejs/node#23188 We don't support much of TLS owing to schisms between BoringSSL and OpenSSL. Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This PR fixes an incompatibility between BoringSSL and OpenSSL in compilation through Electron.
OpenSSL has the signature
whereas BoringSSL has:
Changing this in BoringSSL would not have the correct effect, since label (as returned by
OpenSSL_memdup
) is avoid*
& C++ doesn't cast fromvoid*
toT*
without an explicit cast. OpenSSL has a lot of functions/macros that aren't typesafe which means we don't get the usual C++ type-checking and so this fails to compile without this patch.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes