diff options
author | Shelley Vohr <shelley.vohr@gmail.com> | 2021-06-04 12:11:54 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-06-11 08:24:55 +0300 |
commit | 6d5dc63ae406845933d90b6d6faaebc6cb63b1a6 (patch) | |
tree | 2ed71724dca9318f8499f3f0254abff6b201ab7f /src | |
parent | 6e93c17bf51bad21441474f3a795760a2a2175d3 (diff) |
crypto: fix label cast in EVP_PKEY_CTX_set0_rsa_oaep_label
PR-URL: https://github.com/nodejs/node/pull/38926
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/crypto/crypto_cipher.cc | 2 | ||||
-rw-r--r-- | 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 3ec212ee52b..198297d4edb 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<unsigned char*>(label), + static_cast<unsigned char*>(label), oaep_label.size())) { OPENSSL_free(label); return false; diff --git a/src/crypto/crypto_rsa.cc b/src/crypto/crypto_rsa.cc index 5fa91cce1a6..5bbeb01ab58 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<unsigned char*>(label), + label_len) <= 0) { OPENSSL_free(label); return WebCryptoCipherStatus::FAILED; } |