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

Side by Side Diff: net/cert/cert_verify_proc.cc

Issue 2610903003: [refactor] Extract the CertVerifyResult assignment of has_md2, has_md4, (Closed)
Patch Set: address comments Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « net/cert/cert_verify_proc.h ('k') | net/cert/cert_verify_proc_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/cert/cert_verify_proc.h ('k') | net/cert/cert_verify_proc_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698