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

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

Issue 2070693003: Use the new API to set the BoringSSL time callback. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 | « 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 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 break; 994 break;
995 case SSL_PROTOCOL_TLS_12: 995 case SSL_PROTOCOL_TLS_12:
996 default: 996 default:
997 SSL_CTX_set_max_version(ctx, ssl_mode_ == SSL_MODE_DTLS ? 997 SSL_CTX_set_max_version(ctx, ssl_mode_ == SSL_MODE_DTLS ?
998 DTLS1_2_VERSION : TLS1_2_VERSION); 998 DTLS1_2_VERSION : TLS1_2_VERSION);
999 break; 999 break;
1000 } 1000 }
1001 // Set a time callback for BoringSSL because: 1001 // Set a time callback for BoringSSL because:
1002 // 1. Our time function is more accurate (doesn't just use gettimeofday). 1002 // 1. Our time function is more accurate (doesn't just use gettimeofday).
1003 // 2. This allows us to inject a fake clock for testing. 1003 // 2. This allows us to inject a fake clock for testing.
1004 // SSL_CTX_set_current_time_cb(ctx, &TimeCallback); 1004 SSL_CTX_set_current_time_cb(ctx, &TimeCallback);
1005 ctx->current_time_cb = &TimeCallback;
1006 #endif 1005 #endif
1007 1006
1008 if (identity_ && !identity_->ConfigureIdentity(ctx)) { 1007 if (identity_ && !identity_->ConfigureIdentity(ctx)) {
1009 SSL_CTX_free(ctx); 1008 SSL_CTX_free(ctx);
1010 return NULL; 1009 return NULL;
1011 } 1010 }
1012 1011
1013 #if !defined(NDEBUG) 1012 #if !defined(NDEBUG)
1014 SSL_CTX_set_info_callback(ctx, OpenSSLAdapter::SSLInfoCallback); 1013 SSL_CTX_set_info_callback(ctx, OpenSSLAdapter::SSLInfoCallback);
1015 #endif 1014 #endif
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 return true; 1219 return true;
1221 } 1220 }
1222 } 1221 }
1223 1222
1224 return false; 1223 return false;
1225 } 1224 }
1226 1225
1227 } // namespace rtc 1226 } // namespace rtc
1228 1227
1229 #endif // HAVE_OPENSSL_SSL_H 1228 #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