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