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

Unified Diff: content/child/webcrypto/nss/hmac_nss.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/nss/aes_gcm_nss.cc ('k') | content/child/webcrypto/nss/rsa_oaep_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/nss/hmac_nss.cc
diff --git a/content/child/webcrypto/nss/hmac_nss.cc b/content/child/webcrypto/nss/hmac_nss.cc
index b8a8c0e91e3687dde237d18a4dcdbe0812bdca5d..f02be408d7f8064b09bafd3b843e9ea02226245d 100644
--- a/content/child/webcrypto/nss/hmac_nss.cc
+++ b/content/child/webcrypto/nss/hmac_nss.cc
@@ -8,6 +8,7 @@
#include <sechash.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"
@@ -191,7 +192,7 @@ class HmacImplementation : public AlgorithmImplementation {
DCHECK_NE(0u, signature_item.len);
buffer->resize(signature_item.len);
- signature_item.data = Uint8VectorStart(buffer);
+ signature_item.data = vector_as_array(buffer);
if (PK11_SignWithSymKey(
sym_key, mechanism, &param_item, &signature_item, &data_item) !=
@@ -216,7 +217,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/nss/aes_gcm_nss.cc ('k') | content/child/webcrypto/nss/rsa_oaep_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698