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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 if (start >= time_2015_04_01 && month_diff > 39) | 767 if (start >= time_2015_04_01 && month_diff > 39) |
768 return true; | 768 return true; |
769 | 769 |
770 return false; | 770 return false; |
771 } | 771 } |
772 | 772 |
773 // static | 773 // static |
774 const base::Feature CertVerifyProc::kSHA1LegacyMode{ | 774 const base::Feature CertVerifyProc::kSHA1LegacyMode{ |
775 "SHA1LegacyMode", base::FEATURE_DISABLED_BY_DEFAULT}; | 775 "SHA1LegacyMode", base::FEATURE_DISABLED_BY_DEFAULT}; |
776 | 776 |
| 777 X509Certificate::SignatureHashAlgorithm FillCertVerifyResultWeakSignature( |
| 778 X509Certificate::OSCertHandle cert, |
| 779 bool is_leaf, |
| 780 CertVerifyResult* verify_result) { |
| 781 X509Certificate::SignatureHashAlgorithm hash = |
| 782 X509Certificate::GetSignatureHashAlgorithm(cert); |
| 783 switch (hash) { |
| 784 case X509Certificate::kSignatureHashAlgorithmMd2: |
| 785 verify_result->has_md2 = true; |
| 786 break; |
| 787 case X509Certificate::kSignatureHashAlgorithmMd4: |
| 788 verify_result->has_md4 = true; |
| 789 break; |
| 790 case X509Certificate::kSignatureHashAlgorithmMd5: |
| 791 verify_result->has_md5 = true; |
| 792 break; |
| 793 case X509Certificate::kSignatureHashAlgorithmSha1: |
| 794 verify_result->has_sha1 = true; |
| 795 if (is_leaf) |
| 796 verify_result->has_sha1_leaf = true; |
| 797 break; |
| 798 case X509Certificate::kSignatureHashAlgorithmOther: |
| 799 break; |
| 800 } |
| 801 |
| 802 return hash; |
| 803 } |
| 804 |
777 } // namespace net | 805 } // namespace net |
OLD | NEW |