From cb76f271223666ce38e23235cdbc4f903414d87c Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 12 Dec 2019 12:02:37 -0500 Subject: [PATCH] crypto: cast oaepLabel to unsigned char* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott --- src/node_crypto.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index c53c5c4ccc4da8..87a3e5525d1cd7 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(label), + oaep_label_len)) { OPENSSL_free(label); return false; }