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

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

Issue 1461703009: Switch //components from vector_as_array to vector::data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eroman comment Created 5 years, 1 month 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/hkdf.cc ('k') | components/webcrypto/algorithms/hmac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/hmac.cc
diff --git a/components/webcrypto/algorithms/hmac.cc b/components/webcrypto/algorithms/hmac.cc
index 28ef3a05ac2d5d43f562db71f91f7af835f46276..33d60bb8e1861dc55d896aa811d90aebb8967bab 100644
--- a/components/webcrypto/algorithms/hmac.cc
+++ b/components/webcrypto/algorithms/hmac.cc
@@ -6,7 +6,6 @@
#include "base/logging.h"
#include "base/numerics/safe_math.h"
-#include "base/stl_util.h"
#include "components/webcrypto/algorithm_implementation.h"
#include "components/webcrypto/algorithms/secret_key_util.h"
#include "components/webcrypto/algorithms/util.h"
@@ -95,12 +94,12 @@ Status SignHmac(const std::vector<uint8_t>& raw_key,
buffer->resize(hmac_expected_length);
crypto::ScopedOpenSSLSafeSizeBuffer<EVP_MAX_MD_SIZE> hmac_result(
- vector_as_array(buffer), hmac_expected_length);
+ buffer->data(), hmac_expected_length);
unsigned int hmac_actual_length;
- unsigned char* const success = HMAC(
- digest_algorithm, vector_as_array(&raw_key), raw_key.size(), data.bytes(),
- data.byte_length(), hmac_result.safe_buffer(), &hmac_actual_length);
+ unsigned char* const success =
+ HMAC(digest_algorithm, raw_key.data(), raw_key.size(), data.bytes(),
+ data.byte_length(), hmac_result.safe_buffer(), &hmac_actual_length);
if (!success || hmac_actual_length != hmac_expected_length)
return Status::OperationError();
@@ -250,10 +249,9 @@ class HmacImplementation : public AlgorithmImplementation {
return status;
// Do not allow verification of truncated MACs.
- *signature_match =
- result.size() == signature.byte_length() &&
- crypto::SecureMemEqual(vector_as_array(&result), signature.bytes(),
- signature.byte_length());
+ *signature_match = result.size() == signature.byte_length() &&
+ crypto::SecureMemEqual(result.data(), signature.bytes(),
+ signature.byte_length());
return Status::Success();
}
« no previous file with comments | « components/webcrypto/algorithms/hkdf.cc ('k') | components/webcrypto/algorithms/hmac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698