Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShelley Vohr <shelley.vohr@gmail.com>2019-12-12 20:02:37 +0300
committerShelley Vohr <shelley.vohr@gmail.com>2019-12-14 21:52:17 +0300
commitcb76f271223666ce38e23235cdbc4f903414d87c (patch)
tree997eb143d5218348b77b0f6d3d373739d538cc5f /src
parent648088289d619bfb149fe90316ce0127083c4c99 (diff)
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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src')
-rw-r--r--src/node_crypto.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index c53c5c4ccc4..87a3e5525d1 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -5510,8 +5510,9 @@ bool PublicKeyCipher::Cipher(Environment* env,
// OpenSSL takes ownership of the label, so we need to create a copy.
void* label = OPENSSL_memdup(oaep_label, oaep_label_len);
CHECK_NOT_NULL(label);
- if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(), label,
- oaep_label_len)) {
+ if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(),
+ reinterpret_cast<unsigned char*>(label),
+ oaep_label_len)) {
OPENSSL_free(label);
return false;
}