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

Unified Diff: net/cert/x509_certificate_openssl.cc

Issue 1988993002: Check self-signed certificate names and signatures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting nits 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
Index: net/cert/x509_certificate_openssl.cc
diff --git a/net/cert/x509_certificate_openssl.cc b/net/cert/x509_certificate_openssl.cc
index dc1b4ee6244901ac2bb006e04933903455df05a7..fdd6648e9959be4f252d569fbfee81fa1d24794f 100644
--- a/net/cert/x509_certificate_openssl.cc
+++ b/net/cert/x509_certificate_openssl.cc
@@ -458,7 +458,11 @@ bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) {
return false;
// NOTE: X509_verify() returns 1 in case of success, 0 or -1 on error.
- return X509_verify(cert_handle, scoped_key.get()) == 1;
+ if (X509_verify(cert_handle, scoped_key.get()) != 1)
+ return false;
+
+ // NOTE: x509_check_issued returns X509_V_OK in case of success
Ryan Sleevi 2016/05/26 07:57:08 ditto re: NOTE
dadrian 2016/05/27 01:05:02 Done.
+ return X509_check_issued(cert_handle, cert_handle) == X509_V_OK;
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698