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

Unified Diff: net/cert/x509_certificate_nss.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.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
« no previous file with comments | « net/cert/x509_certificate_mac.cc ('k') | net/cert/x509_certificate_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate_nss.cc
diff --git a/net/cert/x509_certificate_nss.cc b/net/cert/x509_certificate_nss.cc
index a57f9ce71f200914bb7a597be57ac70073d410c3..45dd0a2743bc21e5f522ceea17657553fe836920 100644
--- a/net/cert/x509_certificate_nss.cc
+++ b/net/cert/x509_certificate_nss.cc
@@ -281,4 +281,13 @@ void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle,
x509_util::GetPublicKeyInfo(cert_handle, size_bits, type);
}
+// static
+bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) {
+ crypto::ScopedSECKEYPublicKey public_key(CERT_ExtractPublicKey(cert_handle));
+ if (!public_key.get())
+ return false;
+ return SECSuccess == CERT_VerifySignedDataWithPublicKey(
+ &cert_handle->signatureWrap, public_key.get(), NULL);
+}
+
} // namespace net
« no previous file with comments | « net/cert/x509_certificate_mac.cc ('k') | net/cert/x509_certificate_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698