| 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 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 void OpenSSLStreamAdapter::SetIdentity(SSLIdentity* identity) { | 284 void OpenSSLStreamAdapter::SetIdentity(SSLIdentity* identity) { |
| 285 ASSERT(!identity_); | 285 ASSERT(!identity_); |
| 286 identity_.reset(static_cast<OpenSSLIdentity*>(identity)); | 286 identity_.reset(static_cast<OpenSSLIdentity*>(identity)); |
| 287 } | 287 } |
| 288 | 288 |
| 289 void OpenSSLStreamAdapter::SetServerRole(SSLRole role) { | 289 void OpenSSLStreamAdapter::SetServerRole(SSLRole role) { |
| 290 role_ = role; | 290 role_ = role; |
| 291 } | 291 } |
| 292 | 292 |
| 293 bool OpenSSLStreamAdapter::GetPeerCertificate(SSLCertificate** cert) const { | 293 rtc::scoped_ptr<SSLCertificate> OpenSSLStreamAdapter::GetPeerCertificate() |
| 294 if (!peer_certificate_) | 294 const { |
| 295 return false; | 295 return peer_certificate_ ? rtc::scoped_ptr<SSLCertificate>( |
| 296 | 296 peer_certificate_->GetReference()) |
| 297 *cert = peer_certificate_->GetReference(); | 297 : nullptr; |
| 298 return true; | |
| 299 } | 298 } |
| 300 | 299 |
| 301 bool OpenSSLStreamAdapter::SetPeerCertificateDigest(const std::string | 300 bool OpenSSLStreamAdapter::SetPeerCertificateDigest(const std::string |
| 302 &digest_alg, | 301 &digest_alg, |
| 303 const unsigned char* | 302 const unsigned char* |
| 304 digest_val, | 303 digest_val, |
| 305 size_t digest_len) { | 304 size_t digest_len) { |
| 306 ASSERT(!peer_certificate_); | 305 ASSERT(!peer_certificate_); |
| 307 ASSERT(peer_certificate_digest_algorithm_.size() == 0); | 306 ASSERT(peer_certificate_digest_algorithm_.size() == 0); |
| 308 ASSERT(ssl_server_name_.empty()); | 307 ASSERT(ssl_server_name_.empty()); |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 return true; | 1185 return true; |
| 1187 } | 1186 } |
| 1188 } | 1187 } |
| 1189 | 1188 |
| 1190 return false; | 1189 return false; |
| 1191 } | 1190 } |
| 1192 | 1191 |
| 1193 } // namespace rtc | 1192 } // namespace rtc |
| 1194 | 1193 |
| 1195 #endif // HAVE_OPENSSL_SSL_H | 1194 #endif // HAVE_OPENSSL_SSL_H |
| OLD | NEW |