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

Unified Diff: net/base/x509_util_nss_unittest.cc

Issue 8890073: Handle Origin Bound Certificate expiration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/x509_util_nss.cc ('k') | net/base/x509_util_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_util_nss_unittest.cc
diff --git a/net/base/x509_util_nss_unittest.cc b/net/base/x509_util_nss_unittest.cc
index 74908748c0a1d3048ef8d0a0cdae0c1c955c990a..1dc2cd2e55f368e550fc1f0540e98eb1316b76f5 100644
--- a/net/base/x509_util_nss_unittest.cc
+++ b/net/base/x509_util_nss_unittest.cc
@@ -145,14 +145,17 @@ void VerifyOriginBoundCert(const std::string& origin,
TEST(X509UtilNSSTest, CreateOriginBoundCertRSA) {
// Create a sample ASCII weborigin.
std::string origin = "http://weborigin.com:443";
+ base::Time now = base::Time::Now();
scoped_ptr<crypto::RSAPrivateKey> private_key(
crypto::RSAPrivateKey::Create(1024));
std::string der_cert;
- ASSERT_TRUE(x509_util::CreateOriginBoundCertRSA(private_key.get(),
- origin, 1,
- base::TimeDelta::FromDays(1),
- &der_cert));
+ ASSERT_TRUE(x509_util::CreateOriginBoundCertRSA(
+ private_key.get(),
+ origin, 1,
+ now,
+ now + base::TimeDelta::FromDays(1),
+ &der_cert));
VerifyOriginBoundCert(origin, der_cert);
@@ -166,14 +169,17 @@ TEST(X509UtilNSSTest, CreateOriginBoundCertRSA) {
TEST(X509UtilNSSTest, CreateOriginBoundCertEC) {
// Create a sample ASCII weborigin.
std::string origin = "http://weborigin.com:443";
+ base::Time now = base::Time::Now();
scoped_ptr<crypto::ECPrivateKey> private_key(
crypto::ECPrivateKey::Create());
std::string der_cert;
- ASSERT_TRUE(x509_util::CreateOriginBoundCertEC(private_key.get(),
- origin, 1,
- base::TimeDelta::FromDays(1),
- &der_cert));
+ ASSERT_TRUE(x509_util::CreateOriginBoundCertEC(
+ private_key.get(),
+ origin, 1,
+ now,
+ now + base::TimeDelta::FromDays(1),
+ &der_cert));
VerifyOriginBoundCert(origin, der_cert);
« no previous file with comments | « net/base/x509_util_nss.cc ('k') | net/base/x509_util_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698