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

Unified Diff: net/base/cert_verify_proc_win.cc

Issue 10537153: Do not treat weak keys (<1024 bits || MD5) as fatal errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_verify_proc_win.cc
diff --git a/net/base/cert_verify_proc_win.cc b/net/base/cert_verify_proc_win.cc
index 7e1aa4370241a7737363bbbf9b195be8585baecc..be5f004aa56e8a931c7e494f7a086b6cff33407d 100644
--- a/net/base/cert_verify_proc_win.cc
+++ b/net/base/cert_verify_proc_win.cc
@@ -23,6 +23,12 @@
#pragma comment(lib, "crypt32.lib")
+#if !defined(CERT_TRUST_HAS_WEAK_SIGNATURE)
+// This was introduced in Windows 8 / Windows Server 2012, but retroactively
+// ported as far back as Windows XP via system update.
+#define CERT_TRUST_HAS_WEAK_SIGNATURE 0x00100000
+#endif
+
namespace net {
namespace {
@@ -140,9 +146,18 @@ int MapCertChainErrorStatusToCertStatus(DWORD error_status) {
cert_status |= CERT_STATUS_INVALID;
}
+ if (error_status & CERT_TRUST_IS_NOT_SIGNATURE_VALID) {
+ // Check for a 'non-strong-signed' signature. Depending on OS
agl 2012/06/13 21:15:13 You have 'non-strong-signed' in quotes, so maybe i
Ryan Sleevi 2012/06/13 21:22:37 Yeah, MSFT document. They don't call it a 'weak' s
+ // configuration, this may also exclude SHA-1 signatures.
+ if (error_status & CERT_TRUST_HAS_WEAK_SIGNATURE) {
+ cert_status |= CERT_STATUS_WEAK_KEY;
+ } else {
+ cert_status |= CERT_STATUS_INVALID;
+ }
+ }
+
// The rest of the errors.
const DWORD kCertInvalidErrors =
- CERT_TRUST_IS_NOT_SIGNATURE_VALID |
CERT_TRUST_IS_CYCLIC |
CERT_TRUST_INVALID_EXTENSION |
CERT_TRUST_INVALID_POLICY_CONSTRAINTS |
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698