| 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/protocol/ssl_hmac_channel_authenticator.h" | 5 #include "remoting/protocol/ssl_hmac_channel_authenticator.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 namespace protocol { | 43 namespace protocol { |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 | 46 |
| 47 // A CertVerifier which rejects every certificate. | 47 // A CertVerifier which rejects every certificate. |
| 48 class FailingCertVerifier : public net::CertVerifier { | 48 class FailingCertVerifier : public net::CertVerifier { |
| 49 public: | 49 public: |
| 50 FailingCertVerifier() {} | 50 FailingCertVerifier() {} |
| 51 ~FailingCertVerifier() override {} | 51 ~FailingCertVerifier() override {} |
| 52 | 52 |
| 53 int Verify(net::X509Certificate* cert, | 53 int Verify(const net::CertVerifier::RequestParams& params, |
| 54 const std::string& hostname, | |
| 55 const std::string& ocsp_response, | |
| 56 int flags, | |
| 57 net::CRLSet* crl_set, | 54 net::CRLSet* crl_set, |
| 58 net::CertVerifyResult* verify_result, | 55 net::CertVerifyResult* verify_result, |
| 59 const net::CompletionCallback& callback, | 56 const net::CompletionCallback& callback, |
| 60 std::unique_ptr<Request>* out_req, | 57 std::unique_ptr<Request>* out_req, |
| 61 const net::BoundNetLog& net_log) override { | 58 const net::BoundNetLog& net_log) override { |
| 62 verify_result->verified_cert = cert; | 59 verify_result->verified_cert = params.certificate(); |
| 63 verify_result->cert_status = net::CERT_STATUS_INVALID; | 60 verify_result->cert_status = net::CERT_STATUS_INVALID; |
| 64 return net::ERR_CERT_INVALID; | 61 return net::ERR_CERT_INVALID; |
| 65 } | 62 } |
| 66 }; | 63 }; |
| 67 | 64 |
| 68 // Implements net::StreamSocket interface on top of P2PStreamSocket to be passed | 65 // Implements net::StreamSocket interface on top of P2PStreamSocket to be passed |
| 69 // to net::SSLClientSocket and net::SSLServerSocket. | 66 // to net::SSLClientSocket and net::SSLServerSocket. |
| 70 class NetStreamSocketAdapter : public net::StreamSocket { | 67 class NetStreamSocketAdapter : public net::StreamSocket { |
| 71 public: | 68 public: |
| 72 NetStreamSocketAdapter(std::unique_ptr<P2PStreamSocket> socket) | 69 NetStreamSocketAdapter(std::unique_ptr<P2PStreamSocket> socket) |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 std::move(socket_), std::move(server_context_)))); | 434 std::move(socket_), std::move(server_context_)))); |
| 438 } | 435 } |
| 439 } | 436 } |
| 440 | 437 |
| 441 void SslHmacChannelAuthenticator::NotifyError(int error) { | 438 void SslHmacChannelAuthenticator::NotifyError(int error) { |
| 442 base::ResetAndReturn(&done_callback_).Run(error, nullptr); | 439 base::ResetAndReturn(&done_callback_).Run(error, nullptr); |
| 443 } | 440 } |
| 444 | 441 |
| 445 } // namespace protocol | 442 } // namespace protocol |
| 446 } // namespace remoting | 443 } // namespace remoting |
| OLD | NEW |