| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #if HAVE_OPENSSL_SSL_H | 11 #if HAVE_OPENSSL_SSL_H |
| 12 | 12 |
| 13 #include "webrtc/base/opensslstreamadapter.h" | 13 #include "webrtc/base/opensslstreamadapter.h" |
| 14 | 14 |
| 15 #include <openssl/bio.h> | 15 #include <openssl/bio.h> |
| 16 #include <openssl/crypto.h> | 16 #include <openssl/crypto.h> |
| 17 #include <openssl/err.h> | 17 #include <openssl/err.h> |
| 18 #include <openssl/rand.h> | 18 #include <openssl/rand.h> |
| 19 #include <openssl/tls1.h> | 19 #include <openssl/tls1.h> |
| 20 #include <openssl/x509v3.h> | 20 #include <openssl/x509v3.h> |
| 21 #ifndef OPENSSL_IS_BORINGSSL | 21 #ifndef OPENSSL_IS_BORINGSSL |
| 22 #include <openssl/dtls1.h> | 22 #include <openssl/dtls1.h> |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 #include <memory> |
| 25 #include <vector> | 26 #include <vector> |
| 26 | 27 |
| 27 #include "webrtc/base/common.h" | 28 #include "webrtc/base/common.h" |
| 28 #include "webrtc/base/logging.h" | 29 #include "webrtc/base/logging.h" |
| 29 #include "webrtc/base/safe_conversions.h" | 30 #include "webrtc/base/safe_conversions.h" |
| 30 #include "webrtc/base/stream.h" | 31 #include "webrtc/base/stream.h" |
| 31 #include "webrtc/base/openssl.h" | 32 #include "webrtc/base/openssl.h" |
| 32 #include "webrtc/base/openssladapter.h" | 33 #include "webrtc/base/openssladapter.h" |
| 33 #include "webrtc/base/openssldigest.h" | 34 #include "webrtc/base/openssldigest.h" |
| 34 #include "webrtc/base/opensslidentity.h" | 35 #include "webrtc/base/opensslidentity.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 287 |
| 287 void OpenSSLStreamAdapter::SetIdentity(SSLIdentity* identity) { | 288 void OpenSSLStreamAdapter::SetIdentity(SSLIdentity* identity) { |
| 288 ASSERT(!identity_); | 289 ASSERT(!identity_); |
| 289 identity_.reset(static_cast<OpenSSLIdentity*>(identity)); | 290 identity_.reset(static_cast<OpenSSLIdentity*>(identity)); |
| 290 } | 291 } |
| 291 | 292 |
| 292 void OpenSSLStreamAdapter::SetServerRole(SSLRole role) { | 293 void OpenSSLStreamAdapter::SetServerRole(SSLRole role) { |
| 293 role_ = role; | 294 role_ = role; |
| 294 } | 295 } |
| 295 | 296 |
| 296 rtc::scoped_ptr<SSLCertificate> OpenSSLStreamAdapter::GetPeerCertificate() | 297 std::unique_ptr<SSLCertificate> OpenSSLStreamAdapter::GetPeerCertificate() |
| 297 const { | 298 const { |
| 298 return peer_certificate_ ? rtc::scoped_ptr<SSLCertificate>( | 299 return peer_certificate_ ? std::unique_ptr<SSLCertificate>( |
| 299 peer_certificate_->GetReference()) | 300 peer_certificate_->GetReference()) |
| 300 : nullptr; | 301 : nullptr; |
| 301 } | 302 } |
| 302 | 303 |
| 303 bool OpenSSLStreamAdapter::SetPeerCertificateDigest(const std::string | 304 bool OpenSSLStreamAdapter::SetPeerCertificateDigest(const std::string |
| 304 &digest_alg, | 305 &digest_alg, |
| 305 const unsigned char* | 306 const unsigned char* |
| 306 digest_val, | 307 digest_val, |
| 307 size_t digest_len) { | 308 size_t digest_len) { |
| 308 ASSERT(!peer_certificate_); | 309 ASSERT(!peer_certificate_); |
| (...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 return true; | 1193 return true; |
| 1193 } | 1194 } |
| 1194 } | 1195 } |
| 1195 | 1196 |
| 1196 return false; | 1197 return false; |
| 1197 } | 1198 } |
| 1198 | 1199 |
| 1199 } // namespace rtc | 1200 } // namespace rtc |
| 1200 | 1201 |
| 1201 #endif // HAVE_OPENSSL_SSL_H | 1202 #endif // HAVE_OPENSSL_SSL_H |
| OLD | NEW |