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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 void OpenSSLStreamAdapter::SetIdentity(SSLIdentity* identity) { | 199 void OpenSSLStreamAdapter::SetIdentity(SSLIdentity* identity) { |
200 ASSERT(!identity_); | 200 ASSERT(!identity_); |
201 identity_.reset(static_cast<OpenSSLIdentity*>(identity)); | 201 identity_.reset(static_cast<OpenSSLIdentity*>(identity)); |
202 } | 202 } |
203 | 203 |
204 void OpenSSLStreamAdapter::SetServerRole(SSLRole role) { | 204 void OpenSSLStreamAdapter::SetServerRole(SSLRole role) { |
205 role_ = role; | 205 role_ = role; |
206 } | 206 } |
207 | 207 |
208 bool OpenSSLStreamAdapter::GetPeerCertificate(SSLCertificate** cert) const { | 208 rtc::scoped_ptr<SSLCertificate> OpenSSLStreamAdapter::GetPeerCertificate() |
209 if (!peer_certificate_) | 209 const { |
210 return false; | 210 return peer_certificate_ ? rtc::scoped_ptr<SSLCertificate>( |
211 | 211 peer_certificate_->GetReference()) |
212 *cert = peer_certificate_->GetReference(); | 212 : nullptr; |
213 return true; | |
214 } | 213 } |
215 | 214 |
216 bool OpenSSLStreamAdapter::SetPeerCertificateDigest(const std::string | 215 bool OpenSSLStreamAdapter::SetPeerCertificateDigest(const std::string |
217 &digest_alg, | 216 &digest_alg, |
218 const unsigned char* | 217 const unsigned char* |
219 digest_val, | 218 digest_val, |
220 size_t digest_len) { | 219 size_t digest_len) { |
221 ASSERT(!peer_certificate_); | 220 ASSERT(!peer_certificate_); |
222 ASSERT(peer_certificate_digest_algorithm_.size() == 0); | 221 ASSERT(peer_certificate_digest_algorithm_.size() == 0); |
223 ASSERT(ssl_server_name_.empty()); | 222 ASSERT(ssl_server_name_.empty()); |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 return true; | 997 return true; |
999 } | 998 } |
1000 } | 999 } |
1001 | 1000 |
1002 return false; | 1001 return false; |
1003 } | 1002 } |
1004 | 1003 |
1005 } // namespace rtc | 1004 } // namespace rtc |
1006 | 1005 |
1007 #endif // HAVE_OPENSSL_SSL_H | 1006 #endif // HAVE_OPENSSL_SSL_H |
OLD | NEW |