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 #include "remoting/host/heartbeat_sender.h" | 5 #include "remoting/host/heartbeat_sender.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 QName(kChromotingXmlNamespace, kHostOperatingSystemVersionTag))); | 335 QName(kChromotingXmlNamespace, kHostOperatingSystemVersionTag))); |
336 os_version_tag->AddText(GetHostOperatingSystemVersion()); | 336 os_version_tag->AddText(GetHostOperatingSystemVersion()); |
337 heartbeat->AddElement(os_version_tag.release()); | 337 heartbeat->AddElement(os_version_tag.release()); |
338 } | 338 } |
339 // Append log message (which isn't signed). | 339 // Append log message (which isn't signed). |
340 scoped_ptr<XmlElement> log(ServerLogEntry::MakeStanza()); | 340 scoped_ptr<XmlElement> log(ServerLogEntry::MakeStanza()); |
341 scoped_ptr<ServerLogEntry> log_entry(MakeLogEntryForHeartbeat()); | 341 scoped_ptr<ServerLogEntry> log_entry(MakeLogEntryForHeartbeat()); |
342 AddHostFieldsToLogEntry(log_entry.get()); | 342 AddHostFieldsToLogEntry(log_entry.get()); |
343 log->AddElement(log_entry->ToStanza().release()); | 343 log->AddElement(log_entry->ToStanza().release()); |
344 heartbeat->AddElement(log.release()); | 344 heartbeat->AddElement(log.release()); |
345 return heartbeat.Pass(); | 345 return heartbeat; |
346 } | 346 } |
347 | 347 |
348 scoped_ptr<XmlElement> HeartbeatSender::CreateSignature() { | 348 scoped_ptr<XmlElement> HeartbeatSender::CreateSignature() { |
349 scoped_ptr<XmlElement> signature_tag(new XmlElement( | 349 scoped_ptr<XmlElement> signature_tag(new XmlElement( |
350 QName(kChromotingXmlNamespace, kHeartbeatSignatureTag))); | 350 QName(kChromotingXmlNamespace, kHeartbeatSignatureTag))); |
351 | 351 |
352 std::string message = NormalizeJid(signal_strategy_->GetLocalJid()) + ' ' + | 352 std::string message = NormalizeJid(signal_strategy_->GetLocalJid()) + ' ' + |
353 base::IntToString(sequence_id_); | 353 base::IntToString(sequence_id_); |
354 std::string signature(host_key_pair_->SignMessage(message)); | 354 std::string signature(host_key_pair_->SignMessage(message)); |
355 signature_tag->AddText(signature); | 355 signature_tag->AddText(signature); |
356 | 356 |
357 return signature_tag.Pass(); | 357 return signature_tag; |
358 } | 358 } |
359 | 359 |
360 } // namespace remoting | 360 } // namespace remoting |
OLD | NEW |