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

Side by Side Diff: remoting/host/heartbeat_sender.cc

Issue 1130253004: Normalize JIDs when generating signatures for messages sent to CRD bot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2357
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | remoting/host/heartbeat_sender_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/stringize_macros.h" 12 #include "base/strings/stringize_macros.h"
13 #include "base/thread_task_runner_handle.h" 13 #include "base/thread_task_runner_handle.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "remoting/base/constants.h" 15 #include "remoting/base/constants.h"
16 #include "remoting/base/logging.h" 16 #include "remoting/base/logging.h"
17 #include "remoting/host/server_log_entry_host.h" 17 #include "remoting/host/server_log_entry_host.h"
18 #include "remoting/signaling/iq_sender.h" 18 #include "remoting/signaling/iq_sender.h"
19 #include "remoting/signaling/jid_util.h"
19 #include "remoting/signaling/server_log_entry.h" 20 #include "remoting/signaling/server_log_entry.h"
20 #include "remoting/signaling/signal_strategy.h" 21 #include "remoting/signaling/signal_strategy.h"
21 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" 22 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h"
22 #include "third_party/webrtc/libjingle/xmpp/constants.h" 23 #include "third_party/webrtc/libjingle/xmpp/constants.h"
23 24
24 using buzz::QName; 25 using buzz::QName;
25 using buzz::XmlElement; 26 using buzz::XmlElement;
26 27
27 namespace remoting { 28 namespace remoting {
28 29
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 AddHostFieldsToLogEntry(log_entry.get()); 327 AddHostFieldsToLogEntry(log_entry.get());
327 log->AddElement(log_entry->ToStanza().release()); 328 log->AddElement(log_entry->ToStanza().release());
328 heartbeat->AddElement(log.release()); 329 heartbeat->AddElement(log.release());
329 return heartbeat.Pass(); 330 return heartbeat.Pass();
330 } 331 }
331 332
332 scoped_ptr<XmlElement> HeartbeatSender::CreateSignature() { 333 scoped_ptr<XmlElement> HeartbeatSender::CreateSignature() {
333 scoped_ptr<XmlElement> signature_tag(new XmlElement( 334 scoped_ptr<XmlElement> signature_tag(new XmlElement(
334 QName(kChromotingXmlNamespace, kHeartbeatSignatureTag))); 335 QName(kChromotingXmlNamespace, kHeartbeatSignatureTag)));
335 336
336 std::string message = signal_strategy_->GetLocalJid() + ' ' + 337 std::string message = NormalizeJid(signal_strategy_->GetLocalJid()) + ' ' +
337 base::IntToString(sequence_id_); 338 base::IntToString(sequence_id_);
338 std::string signature(host_key_pair_->SignMessage(message)); 339 std::string signature(host_key_pair_->SignMessage(message));
339 signature_tag->AddText(signature); 340 signature_tag->AddText(signature);
340 341
341 return signature_tag.Pass(); 342 return signature_tag.Pass();
342 } 343 }
343 344
344 } // namespace remoting 345 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/heartbeat_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698