Chromium Code Reviews| Index: remoting/host/pin_hash.h |
| diff --git a/remoting/host/pin_hash.h b/remoting/host/pin_hash.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..525b34b7d6aee0ff385a6d229b0a800d44c17d53 |
| --- /dev/null |
| +++ b/remoting/host/pin_hash.h |
| @@ -0,0 +1,25 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef REMOTING_HOST_PIN_HASH_H_ |
| +#define REMOTING_HOST_PIN_HASH_H_ |
| + |
| +#include <string> |
| + |
| +namespace remoting { |
| + |
| +// Hashes a host ID and a PIN. |
| +// A Me2Me host uses this to hash a shared secret. |
|
Wez
2012/05/01 01:02:36
nit: Suggest "Create a Me2Me shared-secret hash, c
simonmorris
2012/05/01 01:11:55
Done.
|
| +std::string MakeHostPinHash(const std::string& host_id, const std::string& pin); |
| + |
| +// 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. |
| +bool VerifyHostPinHash(const std::string& hash, |
| + const std::string& host_id, |
| + const std::string& pin); |
| + |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_HOST_PIN_HASH_ |