Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: webrtc/base/sslstreamadapter.h

Issue 2815513012: Negotiate the same SRTP crypto suites for every DTLS association formed. (Closed)
Patch Set: Merge with master Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/base/sslstreamadapter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 #ifndef SRTP_AES128_CM_SHA1_32 31 #ifndef SRTP_AES128_CM_SHA1_32
32 const int SRTP_AES128_CM_SHA1_32 = 0x0002; 32 const int SRTP_AES128_CM_SHA1_32 = 0x0002;
33 #endif 33 #endif
34 #ifndef SRTP_AEAD_AES_128_GCM 34 #ifndef SRTP_AEAD_AES_128_GCM
35 const int SRTP_AEAD_AES_128_GCM = 0x0007; 35 const int SRTP_AEAD_AES_128_GCM = 0x0007;
36 #endif 36 #endif
37 #ifndef SRTP_AEAD_AES_256_GCM 37 #ifndef SRTP_AEAD_AES_256_GCM
38 const int SRTP_AEAD_AES_256_GCM = 0x0008; 38 const int SRTP_AEAD_AES_256_GCM = 0x0008;
39 #endif 39 #endif
40 40
41 // Cipher suite to use for SRTP. Typically a 80-bit HMAC will be used, except 41 // Names of SRTP profiles listed above.
42 // in applications (voice) where the additional bandwidth may be significant.
43 // A 80-bit HMAC is always used for SRTCP.
44 // 128-bit AES with 80-bit SHA-1 HMAC. 42 // 128-bit AES with 80-bit SHA-1 HMAC.
45 extern const char CS_AES_CM_128_HMAC_SHA1_80[]; 43 extern const char CS_AES_CM_128_HMAC_SHA1_80[];
46 // 128-bit AES with 32-bit SHA-1 HMAC. 44 // 128-bit AES with 32-bit SHA-1 HMAC.
47 extern const char CS_AES_CM_128_HMAC_SHA1_32[]; 45 extern const char CS_AES_CM_128_HMAC_SHA1_32[];
48 // 128-bit AES GCM with 16 byte AEAD auth tag. 46 // 128-bit AES GCM with 16 byte AEAD auth tag.
49 extern const char CS_AEAD_AES_128_GCM[]; 47 extern const char CS_AEAD_AES_128_GCM[];
50 // 256-bit AES GCM with 16 byte AEAD auth tag. 48 // 256-bit AES GCM with 16 byte AEAD auth tag.
51 extern const char CS_AEAD_AES_256_GCM[]; 49 extern const char CS_AEAD_AES_256_GCM[];
52 50
53 // Given the DTLS-SRTP protection profile ID, as defined in 51 // Given the DTLS-SRTP protection profile ID, as defined in
(...skipping 21 matching lines...) Expand all
75 // Helper method to return an instance of the CryptoOptions with GCM crypto 73 // Helper method to return an instance of the CryptoOptions with GCM crypto
76 // suites disabled. This method should be used instead of depending on current 74 // suites disabled. This method should be used instead of depending on current
77 // default values set by the constructor. 75 // default values set by the constructor.
78 static CryptoOptions NoGcm(); 76 static CryptoOptions NoGcm();
79 77
80 // Enable GCM crypto suites from RFC 7714 for SRTP. GCM will only be used 78 // Enable GCM crypto suites from RFC 7714 for SRTP. GCM will only be used
81 // if both sides enable it. 79 // if both sides enable it.
82 bool enable_gcm_crypto_suites = false; 80 bool enable_gcm_crypto_suites = false;
83 }; 81 };
84 82
83 // Returns supported crypto suites, given |crypto_options|.
84 // CS_AES_CM_128_HMAC_SHA1_32 will be preferred by default.
85 std::vector<int> GetSupportedDtlsSrtpCryptoSuites(
86 const rtc::CryptoOptions& crypto_options);
87
85 // SSLStreamAdapter : A StreamInterfaceAdapter that does SSL/TLS. 88 // SSLStreamAdapter : A StreamInterfaceAdapter that does SSL/TLS.
86 // After SSL has been started, the stream will only open on successful 89 // After SSL has been started, the stream will only open on successful
87 // SSL verification of certificates, and the communication is 90 // SSL verification of certificates, and the communication is
88 // encrypted of course. 91 // encrypted of course.
89 // 92 //
90 // This class was written with SSLAdapter as a starting point. It 93 // This class was written with SSLAdapter as a starting point. It
91 // offers a similar interface, with two differences: there is no 94 // offers a similar interface, with two differences: there is no
92 // support for a restartable SSL connection, and this class has a 95 // support for a restartable SSL connection, and this class has a
93 // peer-to-peer mode. 96 // peer-to-peer mode.
94 // 97 //
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 266
264 // If true (default), the client is required to provide a certificate during 267 // If true (default), the client is required to provide a certificate during
265 // handshake. If no certificate is given, handshake fails. This applies to 268 // handshake. If no certificate is given, handshake fails. This applies to
266 // server mode only. 269 // server mode only.
267 bool client_auth_enabled_; 270 bool client_auth_enabled_;
268 }; 271 };
269 272
270 } // namespace rtc 273 } // namespace rtc
271 274
272 #endif // WEBRTC_BASE_SSLSTREAMADAPTER_H_ 275 #endif // WEBRTC_BASE_SSLSTREAMADAPTER_H_
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/base/sslstreamadapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698