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

Unified Diff: net/cert/x509_certificate_ios.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.h ('k') | net/cert/x509_certificate_mac.cc » ('j') | no next file with comments »
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 b0908b77afae4b4397adbc8e4ca61f653e121406..bc76d08e566726e42ca858668b147f397f32bb31 100644
--- a/net/cert/x509_certificate_ios.cc
+++ b/net/cert/x509_certificate_ios.cc
@@ -250,4 +250,15 @@ void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle,
x509_util::GetPublicKeyInfo(nss_cert.cert_handle(), size_bits, type);
}
+// static
+bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) {
+ x509_util_ios::NSSCertificate nss_cert(cert_handle);
+ crypto::ScopedSECKEYPublicKey public_key(
+ CERT_ExtractPublicKey(nss_cert.cert_handle()));
+ if (!public_key.get())
+ return false;
+ return SECSuccess == CERT_VerifySignedDataWithPublicKey(
+ &nss_cert.cert_handle()->signatureWrap, public_key.get(), NULL);
+}
+
} // namespace net
« no previous file with comments | « net/cert/x509_certificate.h ('k') | net/cert/x509_certificate_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698