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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 size_t data_len, | 80 size_t data_len, |
81 size_t* read, | 81 size_t* read, |
82 int* error) override; | 82 int* error) override; |
83 StreamResult Write(const void* data, | 83 StreamResult Write(const void* data, |
84 size_t data_len, | 84 size_t data_len, |
85 size_t* written, | 85 size_t* written, |
86 int* error) override; | 86 int* error) override; |
87 void Close() override; | 87 void Close() override; |
88 StreamState GetState() const override; | 88 StreamState GetState() const override; |
89 | 89 |
90 #ifndef OPENSSL_IS_BORINGSSL | 90 static const std::string GetRfcSslCipherName(uint16_t cipher); |
davidben_webrtc
2015/09/25 19:23:13
(Ditto on const std::string)
| |
91 // Return the RFC (5246, 3268, etc.) cipher name for an OpenSSL cipher. | |
92 static const char* GetRfcSslCipherName(const SSL_CIPHER* cipher); | |
93 #endif | |
94 | 91 |
95 bool GetSslCipher(std::string* cipher) override; | 92 bool GetSslCipher(uint16_t* cipher) override; |
96 | 93 |
97 // Key Extractor interface | 94 // Key Extractor interface |
98 bool ExportKeyingMaterial(const std::string& label, | 95 bool ExportKeyingMaterial(const std::string& label, |
99 const uint8* context, | 96 const uint8* context, |
100 size_t context_len, | 97 size_t context_len, |
101 bool use_context, | 98 bool use_context, |
102 uint8* result, | 99 uint8* result, |
103 size_t result_len) override; | 100 size_t result_len) override; |
104 | 101 |
105 // DTLS-SRTP interface | 102 // DTLS-SRTP interface |
106 bool SetDtlsSrtpCiphers(const std::vector<std::string>& ciphers) override; | 103 bool SetDtlsSrtpCiphers(const std::vector<std::string>& ciphers) override; |
107 bool GetDtlsSrtpCipher(std::string* cipher) override; | 104 bool GetDtlsSrtpCipher(std::string* cipher) override; |
108 | 105 |
109 // Capabilities interfaces | 106 // Capabilities interfaces |
110 static bool HaveDtls(); | 107 static bool HaveDtls(); |
111 static bool HaveDtlsSrtp(); | 108 static bool HaveDtlsSrtp(); |
112 static bool HaveExporter(); | 109 static bool HaveExporter(); |
113 static std::string GetDefaultSslCipher(SSLProtocolVersion version, | 110 static uint16_t GetDefaultSslCipherForTest(SSLProtocolVersion version, |
114 KeyType key_type); | 111 KeyType key_type); |
115 | 112 |
116 protected: | 113 protected: |
117 void OnEvent(StreamInterface* stream, int events, int err) override; | 114 void OnEvent(StreamInterface* stream, int events, int err) override; |
118 | 115 |
119 private: | 116 private: |
120 enum SSLState { | 117 enum SSLState { |
121 // Before calling one of the StartSSL methods, data flows | 118 // Before calling one of the StartSSL methods, data flows |
122 // in clear text. | 119 // in clear text. |
123 SSL_NONE, | 120 SSL_NONE, |
124 SSL_WAIT, // waiting for the stream to open to start SSL negotiation | 121 SSL_WAIT, // waiting for the stream to open to start SSL negotiation |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 | 203 |
207 // Max. allowed protocol version | 204 // Max. allowed protocol version |
208 SSLProtocolVersion ssl_max_version_; | 205 SSLProtocolVersion ssl_max_version_; |
209 }; | 206 }; |
210 | 207 |
211 ///////////////////////////////////////////////////////////////////////////// | 208 ///////////////////////////////////////////////////////////////////////////// |
212 | 209 |
213 } // namespace rtc | 210 } // namespace rtc |
214 | 211 |
215 #endif // WEBRTC_BASE_OPENSSLSTREAMADAPTER_H__ | 212 #endif // WEBRTC_BASE_OPENSSLSTREAMADAPTER_H__ |
OLD | NEW |