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

Unified Diff: content/child/webcrypto/openssl/hmac_openssl.cc

Issue 410743002: [refactor] Replace custom utility function with base's "vector_as_array()" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase onto master Created 6 years, 5 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 | « content/child/webcrypto/openssl/aes_gcm_openssl.cc ('k') | content/child/webcrypto/openssl/sha_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/openssl/hmac_openssl.cc
diff --git a/content/child/webcrypto/openssl/hmac_openssl.cc b/content/child/webcrypto/openssl/hmac_openssl.cc
index fe4c29c27e0ea39c5ef40ce4cd943ef34fc1824b..5d19a451434b1175bc65aafb4e86cfabc045b314 100644
--- a/content/child/webcrypto/openssl/hmac_openssl.cc
+++ b/content/child/webcrypto/openssl/hmac_openssl.cc
@@ -5,6 +5,7 @@
#include <openssl/hmac.h>
#include "base/logging.h"
+#include "base/stl_util.h"
#include "content/child/webcrypto/algorithm_implementation.h"
#include "content/child/webcrypto/crypto_data.h"
#include "content/child/webcrypto/jwk.h"
@@ -48,7 +49,7 @@ Status SignHmac(const std::vector<uint8_t>& raw_key,
buffer->resize(hmac_expected_length);
crypto::ScopedOpenSSLSafeSizeBuffer<EVP_MAX_MD_SIZE> hmac_result(
- Uint8VectorStart(buffer), hmac_expected_length);
+ vector_as_array(buffer), hmac_expected_length);
unsigned int hmac_actual_length;
unsigned char* const success = HMAC(digest_algorithm,
@@ -193,7 +194,7 @@ class HmacImplementation : public AlgorithmImplementation {
// Do not allow verification of truncated MACs.
*signature_match = result.size() == signature.byte_length() &&
- crypto::SecureMemEqual(Uint8VectorStart(result),
+ crypto::SecureMemEqual(vector_as_array(&result),
signature.bytes(),
signature.byte_length());
« no previous file with comments | « content/child/webcrypto/openssl/aes_gcm_openssl.cc ('k') | content/child/webcrypto/openssl/sha_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698