Commit d7f843fd authored by Eric Roman's avatar Eric Roman Committed by Commit Bot

Make use of new hex decoding functions for prefs code.

Bug: 1021236
Change-Id: I965d036f6021ea308bca56eebde229fd4de9aaf3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900548
Auto-Submit: Eric Roman <eroman@chromium.org>
Reviewed-by: default avatarproberge <proberge@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713588}
parent c284eb1c
...@@ -37,11 +37,9 @@ bool VerifyDigestString(const std::string& key, ...@@ -37,11 +37,9 @@ bool VerifyDigestString(const std::string& key,
const std::string& message, const std::string& message,
const std::string& digest_string) { const std::string& digest_string) {
crypto::HMAC hmac(crypto::HMAC::SHA256); crypto::HMAC hmac(crypto::HMAC::SHA256);
std::vector<uint8_t> digest; std::string digest;
return base::HexStringToBytes(digest_string, &digest) && hmac.Init(key) && return base::HexStringToString(digest_string, &digest) && hmac.Init(key) &&
hmac.Verify(message, hmac.Verify(message, digest);
base::StringPiece(reinterpret_cast<char*>(&digest[0]),
digest.size()));
} }
// Renders |value| as a string. |value| may be NULL, in which case the result // Renders |value| as a string. |value| may be NULL, in which case the result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment