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

Side by Side Diff: webrtc/base/opensslstreamadapter.cc

Issue 2550423004: Use SSL_CTX_set_max_proto_version instead of SSL_CTX_set_max_version. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | 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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 } 1040 }
1041 break; 1041 break;
1042 } 1042 }
1043 ctx = SSL_CTX_new(method); 1043 ctx = SSL_CTX_new(method);
1044 #endif // OPENSSL_IS_BORINGSSL 1044 #endif // OPENSSL_IS_BORINGSSL
1045 1045
1046 if (ctx == NULL) 1046 if (ctx == NULL)
1047 return NULL; 1047 return NULL;
1048 1048
1049 #ifdef OPENSSL_IS_BORINGSSL 1049 #ifdef OPENSSL_IS_BORINGSSL
1050 SSL_CTX_set_min_version(ctx, ssl_mode_ == SSL_MODE_DTLS ? 1050 SSL_CTX_set_min_proto_version(ctx, ssl_mode_ == SSL_MODE_DTLS ?
1051 DTLS1_VERSION : TLS1_VERSION); 1051 DTLS1_VERSION : TLS1_VERSION);
1052 switch (ssl_max_version_) { 1052 switch (ssl_max_version_) {
1053 case SSL_PROTOCOL_TLS_10: 1053 case SSL_PROTOCOL_TLS_10:
1054 SSL_CTX_set_max_version(ctx, ssl_mode_ == SSL_MODE_DTLS ? 1054 SSL_CTX_set_max_proto_version(ctx, ssl_mode_ == SSL_MODE_DTLS ?
1055 DTLS1_VERSION : TLS1_VERSION); 1055 DTLS1_VERSION : TLS1_VERSION);
1056 break; 1056 break;
1057 case SSL_PROTOCOL_TLS_11: 1057 case SSL_PROTOCOL_TLS_11:
1058 SSL_CTX_set_max_version(ctx, ssl_mode_ == SSL_MODE_DTLS ? 1058 SSL_CTX_set_max_proto_version(ctx, ssl_mode_ == SSL_MODE_DTLS ?
1059 DTLS1_VERSION : TLS1_1_VERSION); 1059 DTLS1_VERSION : TLS1_1_VERSION);
1060 break; 1060 break;
1061 case SSL_PROTOCOL_TLS_12: 1061 case SSL_PROTOCOL_TLS_12:
1062 default: 1062 default:
1063 SSL_CTX_set_max_version(ctx, ssl_mode_ == SSL_MODE_DTLS ? 1063 SSL_CTX_set_max_proto_version(ctx, ssl_mode_ == SSL_MODE_DTLS ?
1064 DTLS1_2_VERSION : TLS1_2_VERSION); 1064 DTLS1_2_VERSION : TLS1_2_VERSION);
1065 break; 1065 break;
1066 } 1066 }
1067 if (g_use_time_callback_for_testing) { 1067 if (g_use_time_callback_for_testing) {
1068 SSL_CTX_set_current_time_cb(ctx, &TimeCallbackForTesting); 1068 SSL_CTX_set_current_time_cb(ctx, &TimeCallbackForTesting);
1069 } 1069 }
1070 #endif 1070 #endif
1071 1071
1072 if (identity_ && !identity_->ConfigureIdentity(ctx)) { 1072 if (identity_ && !identity_->ConfigureIdentity(ctx)) {
1073 SSL_CTX_free(ctx); 1073 SSL_CTX_free(ctx);
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 return false; 1267 return false;
1268 } 1268 }
1269 1269
1270 void OpenSSLStreamAdapter::enable_time_callback_for_testing() { 1270 void OpenSSLStreamAdapter::enable_time_callback_for_testing() {
1271 g_use_time_callback_for_testing = true; 1271 g_use_time_callback_for_testing = true;
1272 } 1272 }
1273 1273
1274 } // namespace rtc 1274 } // namespace rtc
1275 1275
1276 #endif // HAVE_OPENSSL_SSL_H 1276 #endif // HAVE_OPENSSL_SSL_H
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698