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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 crypto_suite == CS_AEAD_AES_128_GCM); | 88 crypto_suite == CS_AEAD_AES_128_GCM); |
89 } | 89 } |
90 | 90 |
91 // static | 91 // static |
92 CryptoOptions CryptoOptions::NoGcm() { | 92 CryptoOptions CryptoOptions::NoGcm() { |
93 CryptoOptions options; | 93 CryptoOptions options; |
94 options.enable_gcm_crypto_suites = false; | 94 options.enable_gcm_crypto_suites = false; |
95 return options; | 95 return options; |
96 } | 96 } |
97 | 97 |
| 98 void GetDefaultSrtpCryptoSuites(const rtc::CryptoOptions& crypto_options, |
| 99 std::vector<int>* crypto_suites) { |
| 100 if (crypto_options.enable_gcm_crypto_suites) { |
| 101 crypto_suites->push_back(rtc::SRTP_AEAD_AES_256_GCM); |
| 102 crypto_suites->push_back(rtc::SRTP_AEAD_AES_128_GCM); |
| 103 } |
| 104 crypto_suites->push_back(rtc::SRTP_AES128_CM_SHA1_80); |
| 105 } |
| 106 |
98 SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) { | 107 SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) { |
99 return new OpenSSLStreamAdapter(stream); | 108 return new OpenSSLStreamAdapter(stream); |
100 } | 109 } |
101 | 110 |
102 SSLStreamAdapter::SSLStreamAdapter(StreamInterface* stream) | 111 SSLStreamAdapter::SSLStreamAdapter(StreamInterface* stream) |
103 : StreamAdapterInterface(stream), | 112 : StreamAdapterInterface(stream), |
104 ignore_bad_cert_(false), | 113 ignore_bad_cert_(false), |
105 client_auth_enabled_(true) {} | 114 client_auth_enabled_(true) {} |
106 | 115 |
107 SSLStreamAdapter::~SSLStreamAdapter() {} | 116 SSLStreamAdapter::~SSLStreamAdapter() {} |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 std::string SSLStreamAdapter::SslCipherSuiteToName(int cipher_suite) { | 150 std::string SSLStreamAdapter::SslCipherSuiteToName(int cipher_suite) { |
142 return OpenSSLStreamAdapter::SslCipherSuiteToName(cipher_suite); | 151 return OpenSSLStreamAdapter::SslCipherSuiteToName(cipher_suite); |
143 } | 152 } |
144 void SSLStreamAdapter::enable_time_callback_for_testing() { | 153 void SSLStreamAdapter::enable_time_callback_for_testing() { |
145 OpenSSLStreamAdapter::enable_time_callback_for_testing(); | 154 OpenSSLStreamAdapter::enable_time_callback_for_testing(); |
146 } | 155 } |
147 | 156 |
148 /////////////////////////////////////////////////////////////////////////////// | 157 /////////////////////////////////////////////////////////////////////////////// |
149 | 158 |
150 } // namespace rtc | 159 } // namespace rtc |
OLD | NEW |