From 6d5dc63ae406845933d90b6d6faaebc6cb63b1a6 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 4 Jun 2021 11:11:54 +0200 Subject: [PATCH] crypto: fix label cast in EVP_PKEY_CTX_set0_rsa_oaep_label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/38926 Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen Reviewed-By: Tobias Nießen --- src/crypto/crypto_cipher.cc | 2 +- src/crypto/crypto_rsa.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/crypto/crypto_cipher.cc b/src/crypto/crypto_cipher.cc index 3ec212ee52b976..198297d4edbd88 100644 --- a/src/crypto/crypto_cipher.cc +++ b/src/crypto/crypto_cipher.cc @@ -906,7 +906,7 @@ bool PublicKeyCipher::Cipher( void* label = OPENSSL_memdup(oaep_label.data(), oaep_label.size()); CHECK_NOT_NULL(label); if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(), - reinterpret_cast(label), + static_cast(label), oaep_label.size())) { OPENSSL_free(label); return false; diff --git a/src/crypto/crypto_rsa.cc b/src/crypto/crypto_rsa.cc index 5fa91cce1a6ad2..5bbeb01ab58ac7 100644 --- a/src/crypto/crypto_rsa.cc +++ b/src/crypto/crypto_rsa.cc @@ -210,7 +210,10 @@ WebCryptoCipherStatus RSA_Cipher( if (label_len > 0) { void* label = OPENSSL_memdup(params.label.get(), label_len); CHECK_NOT_NULL(label); - if (EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(), label, label_len) <= 0) { + if (EVP_PKEY_CTX_set0_rsa_oaep_label( + ctx.get(), + static_cast(label), + label_len) <= 0) { OPENSSL_free(label); return WebCryptoCipherStatus::FAILED; }