You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.7 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Copyright 2019 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #include "api/dtls_transport_interface.h"
  11. namespace webrtc {
  12. DtlsTransportInformation::DtlsTransportInformation()
  13. : state_(DtlsTransportState::kNew) {}
  14. DtlsTransportInformation::DtlsTransportInformation(DtlsTransportState state)
  15. : state_(state) {}
  16. DtlsTransportInformation::DtlsTransportInformation(
  17. DtlsTransportState state,
  18. absl::optional<int> ssl_cipher_suite,
  19. std::unique_ptr<rtc::SSLCertChain> remote_ssl_certificates)
  20. : state_(state),
  21. ssl_cipher_suite_(ssl_cipher_suite),
  22. remote_ssl_certificates_(std::move(remote_ssl_certificates)) {}
  23. DtlsTransportInformation::DtlsTransportInformation(
  24. const DtlsTransportInformation& c)
  25. : state_(c.state()),
  26. ssl_cipher_suite_(c.ssl_cipher_suite_),
  27. remote_ssl_certificates_(c.remote_ssl_certificates()
  28. ? c.remote_ssl_certificates()->Clone()
  29. : nullptr) {}
  30. DtlsTransportInformation& DtlsTransportInformation::operator=(
  31. const DtlsTransportInformation& c) {
  32. state_ = c.state();
  33. ssl_cipher_suite_ = c.ssl_cipher_suite_;
  34. remote_ssl_certificates_ = c.remote_ssl_certificates()
  35. ? c.remote_ssl_certificates()->Clone()
  36. : nullptr;
  37. return *this;
  38. }
  39. } // namespace webrtc