2019-10-18 23:52:15 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Shelley Vohr <shelley.vohr@gmail.com>
|
|
|
|
Date: Tue, 15 Oct 2019 11:30:27 -0700
|
|
|
|
Subject: Revert "crypto: add oaepLabel option"
|
|
|
|
|
2019-10-21 15:02:23 +00:00
|
|
|
This partially reverts https://github.com/nodejs/node/pull/29489.
|
2019-12-11 00:22:35 +00:00
|
|
|
The BoringSSL incompatibilities (OPENSSL_memdup) will be shimmed in and this should
|
2019-10-21 15:02:23 +00:00
|
|
|
be removed when the associated update is rolled into Chromium.
|
2019-10-18 23:52:15 +00:00
|
|
|
|
|
|
|
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
|
2020-06-19 00:37:23 +00:00
|
|
|
index 17aeb99d586161d0af69376811b42e84a80553e3..14029692e57b219d245d529a0be175c80f3a32de 100644
|
2019-10-18 23:52:15 +00:00
|
|
|
--- a/src/node_crypto.cc
|
|
|
|
+++ b/src/node_crypto.cc
|
2020-06-17 22:57:12 +00:00
|
|
|
@@ -5011,18 +5011,6 @@ bool PublicKeyCipher::Cipher(Environment* env,
|
2019-10-18 23:52:15 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (oaep_label_len != 0) {
|
|
|
|
- // 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);
|
2020-02-24 21:02:04 +00:00
|
|
|
- if (0 >= EVP_PKEY_CTX_set0_rsa_oaep_label(ctx.get(),
|
|
|
|
- reinterpret_cast<unsigned char*>(label),
|
|
|
|
- oaep_label_len)) {
|
2019-10-18 23:52:15 +00:00
|
|
|
- OPENSSL_free(label);
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
size_t out_len = 0;
|
|
|
|
if (EVP_PKEY_cipher(ctx.get(), nullptr, &out_len, data, len) <= 0)
|
|
|
|
return false;
|