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

Unified Diff: net/base/x509_certificate_unittest.cc

Issue 125120: Use LOAD_VERIFY_EV_CERT to verify EV-ness in Verify().... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/x509_certificate_nss.cc ('k') | net/base/x509_certificate_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate_unittest.cc
===================================================================
--- net/base/x509_certificate_unittest.cc (revision 19005)
+++ net/base/x509_certificate_unittest.cc (working copy)
@@ -4,6 +4,8 @@
#include "base/pickle.h"
#include "net/base/cert_status_flags.h"
+#include "net/base/cert_verify_result.h"
+#include "net/base/net_errors.h"
#include "net/base/x509_certificate.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -15,7 +17,7 @@
#define ALLOW_EXTERNAL_ACCESS 0
#if ALLOW_EXTERNAL_ACCESS && defined(OS_WIN)
-#define TEST_EV 1 // Test IsEV()
+#define TEST_EV 1 // Test CERT_STATUS_IS_EV
#endif
using base::Time;
@@ -392,7 +394,11 @@
#if TEST_EV
// TODO(avi): turn this on for the Mac once EV checking is implemented.
- EXPECT_EQ(false, google_cert->IsEV(net::CERT_STATUS_REV_CHECKING_ENABLED));
+ CertVerifyResult verify_result;
+ int flags = X509Certificate::VERIFY_REV_CHECKING_ENABLED |
+ X509Certificate::VERIFY_EV_CERT;
+ EXPECT_EQ(OK, google_cert->Verify("www.google.com", flags, &verify_result));
+ EXPECT_EQ(0, verify_result.cert_status & CERT_STATUS_IS_EV);
#endif
}
@@ -444,7 +450,11 @@
EXPECT_EQ("webkit.org", dns_names[1]);
#if TEST_EV
- EXPECT_EQ(false, webkit_cert->IsEV(net::CERT_STATUS_REV_CHECKING_ENABLED));
+ int flags = X509Certificate::VERIFY_REV_CHECKING_ENABLED |
+ X509Certificate::VERIFY_EV_CERT;
+ CertVerifyResult verify_result;
+ EXPECT_EQ(OK, webkit_cert->Verify("webkit.org", flags, &verify_result));
+ EXPECT_EQ(0, verify_result.cert_status & CERT_STATUS_IS_EV);
#endif
}
@@ -495,11 +505,17 @@
EXPECT_EQ("www.thawte.com", dns_names[0]);
#if TEST_EV
+ int flags = X509Certificate::VERIFY_REV_CHECKING_ENABLED |
+ X509Certificate::VERIFY_EV_CERT;
+ CertVerifyResult verify_result;
// EV cert verification requires revocation checking.
- EXPECT_EQ(true, thawte_cert->IsEV(net::CERT_STATUS_REV_CHECKING_ENABLED));
+ EXPECT_EQ(OK, thawte_cert->Verify("www.thawte.com", flags, &verify_result));
+ EXPECT_NE(0, verify_result.cert_status & CERT_STATUS_IS_EV);
// Consequently, if we don't have revocation checking enabled, we can't claim
// any cert is EV.
- EXPECT_EQ(false, thawte_cert->IsEV(0));
+ flags = X509Certificate::VERIFY_EV_CERT;
+ EXPECT_EQ(OK, thawte_cert->Verify("www.thawte.com", flags, &verify_result));
+ EXPECT_EQ(0, verify_result.cert_status & CERT_STATUS_IS_EV);
#endif
}
« no previous file with comments | « net/base/x509_certificate_nss.cc ('k') | net/base/x509_certificate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698