diff options
author | Shelley Vohr <shelley.vohr@gmail.com> | 2019-12-12 20:02:37 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-12-18 02:17:21 +0300 |
commit | a221017ee884fd7d300c40df49187d90a5826b9b (patch) | |
tree | edc60fd009a7d4104eff0ec81d78d6bb43149591 | |
parent | 663a6b4938c51b786e0c956c8788f073dc0aa992 (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>
-rw-r--r-- | src/node_crypto.cc | 5 |
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; } |