Chromium Code Reviews| Index: remoting/host/remoting_me2me_host.cc |
| diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc |
| index 5e1790075a975f5b2193856d20ea79b364501905..0ce40ef3ed67f086fd77b6a52bc45d79caf0b574 100644 |
| --- a/remoting/host/remoting_me2me_host.cc |
| +++ b/remoting/host/remoting_me2me_host.cc |
| @@ -38,6 +38,8 @@ |
| #include "ui/gfx/gtk_util.h" |
| #endif |
| +using remoting::protocol::SharedSecretHash; |
|
Wez
2012/01/23 23:53:49
nit: Do you really need this? protocol::SharedSecr
Sergey Ulanov
2012/01/24 06:32:22
Done.
|
| + |
| namespace { |
| // This is used for tagging system event logs. |
| @@ -135,6 +137,18 @@ class HostProcess { |
| return false; |
| } |
| + std::string host_secret_hash_string; |
| + if (!host_config->GetString(kHostSecretHashConfigPath, |
| + &host_secret_hash_string)) { |
|
Wez
2012/01/23 23:53:49
nit: Indentation.
Sergey Ulanov
2012/01/24 06:32:22
Done.
|
| + LOG(ERROR) << "host_secret_hash is not defined in the config."; |
| + return false; |
| + } |
| + |
| + if (!host_secret_hash_.Parse(host_secret_hash_string)) { |
| + LOG(ERROR) << "Invalid host_secret_hash."; |
| + return false; |
| + } |
| + |
| // Use an XMPP connection to the Talk network for session signalling. |
| if (!auth_config->GetString(kXmppLoginConfigPath, &xmpp_login_) || |
| !auth_config->GetString(kXmppAuthTokenConfigPath, &xmpp_auth_token_)) { |
| @@ -183,13 +197,10 @@ class HostProcess { |
| host_->Start(); |
| // Create authenticator factory. |
| - // |
| - // TODO(sergeyu): Currently empty PIN is used. This is a temporary |
| - // hack pending us adding a way to set a PIN. crbug.com/105214 . |
| scoped_ptr<protocol::AuthenticatorFactory> factory( |
| new protocol::Me2MeHostAuthenticatorFactory( |
| xmpp_login_, key_pair_.GenerateCertificate(), |
| - *key_pair_.private_key(), "")); |
| + *key_pair_.private_key(), host_secret_hash_)); |
| host_->SetAuthenticatorFactory(factory.Pass()); |
| } |
| @@ -203,6 +214,7 @@ class HostProcess { |
| std::string host_id_; |
| HostKeyPair key_pair_; |
| + SharedSecretHash host_secret_hash_; |
| std::string xmpp_login_; |
| std::string xmpp_auth_token_; |
| std::string xmpp_auth_service_; |