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-02-25 16:46:08 +00:00
|
|
|
index 114b4d503f3c1c01aa9999cf60a044d80a39acc1..de6828fc44752789bef02d29d3320dbb6f41448a 100644
|
2019-10-18 23:52:15 +00:00
|
|
|
--- a/src/node_crypto.cc
|
|
|
|
+++ b/src/node_crypto.cc
|
2020-02-24 21:02:04 +00:00
|
|
|
@@ -5514,18 +5514,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;
|