Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e4b3181

Browse files
codebyteretargos
authored andcommittedJan 14, 2020
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 6f61407 commit e4b3181

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
@@ -5509,8 +5509,9 @@ bool PublicKeyCipher::Cipher(Environment* env,
55095509
// OpenSSL takes ownership of the label, so we need to create a copy.
55105510
void* label = OPENSSL_memdup(oaep_label, oaep_label_len);
55115511
CHECK_NOT_NULL(label);
5512-
if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(), label,
5513-
oaep_label_len)) {
5512+
if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(),
5513+
reinterpret_cast<unsigned char*>(label),
5514+
oaep_label_len)) {
55145515
OPENSSL_free(label);
55155516
return false;
55165517
}

0 commit comments

Comments
 (0)
Please sign in to comment.