OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/cert/cert_verify_proc.h" | 5 #include "net/cert/cert_verify_proc.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 if (verify_result->has_sha1) | 433 if (verify_result->has_sha1) |
434 verify_result->cert_status |= CERT_STATUS_SHA1_SIGNATURE_PRESENT; | 434 verify_result->cert_status |= CERT_STATUS_SHA1_SIGNATURE_PRESENT; |
435 | 435 |
436 // Flag certificates using weak signature algorithms. | 436 // Flag certificates using weak signature algorithms. |
437 // The CA/Browser Forum Baseline Requirements (beginning with v1.2.1) | 437 // The CA/Browser Forum Baseline Requirements (beginning with v1.2.1) |
438 // prohibits SHA-1 certificates from being issued beginning on | 438 // prohibits SHA-1 certificates from being issued beginning on |
439 // 1 January 2016. Ideally, all of SHA-1 in new certificates would be | 439 // 1 January 2016. Ideally, all of SHA-1 in new certificates would be |
440 // disabled on this date, but enterprises need more time to transition. | 440 // disabled on this date, but enterprises need more time to transition. |
441 // As the risk is greatest for publicly trusted certificates, prevent | 441 // As the risk is greatest for publicly trusted certificates, prevent |
442 // those certificates from being trusted from that date forward. | 442 // those certificates from being trusted from that date forward. |
| 443 // |
| 444 // TODO(mattm): apply the SHA-1 deprecation check to all certs unless |
| 445 // CertVerifier::VERIFY_ENABLE_SHA1_LOCAL_ANCHORS flag is present. |
443 if (verify_result->has_md5 || | 446 if (verify_result->has_md5 || |
444 (verify_result->has_sha1_leaf && verify_result->is_issued_by_known_root && | 447 (verify_result->has_sha1_leaf && verify_result->is_issued_by_known_root && |
445 IsPastSHA1DeprecationDate(*cert))) { | 448 IsPastSHA1DeprecationDate(*cert))) { |
446 verify_result->cert_status |= CERT_STATUS_WEAK_SIGNATURE_ALGORITHM; | 449 verify_result->cert_status |= CERT_STATUS_WEAK_SIGNATURE_ALGORITHM; |
447 // Avoid replacing a more serious error, such as an OS/library failure, | 450 // Avoid replacing a more serious error, such as an OS/library failure, |
448 // by ensuring that if verification failed, it failed with a certificate | 451 // by ensuring that if verification failed, it failed with a certificate |
449 // error. | 452 // error. |
450 if (rv == OK || IsCertificateError(rv)) | 453 if (rv == OK || IsCertificateError(rv)) |
451 rv = MapCertStatusToNetError(verify_result->cert_status); | 454 rv = MapCertStatusToNetError(verify_result->cert_status); |
452 } | 455 } |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 return true; | 709 return true; |
707 | 710 |
708 // For certificates issued after 1 April 2015: 39 months. | 711 // For certificates issued after 1 April 2015: 39 months. |
709 if (start >= time_2015_04_01 && month_diff > 39) | 712 if (start >= time_2015_04_01 && month_diff > 39) |
710 return true; | 713 return true; |
711 | 714 |
712 return false; | 715 return false; |
713 } | 716 } |
714 | 717 |
715 } // namespace net | 718 } // namespace net |
OLD | NEW |