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

Unified Diff: components/webcrypto/algorithms/sha.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_sign.cc ('k') | components/webcrypto/algorithms/util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/sha.cc
diff --git a/components/webcrypto/algorithms/sha.cc b/components/webcrypto/algorithms/sha.cc
index cd380a040d8e878ea335c2b689aedbb8ab69f5be..9c5d3945bc83f2f8dcf137bfd65deb7d1908537f 100644
--- a/components/webcrypto/algorithms/sha.cc
+++ b/components/webcrypto/algorithms/sha.cc
@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <openssl/evp.h>
-#include <openssl/sha.h>
+#include <openssl/digest.h>
#include <stdint.h>
#include <vector>
@@ -15,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"
namespace webcrypto {
@@ -29,7 +27,6 @@ class DigestorImpl : public blink::WebCryptoDigestor {
public:
explicit DigestorImpl(blink::WebCryptoAlgorithmId algorithm_id)
: initialized_(false),
- digest_context_(EVP_MD_CTX_create()),
algorithm_id_(algorithm_id) {}
bool consume(const unsigned char* data, unsigned int size) override {
@@ -73,9 +70,6 @@ class DigestorImpl : public blink::WebCryptoDigestor {
if (!digest_algorithm)
return Status::ErrorUnsupported();
- if (!digest_context_.get())
- return Status::OperationError();
-
if (!EVP_DigestInit_ex(digest_context_.get(), digest_algorithm, NULL))
return Status::OperationError();
@@ -102,7 +96,7 @@ class DigestorImpl : public blink::WebCryptoDigestor {
}
bool initialized_;
- crypto::ScopedEVP_MD_CTX digest_context_;
+ bssl::ScopedEVP_MD_CTX digest_context_;
blink::WebCryptoAlgorithmId algorithm_id_;
unsigned char result_[EVP_MAX_MD_SIZE];
};
« no previous file with comments | « components/webcrypto/algorithms/rsa_sign.cc ('k') | components/webcrypto/algorithms/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698