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

Side by Side Diff: remoting/protocol/spake2_authenticator.cc

Issue 2443903004: Add xmllite and xmpp sources to third_party/ (Closed)
Patch Set: Explicitly use webrtc_overrides/webrtc/base/logging.h Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/protocol/spake2_authenticator.h" 5 #include "remoting/protocol/spake2_authenticator.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/sys_byteorder.h" 12 #include "base/sys_byteorder.h"
13 #include "crypto/hmac.h" 13 #include "crypto/hmac.h"
14 #include "crypto/secure_util.h" 14 #include "crypto/secure_util.h"
15 #include "remoting/base/constants.h" 15 #include "remoting/base/constants.h"
16 #include "remoting/base/rsa_key_pair.h" 16 #include "remoting/base/rsa_key_pair.h"
17 #include "remoting/protocol/ssl_hmac_channel_authenticator.h" 17 #include "remoting/protocol/ssl_hmac_channel_authenticator.h"
18 #include "third_party/boringssl/src/include/openssl/curve25519.h" 18 #include "third_party/boringssl/src/include/openssl/curve25519.h"
19 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" 19 #include "third_party/libjingle_xmpp/xmllite/xmlelement.h"
20 20
21 namespace remoting { 21 namespace remoting {
22 namespace protocol { 22 namespace protocol {
23 23
24 namespace { 24 namespace {
25 25
26 // Each peer sends 2 messages: <spake-message> and <verification-hash>. The 26 // Each peer sends 2 messages: <spake-message> and <verification-hash>. The
27 // content of <spake-message> is the output of SPAKE2_generate_msg() and must 27 // content of <spake-message> is the output of SPAKE2_generate_msg() and must
28 // be passed to SPAKE2_process_msg() on the other end. This is enough to 28 // be passed to SPAKE2_process_msg() on the other end. This is enough to
29 // generate authentication key. <verification-hash> is sent to confirm that both 29 // generate authentication key. <verification-hash> is sent to confirm that both
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 if (!hmac.Init(auth_key_) || 309 if (!hmac.Init(auth_key_) ||
310 !hmac.Sign(message, reinterpret_cast<uint8_t*>(&result[0]), 310 !hmac.Sign(message, reinterpret_cast<uint8_t*>(&result[0]),
311 result.length())) { 311 result.length())) {
312 LOG(FATAL) << "Failed to calculate HMAC."; 312 LOG(FATAL) << "Failed to calculate HMAC.";
313 } 313 }
314 return result; 314 return result;
315 } 315 }
316 316
317 } // namespace protocol 317 } // namespace protocol
318 } // namespace remoting 318 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/rejecting_authenticator.cc ('k') | remoting/protocol/spake2_authenticator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698