| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_AUTH_UTIL_H_ | 5 #ifndef REMOTING_PROTOCOL_AUTH_UTIL_H_ |
| 6 #define REMOTING_PROTOCOL_AUTH_UTIL_H_ | 6 #define REMOTING_PROTOCOL_AUTH_UTIL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // Fake hostname used for SSL connections. | 25 // Fake hostname used for SSL connections. |
| 26 extern const char kSslFakeHostName[]; | 26 extern const char kSslFakeHostName[]; |
| 27 | 27 |
| 28 // Size of the HMAC-SHA-256 hash used as shared secret in SPAKE2. | 28 // Size of the HMAC-SHA-256 hash used as shared secret in SPAKE2. |
| 29 const size_t kSharedSecretHashLength = 32; | 29 const size_t kSharedSecretHashLength = 32; |
| 30 | 30 |
| 31 // Size of the HMAC-SHA-256 digest used for channel authentication. | 31 // Size of the HMAC-SHA-256 digest used for channel authentication. |
| 32 const size_t kAuthDigestLength = 32; | 32 const size_t kAuthDigestLength = 32; |
| 33 | 33 |
| 34 // TODO(sergeyu): The following two methods are used for V1 | 34 // Returns HMAC-SHA-256 hash for |shared_secret| with the specified |tag|. |
| 35 // authentication. Remove them when we finally switch to V2 | 35 std::string GetSharedSecretHash(const std::string& tag, |
| 36 // authentication method. crbug.com/110483 . | 36 const std::string& shared_secret); |
| 37 | |
| 38 // Generates auth token for the specified |jid| and |access_code|. | |
| 39 std::string GenerateSupportAuthToken(const std::string& jid, | |
| 40 const std::string& access_code); | |
| 41 | |
| 42 // Verifies validity of an |access_token|. | |
| 43 bool VerifySupportAuthToken(const std::string& jid, | |
| 44 const std::string& access_code, | |
| 45 const std::string& auth_token); | |
| 46 | 37 |
| 47 // Returns authentication bytes that must be used for the given | 38 // Returns authentication bytes that must be used for the given |
| 48 // |socket|. Empty string is returned in case of failure. | 39 // |socket|. Empty string is returned in case of failure. |
| 49 std::string GetAuthBytes(net::SSLSocket* socket, | 40 std::string GetAuthBytes(net::SSLSocket* socket, |
| 50 const base::StringPiece& label, | 41 const base::StringPiece& label, |
| 51 const base::StringPiece& shared_secret); | 42 const base::StringPiece& shared_secret); |
| 52 | 43 |
| 53 } // namespace protocol | 44 } // namespace protocol |
| 54 } // namespace remoting | 45 } // namespace remoting |
| 55 | 46 |
| 56 #endif // REMOTING_PROTOCOL_AUTH_UTIL_H_ | 47 #endif // REMOTING_PROTOCOL_AUTH_UTIL_H_ |
| OLD | NEW |