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

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: 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
Index: net/cert/x509_certificate_win.cc
diff --git a/net/cert/x509_certificate_win.cc b/net/cert/x509_certificate_win.cc
index ab92b6f2a628fcc10185274291d2f9c353ae346f..8a5ddcf8e0ca4b785060541906b4c332f5985dc9 100644
--- a/net/cert/x509_certificate_win.cc
+++ b/net/cert/x509_certificate_win.cc
@@ -453,4 +453,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,
+ cert_handle,
+ CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT,
+ cert_handle,
+ 0,
+ NULL);
+}
+
} // namespace net
« net/cert/x509_certificate_openssl.cc ('K') | « net/cert/x509_certificate_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698