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

Unified Diff: net/base/x509_certificate_nss.cc

Issue 8568040: Refuse to accept certificate chains containing any RSA public key smaller (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/base/x509_certificate_nss.cc
===================================================================
--- net/base/x509_certificate_nss.cc (revision 110129)
+++ net/base/x509_certificate_nss.cc (working copy)
@@ -1045,4 +1045,29 @@
cert_handle->derCert.len);
}
+//static
agl 2011/11/16 15:57:55 space before "static"
+void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle,
+ size_t* size_bits,
+ PublicKeyType* type) {
+ SECKEYPublicKey* key = CERT_ExtractPublicKey(cert_handle);
+ *size_bits = SECKEY_PublicKeyStrengthInBits(key);
+
+ switch (key->keyType) {
+ case rsaKey:
+ *type = PublicKeyType::RSA;
+ break;
+ case dsaKey:
+ *type = PublicKeyType::DSA;
+ break;
+ case dhKey:
+ *type = PublicKeyType::DH;
+ break;
+ case ecKey:
+ *type = PublicKeyType::ECDSA;
+ break;
+ default:
+ *type = PublicKeyType::NONE;
+ }
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698