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

Unified Diff: components/webcrypto/algorithms/rsa_sign.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_oaep.cc ('k') | components/webcrypto/algorithms/sha.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/rsa_sign.cc
diff --git a/components/webcrypto/algorithms/rsa_sign.cc b/components/webcrypto/algorithms/rsa_sign.cc
index 20f23061f3f163fdfa30e0a5fe60aa1653f730be..609ecbaf26d03089f07b3bddc36d0ecd65545d70 100644
--- a/components/webcrypto/algorithms/rsa_sign.cc
+++ b/components/webcrypto/algorithms/rsa_sign.cc
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <openssl/digest.h>
+#include <openssl/evp.h>
+#include <openssl/rsa.h>
#include <stddef.h>
#include "base/numerics/safe_math.h"
@@ -11,7 +14,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/WebCryptoKeyAlgorithm.h"
namespace webcrypto {
@@ -74,7 +76,7 @@ Status RsaSign(const blink::WebCryptoKey& key,
return Status::ErrorUnexpectedKeyType();
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
- crypto::ScopedEVP_MD_CTX ctx(EVP_MD_CTX_create());
+ bssl::ScopedEVP_MD_CTX ctx;
EVP_PKEY_CTX* pctx = NULL; // Owned by |ctx|.
EVP_PKEY* private_key = NULL;
@@ -87,8 +89,7 @@ Status RsaSign(const blink::WebCryptoKey& key,
// returns a maximum allocation size, while the call without a NULL returns
// the real one, which may be smaller.
size_t sig_len = 0;
- if (!ctx.get() ||
- !EVP_DigestSignInit(ctx.get(), &pctx, digest, NULL, private_key)) {
+ if (!EVP_DigestSignInit(ctx.get(), &pctx, digest, NULL, private_key)) {
return Status::OperationError();
}
@@ -119,7 +120,7 @@ Status RsaVerify(const blink::WebCryptoKey& key,
return Status::ErrorUnexpectedKeyType();
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
- crypto::ScopedEVP_MD_CTX ctx(EVP_MD_CTX_create());
+ bssl::ScopedEVP_MD_CTX ctx;
EVP_PKEY_CTX* pctx = NULL; // Owned by |ctx|.
EVP_PKEY* public_key = NULL;
« no previous file with comments | « components/webcrypto/algorithms/rsa_oaep.cc ('k') | components/webcrypto/algorithms/sha.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698