Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(830)

Unified Diff: components/webcrypto/algorithms/rsa_oaep.cc

Issue 2407633002: Use new BoringSSL scopers in //components. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/webcrypto/algorithms/rsa.cc ('k') | components/webcrypto/algorithms/rsa_sign.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/rsa_oaep.cc
diff --git a/components/webcrypto/algorithms/rsa_oaep.cc b/components/webcrypto/algorithms/rsa_oaep.cc
index 05c70466624046e1680c2e30112286ad1faef839..9a9caf5c3d9533b6cc8d48f70e24edf61d5a9bff 100644
--- a/components/webcrypto/algorithms/rsa_oaep.cc
+++ b/components/webcrypto/algorithms/rsa_oaep.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include <openssl/evp.h>
+#include <openssl/mem.h>
+#include <openssl/rsa.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
@@ -14,7 +16,6 @@
#include "components/webcrypto/crypto_data.h"
#include "components/webcrypto/status.h"
#include "crypto/openssl_util.h"
-#include "crypto/scoped_openssl_types.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h"
@@ -49,7 +50,7 @@ Status CommonEncryptDecrypt(InitFunc init_func,
if (!digest)
return Status::ErrorUnsupported();
- crypto::ScopedEVP_PKEY_CTX ctx(EVP_PKEY_CTX_new(pkey, NULL));
+ bssl::UniquePtr<EVP_PKEY_CTX> ctx(EVP_PKEY_CTX_new(pkey, NULL));
if (!init_func(ctx.get()) ||
!EVP_PKEY_CTX_set_rsa_padding(ctx.get(), RSA_PKCS1_OAEP_PADDING) ||
@@ -64,7 +65,7 @@ Status CommonEncryptDecrypt(InitFunc init_func,
if (label.size()) {
// Make a copy of the label, since the ctx takes ownership of it when
// calling set0_rsa_oaep_label().
- crypto::ScopedOpenSSLBytes label_copy;
+ bssl::UniquePtr<uint8_t> label_copy;
label_copy.reset(static_cast<uint8_t*>(OPENSSL_malloc(label.size())));
memcpy(label_copy.get(), label.data(), label.size());
« no previous file with comments | « components/webcrypto/algorithms/rsa.cc ('k') | components/webcrypto/algorithms/rsa_sign.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698