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

Unified Diff: net/cert/x509_certificate_win.cc

Issue 634033002: Check whether or not a certificate is self-signed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Scope those pointers. Created 6 years, 2 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/cert/x509_certificate_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate_win.cc
diff --git a/net/cert/x509_certificate_win.cc b/net/cert/x509_certificate_win.cc
index df263d8fa90838d9af5fb7db8e72b0eed0ee8f30..0b4c46b00dbcf228350acc120e1913d200053ad6 100644
--- a/net/cert/x509_certificate_win.cc
+++ b/net/cert/x509_certificate_win.cc
@@ -472,4 +472,17 @@ bool X509Certificate::IsIssuedByEncoded(
return false;
}
+// static
+bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) {
+ return !!CryptVerifyCertificateSignatureEx(
+ NULL,
+ X509_ASN_ENCODING,
+ CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT,
+ reinterpret_cast<void*>(const_cast<PCERT_CONTEXT>(cert_handle)),
+ CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT,
+ reinterpret_cast<void*>(const_cast<PCERT_CONTEXT>(cert_handle)),
+ 0,
+ NULL);
+}
+
} // namespace net
« no previous file with comments | « net/cert/x509_certificate_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698