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

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

Issue 1844313002: Rename some things SSL for style guide adherence (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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
« webrtc/base/opensslidentity.cc ('K') | « webrtc/base/sslidentity.cc ('k') | 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 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // We test just ECDSA here since what we're out to exercise is the 390 // We test just ECDSA here since what we're out to exercise is the
391 // interfaces for expiration setting and reading. 391 // interfaces for expiration setting and reading.
392 for (int i = 0; i < times; i++) { 392 for (int i = 0; i < times; i++) {
393 // We limit the time to < 2^31 here, i.e., we stay before 2038, since else 393 // We limit the time to < 2^31 here, i.e., we stay before 2038, since else
394 // we hit time offset limitations in OpenSSL on some 32-bit systems. 394 // we hit time offset limitations in OpenSSL on some 32-bit systems.
395 time_t time_before_generation = time(nullptr); 395 time_t time_before_generation = time(nullptr);
396 time_t lifetime = 396 time_t lifetime =
397 rtc::CreateRandomId() % (0x80000000 - time_before_generation); 397 rtc::CreateRandomId() % (0x80000000 - time_before_generation);
398 rtc::KeyParams key_params = rtc::KeyParams::ECDSA(rtc::EC_NIST_P256); 398 rtc::KeyParams key_params = rtc::KeyParams::ECDSA(rtc::EC_NIST_P256);
399 SSLIdentity* identity = 399 SSLIdentity* identity =
400 rtc::SSLIdentity::Generate("", key_params, lifetime); 400 rtc::SSLIdentity::GenerateWithExpiration("", key_params, lifetime);
401 time_t time_after_generation = time(nullptr); 401 time_t time_after_generation = time(nullptr);
402 EXPECT_LE(time_before_generation + lifetime, 402 EXPECT_LE(time_before_generation + lifetime,
403 identity->certificate().CertificateExpirationTime()); 403 identity->certificate().CertificateExpirationTime());
404 EXPECT_GE(time_after_generation + lifetime, 404 EXPECT_GE(time_after_generation + lifetime,
405 identity->certificate().CertificateExpirationTime()); 405 identity->certificate().CertificateExpirationTime());
406 delete identity; 406 delete identity;
407 } 407 }
408 } 408 }
409 }; 409 };
410 410
411 TEST_F(SSLIdentityExpirationTest, TestASN1TimeToSec) { 411 TEST_F(SSLIdentityExpirationTest, TestASN1TimeToSec) {
412 TestASN1TimeToSec(); 412 TestASN1TimeToSec();
413 } 413 }
414 414
415 TEST_F(SSLIdentityExpirationTest, TestExpireTime) { 415 TEST_F(SSLIdentityExpirationTest, TestExpireTime) {
416 TestExpireTime(500); 416 TestExpireTime(500);
417 } 417 }
OLDNEW
« webrtc/base/opensslidentity.cc ('K') | « webrtc/base/sslidentity.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698