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

Unified Diff: remoting/host/pin_hash.h

Issue 1755273003: Simplify AuthenticationMethod type and PIN hash handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
Index: remoting/host/pin_hash.h
diff --git a/remoting/host/pin_hash.h b/remoting/host/pin_hash.h
index 033ac4a4cc1d720dd643ba45a40654b7603c596c..f1e725a887665ff40aa0bb46d98bbc62f985de36 100644
--- a/remoting/host/pin_hash.h
+++ b/remoting/host/pin_hash.h
@@ -13,6 +13,14 @@ namespace remoting {
// hashed host ID and PIN.
std::string MakeHostPinHash(const std::string& host_id, const std::string& pin);
+// Parse string representation of a shared secret hash. The value can be either
+// "plain:<pin_in_base64>" or "hmac:<pin_hmac_in_base64>". In the first case the
+// returned value is automatically hashed. False is returned if |value| is in
+// invalid format.
+bool ParsePinHashFromConfig(const std::string& value,
+ const std::string& host_id,
+ std::string* pin_hash_out);
+
// Extracts the hash function from the given hash, uses it to calculate the
// hash of the given host ID and PIN, and compares that hash to the given hash.
// Returns true if the calculated and given hashes are equal.

Powered by Google App Engine
This is Rietveld 408576698