diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-25 00:25:35 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-25 00:25:35 +0000 |
commit | 6b8a3c74f230377bd7a54fc17de02f82bc6e9532 (patch) | |
tree | ec30246a3b6b3c81a71f736f3beecf33525e1d87 /net/cert | |
parent | 1442d7f4cb20dc35f0a138fce93186eaa688e4ea (diff) | |
download | chromium_src-6b8a3c74f230377bd7a54fc17de02f82bc6e9532.zip chromium_src-6b8a3c74f230377bd7a54fc17de02f82bc6e9532.tar.gz chromium_src-6b8a3c74f230377bd7a54fc17de02f82bc6e9532.tar.bz2 |
Rename ServerBoundCert => ChannelID to reflect the current name
of this feature.
TBR=darin
Review URL: https://codereview.chromium.org/356713005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/cert')
-rw-r--r-- | net/cert/x509_util.cc | 28 | ||||
-rw-r--r-- | net/cert/x509_util.h | 18 | ||||
-rw-r--r-- | net/cert/x509_util_nss.cc | 32 | ||||
-rw-r--r-- | net/cert/x509_util_nss_unittest.cc | 10 | ||||
-rw-r--r-- | net/cert/x509_util_openssl.cc | 2 | ||||
-rw-r--r-- | net/cert/x509_util_openssl_unittest.cc | 24 |
6 files changed, 57 insertions, 57 deletions
diff --git a/net/cert/x509_util.cc b/net/cert/x509_util.cc index cc0a2c5..d74340e 100644 --- a/net/cert/x509_util.cc +++ b/net/cert/x509_util.cc @@ -19,7 +19,7 @@ namespace x509_util { static const uint16 kRSAKeyLength = 1024; // Certificates made by CreateKeyAndSelfSignedCert and -// CreateKeyAndDomainBoundCertEC will be signed using this digest algorithm. +// CreateKeyAndChannelIDEC will be signed using this digest algorithm. static const DigestAlgorithm kSignatureDigestAlgorithm = DIGEST_SHA256; ClientCertSorter::ClientCertSorter() : now_(base::Time::Now()) {} @@ -55,23 +55,23 @@ bool ClientCertSorter::operator()( return a_intermediates.size() < b_intermediates.size(); } -bool CreateKeyAndDomainBoundCertEC(const std::string& domain, - uint32 serial_number, - base::Time not_valid_before, - base::Time not_valid_after, - scoped_ptr<crypto::ECPrivateKey>* key, - std::string* der_cert) { +bool CreateKeyAndChannelIDEC(const std::string& domain, + uint32 serial_number, + base::Time not_valid_before, + base::Time not_valid_after, + scoped_ptr<crypto::ECPrivateKey>* key, + std::string* der_cert) { scoped_ptr<crypto::ECPrivateKey> new_key(crypto::ECPrivateKey::Create()); if (!new_key.get()) return false; - bool success = CreateDomainBoundCertEC(new_key.get(), - kSignatureDigestAlgorithm, - domain, - serial_number, - not_valid_before, - not_valid_after, - der_cert); + bool success = CreateChannelIDEC(new_key.get(), + kSignatureDigestAlgorithm, + domain, + serial_number, + not_valid_before, + not_valid_after, + der_cert); if (success) key->reset(new_key.release()); diff --git a/net/cert/x509_util.h b/net/cert/x509_util.h index e6b0e44..f4c67e2 100644 --- a/net/cert/x509_util.h +++ b/net/cert/x509_util.h @@ -44,7 +44,7 @@ NET_EXPORT_PRIVATE bool IsSupportedValidityRange(base::Time not_valid_before, // // See Internet Draft draft-balfanz-tls-obc-00 for more details: // http://tools.ietf.org/html/draft-balfanz-tls-obc-00 -NET_EXPORT_PRIVATE bool CreateKeyAndDomainBoundCertEC( +NET_EXPORT_PRIVATE bool CreateKeyAndChannelIDEC( const std::string& domain, uint32 serial_number, base::Time not_valid_before, @@ -52,14 +52,14 @@ NET_EXPORT_PRIVATE bool CreateKeyAndDomainBoundCertEC( scoped_ptr<crypto::ECPrivateKey>* key, std::string* der_cert); -// Helper function for CreateKeyAndDomainBoundCertEC. -NET_EXPORT_PRIVATE bool CreateDomainBoundCertEC(crypto::ECPrivateKey* key, - DigestAlgorithm alg, - const std::string& domain, - uint32 serial_number, - base::Time not_valid_before, - base::Time not_valid_after, - std::string* der_cert); +// Helper function for CreateKeyAndChannelIDEC. +NET_EXPORT_PRIVATE bool CreateChannelIDEC(crypto::ECPrivateKey* key, + DigestAlgorithm alg, + const std::string& domain, + uint32 serial_number, + base::Time not_valid_before, + base::Time not_valid_after, + std::string* der_cert); // Creates a public-private keypair and a self-signed certificate. // Subject, serial number and validity period are given as parameters. diff --git a/net/cert/x509_util_nss.cc b/net/cert/x509_util_nss.cc index beed9a1..b138bd4 100644 --- a/net/cert/x509_util_nss.cc +++ b/net/cert/x509_util_nss.cc @@ -33,14 +33,14 @@ namespace net { namespace { -class DomainBoundCertOIDWrapper { +class ChannelIDOIDWrapper { public: - static DomainBoundCertOIDWrapper* GetInstance() { + static ChannelIDOIDWrapper* GetInstance() { // Instantiated as a leaky singleton to allow the singleton to be // constructed on a worker thead that is not joined when a process // shuts down. - return Singleton<DomainBoundCertOIDWrapper, - LeakySingletonTraits<DomainBoundCertOIDWrapper> >::get(); + return Singleton<ChannelIDOIDWrapper, + LeakySingletonTraits<ChannelIDOIDWrapper> >::get(); } SECOidTag domain_bound_cert_oid_tag() const { @@ -48,16 +48,16 @@ class DomainBoundCertOIDWrapper { } private: - friend struct DefaultSingletonTraits<DomainBoundCertOIDWrapper>; + friend struct DefaultSingletonTraits<ChannelIDOIDWrapper>; - DomainBoundCertOIDWrapper(); + ChannelIDOIDWrapper(); SECOidTag domain_bound_cert_oid_tag_; - DISALLOW_COPY_AND_ASSIGN(DomainBoundCertOIDWrapper); + DISALLOW_COPY_AND_ASSIGN(ChannelIDOIDWrapper); }; -DomainBoundCertOIDWrapper::DomainBoundCertOIDWrapper() +ChannelIDOIDWrapper::ChannelIDOIDWrapper() : domain_bound_cert_oid_tag_(SEC_OID_UNKNOWN) { // 1.3.6.1.4.1.11129.2.1.6 // (iso.org.dod.internet.private.enterprises.google.googleSecurity. @@ -291,13 +291,13 @@ bool IsSupportedValidityRange(base::Time not_valid_before, return true; } -bool CreateDomainBoundCertEC(crypto::ECPrivateKey* key, - DigestAlgorithm alg, - const std::string& domain, - uint32 serial_number, - base::Time not_valid_before, - base::Time not_valid_after, - std::string* der_cert) { +bool CreateChannelIDEC(crypto::ECPrivateKey* key, + DigestAlgorithm alg, + const std::string& domain, + uint32 serial_number, + base::Time not_valid_before, + base::Time not_valid_after, + std::string* der_cert) { DCHECK(key); CERTCertificate* cert = CreateCertificate(key->public_key(), @@ -338,7 +338,7 @@ bool CreateDomainBoundCertEC(crypto::ECPrivateKey* key, // Add the extension to the opaque handle if (CERT_AddExtension( cert_handle, - DomainBoundCertOIDWrapper::GetInstance()->domain_bound_cert_oid_tag(), + ChannelIDOIDWrapper::GetInstance()->domain_bound_cert_oid_tag(), asn1_domain_string, PR_TRUE, PR_TRUE) != SECSuccess){ diff --git a/net/cert/x509_util_nss_unittest.cc b/net/cert/x509_util_nss_unittest.cc index 0ad5ecd..40a8d9c 100644 --- a/net/cert/x509_util_nss_unittest.cc +++ b/net/cert/x509_util_nss_unittest.cc @@ -76,8 +76,8 @@ void VerifyCertificateSignature(const std::string& der_cert, } #endif // !defined(OS_WIN) && !defined(OS_MACOSX) -void VerifyDomainBoundCert(const std::string& domain, - const std::string& der_cert) { +void VerifyChannelID(const std::string& domain, + const std::string& der_cert) { // Origin Bound Cert OID. static const char oid_string[] = "1.3.6.1.4.1.11129.2.1.6"; @@ -143,21 +143,21 @@ void VerifyDomainBoundCert(const std::string& domain, // This test creates a domain-bound cert and an EC private key and // then verifies the content of the certificate. -TEST(X509UtilNSSTest, CreateKeyAndDomainBoundCertEC) { +TEST(X509UtilNSSTest, CreateKeyAndChannelIDEC) { // Create a sample ASCII weborigin. std::string domain = "weborigin.com"; base::Time now = base::Time::Now(); scoped_ptr<crypto::ECPrivateKey> private_key; std::string der_cert; - ASSERT_TRUE(x509_util::CreateKeyAndDomainBoundCertEC( + ASSERT_TRUE(x509_util::CreateKeyAndChannelIDEC( domain, 1, now, now + base::TimeDelta::FromDays(1), &private_key, &der_cert)); - VerifyDomainBoundCert(domain, der_cert); + VerifyChannelID(domain, der_cert); #if !defined(OS_WIN) && !defined(OS_MACOSX) // signature_verifier_win and signature_verifier_mac can't handle EC certs. diff --git a/net/cert/x509_util_openssl.cc b/net/cert/x509_util_openssl.cc index 38a987c..19362f2 100644 --- a/net/cert/x509_util_openssl.cc +++ b/net/cert/x509_util_openssl.cc @@ -223,7 +223,7 @@ bool IsSupportedValidityRange(base::Time not_valid_before, return true; } -bool CreateDomainBoundCertEC( +bool CreateChannelIDEC( crypto::ECPrivateKey* key, DigestAlgorithm alg, const std::string& domain, diff --git a/net/cert/x509_util_openssl_unittest.cc b/net/cert/x509_util_openssl_unittest.cc index 77746eb..81b709a 100644 --- a/net/cert/x509_util_openssl_unittest.cc +++ b/net/cert/x509_util_openssl_unittest.cc @@ -43,8 +43,8 @@ void VerifyCertificateSignature(const std::string& der_cert, // Verify the attributes of a domain-bound certificate. // |domain| is the bound domain name. // |der_cert| is the DER-encoded X.509 certificate. -void VerifyDomainBoundCert(const std::string& domain, - const std::string& der_cert) { +void VerifyChannelID(const std::string& domain, + const std::string& der_cert) { // Origin Bound Cert OID. static const char oid_string[] = "1.3.6.1.4.1.11129.2.1.6"; crypto::ScopedOpenSSL<ASN1_OBJECT, ASN1_OBJECT_free>::Type oid_obj( @@ -112,7 +112,7 @@ TEST(X509UtilOpenSSLTest, IsSupportedValidityRange) { EXPECT_FALSE(x509_util::IsSupportedValidityRange(too_late, too_late)); } -TEST(X509UtilOpenSSLTest, CreateDomainBoundCertEC) { +TEST(X509UtilOpenSSLTest, CreateChannelIDEC) { // Create a sample ASCII weborigin. std::string domain = "weborigin.com"; base::Time now = base::Time::Now(); @@ -121,15 +121,15 @@ TEST(X509UtilOpenSSLTest, CreateDomainBoundCertEC) { crypto::ECPrivateKey::Create()); std::string der_cert; ASSERT_TRUE( - x509_util::CreateDomainBoundCertEC(private_key.get(), - x509_util::DIGEST_SHA1, - domain, - 1, - now, - now + base::TimeDelta::FromDays(1), - &der_cert)); - - VerifyDomainBoundCert(domain, der_cert); + x509_util::CreateChannelIDEC(private_key.get(), + x509_util::DIGEST_SHA1, + domain, + 1, + now, + now + base::TimeDelta::FromDays(1), + &der_cert)); + + VerifyChannelID(domain, der_cert); // signature_verifier_win and signature_verifier_mac can't handle EC certs. std::vector<uint8> spki; |