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

Unified Diff: net/cert/x509_certificate_ios.cc

Issue 1988993002: Check self-signed certificate names and signatures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bugfixes for changes from initial comments Created 4 years, 7 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 | « no previous file | net/cert/x509_certificate_nss.cc » ('j') | net/cert/x509_certificate_nss.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate_ios.cc
diff --git a/net/cert/x509_certificate_ios.cc b/net/cert/x509_certificate_ios.cc
index 553c63a4281a43ba93b7a6298579f9a153f0afeb..24350e8e53525ea4d7201240ee4dc4a3b860f2e8 100644
--- a/net/cert/x509_certificate_ios.cc
+++ b/net/cert/x509_certificate_ios.cc
@@ -468,7 +468,10 @@ bool X509Certificate::IsSelfSigned(OSCertHandle os_cert) {
return false;
// NOTE: X509_verify() returns 1 in case of success, 0 or -1 on error.
- return X509_verify(cert.get(), scoped_key.get()) == 1;
+ if ((X509_verify(cert.get(), scoped_key.get())) != 1)
estark 2016/05/24 03:40:17 nit: it looks like there's a superfluous pair of p
+ return false;
+ // NOTE: x509_check_issued returns X509_V_OK in case of success
+ return X509_check_issued(cert.get(), cert.get()) == X509_V_OK;
}
} // namespace net
« no previous file with comments | « no previous file | net/cert/x509_certificate_nss.cc » ('j') | net/cert/x509_certificate_nss.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698