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

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: More Windows bugfixes 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..6cd894f19ec0c5b5f404ab0abbaa7738e603b0ed 100644
--- a/net/cert/x509_certificate_ios.cc
+++ b/net/cert/x509_certificate_ios.cc
@@ -468,7 +468,14 @@ 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/20 18:37:53 nit: as much as it pains me personally, use no cur
dadrian 2016/05/20 19:01:21 Done, though I wash my hands of all responsibility
+ return false;
+ }
+ // NOTE: x509_check_issued returns X509_V_OK in case of success
+ if (X509_check_issued(cert.get(), cert.get()) != X509_V_OK) {
svaldez 2016/05/20 17:54:52 Consider: return X509_check_issued...
dadrian 2016/05/20 19:01:21 Done.
+ return false;
+ }
+ return true;
}
} // 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