From bd49af9f09124dc2442be3211995d2e2adc6964f Mon Sep 17 00:00:00 2001 From: "ukai@chromium.org" Date: Mon, 1 Jun 2009 06:33:13 +0000 Subject: Move X509Certificate::HasExpired to x509_certificate.cc. All versions have implemented valid_expiry(), so we can use common code for X509Certificate::HasExpired. R=wtc Review URL: http://codereview.chromium.org/118069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17311 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/x509_certificate.cc | 5 +++++ net/base/x509_certificate_mac.cc | 5 ----- net/base/x509_certificate_nss.cc | 5 ----- net/base/x509_certificate_win.cc | 4 ---- 4 files changed, 5 insertions(+), 14 deletions(-) (limited to 'net') diff --git a/net/base/x509_certificate.cc b/net/base/x509_certificate.cc index 1655712..7a5a669 100644 --- a/net/base/x509_certificate.cc +++ b/net/base/x509_certificate.cc @@ -6,6 +6,7 @@ #include "base/histogram.h" #include "base/logging.h" +#include "base/time.h" namespace net { @@ -192,4 +193,8 @@ X509Certificate::~X509Certificate() { FreeOSCertHandle(cert_handle_); } +bool X509Certificate::HasExpired() const { + return base::Time::Now() > valid_expiry(); +} + } // namespace net diff --git a/net/base/x509_certificate_mac.cc b/net/base/x509_certificate_mac.cc index ad27e23..edbc654 100644 --- a/net/base/x509_certificate_mac.cc +++ b/net/base/x509_certificate_mac.cc @@ -252,11 +252,6 @@ void X509Certificate::Persist(Pickle* pickle) { pickle->WriteData(reinterpret_cast(cert_data.Data), cert_data.Length); } -bool X509Certificate::HasExpired() const { - NOTIMPLEMENTED(); - return false; -} - void X509Certificate::GetDNSNames(std::vector* dns_names) const { dns_names->clear(); diff --git a/net/base/x509_certificate_nss.cc b/net/base/x509_certificate_nss.cc index 754ed1f..733483a 100644 --- a/net/base/x509_certificate_nss.cc +++ b/net/base/x509_certificate_nss.cc @@ -365,11 +365,6 @@ void X509Certificate::GetDNSNames(std::vector* dns_names) const { dns_names->push_back(subject_.common_name); } -bool X509Certificate::HasExpired() const { - NOTIMPLEMENTED(); - return false; -} - // TODO(ukai): fix to use this method to verify certificate on SSL channel. // Note that it's not being used yet. We need to fix SSLClientSocketNSS to // use this method to verify ssl certificate. diff --git a/net/base/x509_certificate_win.cc b/net/base/x509_certificate_win.cc index 1fe23f2..bae5607 100644 --- a/net/base/x509_certificate_win.cc +++ b/net/base/x509_certificate_win.cc @@ -427,10 +427,6 @@ void X509Certificate::GetDNSNames(std::vector* dns_names) const { dns_names->push_back(subject_.common_name); } -bool X509Certificate::HasExpired() const { - return Time::Now() > valid_expiry(); -} - int X509Certificate::Verify(const std::string& hostname, bool rev_checking_enabled, CertVerifyResult* verify_result) const { -- cgit v1.1