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-10-08 16:55:59 +00:00
|
|
|
index 3c9345fb46f65294b005102eafbaf60604a475f9..5e0c0fe3530de1f1801c45233613620b84c88140 100644
|
2019-10-18 23:52:15 +00:00
|
|
|
--- a/src/node_crypto.cc
|
|
|
|
+++ b/src/node_crypto.cc
|
2020-10-08 16:55:59 +00:00
|
|
|
@@ -5059,18 +5059,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;
|