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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 case SSL_CONNECTING: | 69 case SSL_CONNECTING: |
70 return SS_OPENING; | 70 return SS_OPENING; |
71 case SSL_CONNECTED: | 71 case SSL_CONNECTED: |
72 return SS_OPEN; | 72 return SS_OPEN; |
73 default: | 73 default: |
74 return SS_CLOSED; | 74 return SS_CLOSED; |
75 }; | 75 }; |
76 // not reached | 76 // not reached |
77 } | 77 } |
78 | 78 |
79 bool SSLStreamAdapterHelper::GetPeerCertificate(SSLCertificate** cert) const { | 79 rtc::scoped_ptr<SSLCertificate> SSLStreamAdapterHelper::GetPeerCertificate() |
80 if (!peer_certificate_) | 80 const { |
81 return false; | 81 return peer_certificate_ ? rtc::scoped_ptr<SSLCertificate>( |
82 | 82 peer_certificate_->GetReference()) |
83 *cert = peer_certificate_->GetReference(); | 83 : nullptr; |
84 return true; | |
85 } | 84 } |
86 | 85 |
87 bool SSLStreamAdapterHelper::SetPeerCertificateDigest( | 86 bool SSLStreamAdapterHelper::SetPeerCertificateDigest( |
88 const std::string &digest_alg, | 87 const std::string &digest_alg, |
89 const unsigned char* digest_val, | 88 const unsigned char* digest_val, |
90 size_t digest_len) { | 89 size_t digest_len) { |
91 ASSERT(peer_certificate_.get() == NULL); | 90 ASSERT(peer_certificate_.get() == NULL); |
92 ASSERT(peer_certificate_digest_algorithm_.empty()); | 91 ASSERT(peer_certificate_digest_algorithm_.empty()); |
93 ASSERT(ssl_server_name_.empty()); | 92 ASSERT(ssl_server_name_.empty()); |
94 size_t expected_len; | 93 size_t expected_len; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 if (err) { | 134 if (err) { |
136 Error("BeginSSL", err, false); | 135 Error("BeginSSL", err, false); |
137 return err; | 136 return err; |
138 } | 137 } |
139 | 138 |
140 return 0; | 139 return 0; |
141 } | 140 } |
142 | 141 |
143 } // namespace rtc | 142 } // namespace rtc |
144 | 143 |
OLD | NEW |