Skip to content

Commit 9bc5c9f

Browse files
codebytereBethGriggs
authored andcommitted
crypto: cast oaepLabel to unsigned char*
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 <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 24a5929 commit 9bc5c9f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/node_crypto.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -5512,8 +5512,9 @@ bool PublicKeyCipher::Cipher(Environment* env,
55125512
// OpenSSL takes ownership of the label, so we need to create a copy.
55135513
void* label = OPENSSL_memdup(oaep_label, oaep_label_len);
55145514
CHECK_NOT_NULL(label);
5515-
if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(), label,
5516-
oaep_label_len)) {
5515+
if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(),
5516+
reinterpret_cast<unsigned char*>(label),
5517+
oaep_label_len)) {
55175518
OPENSSL_free(label);
55185519
return false;
55195520
}

0 commit comments

Comments
 (0)