Chromium Code Reviews| 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 | |