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 #ifndef WEBRTC_BASE_SSLSTREAMADAPTER_H_ | 11 #ifndef WEBRTC_BASE_SSLSTREAMADAPTER_H_ |
12 #define WEBRTC_BASE_SSLSTREAMADAPTER_H_ | 12 #define WEBRTC_BASE_SSLSTREAMADAPTER_H_ |
13 | 13 |
| 14 #include <memory> |
14 #include <string> | 15 #include <string> |
15 #include <vector> | 16 #include <vector> |
16 | 17 |
17 #include "webrtc/base/stream.h" | 18 #include "webrtc/base/stream.h" |
18 #include "webrtc/base/sslidentity.h" | 19 #include "webrtc/base/sslidentity.h" |
19 | 20 |
20 namespace rtc { | 21 namespace rtc { |
21 | 22 |
22 // Constants for SSL profile. | 23 // Constants for SSL profile. |
23 const int TLS_NULL_WITH_NULL_NULL = 0; | 24 const int TLS_NULL_WITH_NULL_NULL = 0; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // channel). Unlike SetPeerCertificate(), this must specify the | 153 // channel). Unlike SetPeerCertificate(), this must specify the |
153 // terminal certificate, not just a CA. | 154 // terminal certificate, not just a CA. |
154 // SSLStream makes a copy of the digest value. | 155 // SSLStream makes a copy of the digest value. |
155 virtual bool SetPeerCertificateDigest(const std::string& digest_alg, | 156 virtual bool SetPeerCertificateDigest(const std::string& digest_alg, |
156 const unsigned char* digest_val, | 157 const unsigned char* digest_val, |
157 size_t digest_len) = 0; | 158 size_t digest_len) = 0; |
158 | 159 |
159 // Retrieves the peer's X.509 certificate, if a connection has been | 160 // Retrieves the peer's X.509 certificate, if a connection has been |
160 // established. It returns the transmitted over SSL, including the entire | 161 // established. It returns the transmitted over SSL, including the entire |
161 // chain. | 162 // chain. |
162 virtual rtc::scoped_ptr<SSLCertificate> GetPeerCertificate() const = 0; | 163 virtual std::unique_ptr<SSLCertificate> GetPeerCertificate() const = 0; |
163 | 164 |
164 // Retrieves the IANA registration id of the cipher suite used for the | 165 // Retrieves the IANA registration id of the cipher suite used for the |
165 // connection (e.g. 0x2F for "TLS_RSA_WITH_AES_128_CBC_SHA"). | 166 // connection (e.g. 0x2F for "TLS_RSA_WITH_AES_128_CBC_SHA"). |
166 virtual bool GetSslCipherSuite(int* cipher_suite); | 167 virtual bool GetSslCipherSuite(int* cipher_suite); |
167 | 168 |
168 virtual int GetSslVersion() const = 0; | 169 virtual int GetSslVersion() const = 0; |
169 | 170 |
170 // Key Exporter interface from RFC 5705 | 171 // Key Exporter interface from RFC 5705 |
171 // Arguments are: | 172 // Arguments are: |
172 // label -- the exporter label. | 173 // label -- the exporter label. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 214 |
214 // If true (default), the client is required to provide a certificate during | 215 // If true (default), the client is required to provide a certificate during |
215 // handshake. If no certificate is given, handshake fails. This applies to | 216 // handshake. If no certificate is given, handshake fails. This applies to |
216 // server mode only. | 217 // server mode only. |
217 bool client_auth_enabled_; | 218 bool client_auth_enabled_; |
218 }; | 219 }; |
219 | 220 |
220 } // namespace rtc | 221 } // namespace rtc |
221 | 222 |
222 #endif // WEBRTC_BASE_SSLSTREAMADAPTER_H_ | 223 #endif // WEBRTC_BASE_SSLSTREAMADAPTER_H_ |
OLD | NEW |