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

Side by Side Diff: net/cert/internal/signature_policy.cc

Issue 2329593002: Add optional context for certificate errors. (Closed)
Patch Set: Address Matt's comments Created 4 years, 3 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/internal/cert_errors.cc ('k') | net/cert/internal/verify_certificate_chain.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/internal/signature_policy.h" 5 #include "net/cert/internal/signature_policy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/cert/internal/cert_errors.h" 8 #include "net/cert/internal/cert_errors.h"
9 9
10 #include <openssl/obj.h> 10 #include <openssl/obj.h>
11 11
12 namespace net { 12 namespace net {
13 13
14 namespace { 14 namespace {
15 15
16 DEFINE_CERT_ERROR_TYPE(kUnacceptableCurveForEcdsa, 16 DEFINE_CERT_ERROR_ID(kUnacceptableCurveForEcdsa,
17 "Only P-256, P-384, P-521 are supported for ECDSA"); 17 "Only P-256, P-384, P-521 are supported for ECDSA");
18 DEFINE_CERT_ERROR_TYPE(kRsaModulusLessThan2048, 18 DEFINE_CERT_ERROR_ID(kRsaModulusLessThan2048,
19 "RSA modulus must be at least 2048 bits"); 19 "RSA modulus must be at least 2048 bits");
20 DEFINE_CERT_ERROR_TYPE(kRsaModulusTooSmall, "RSA modulus too small"); 20 DEFINE_CERT_ERROR_ID(kRsaModulusTooSmall, "RSA modulus too small");
21 21
22 } // namespace 22 } // namespace
23 23
24 bool SignaturePolicy::IsAcceptableSignatureAlgorithm( 24 bool SignaturePolicy::IsAcceptableSignatureAlgorithm(
25 const SignatureAlgorithm& algorithm, 25 const SignatureAlgorithm& algorithm,
26 CertErrors* errors) const { 26 CertErrors* errors) const {
27 return true; 27 return true;
28 } 28 }
29 29
30 bool SignaturePolicy::IsAcceptableCurveForEcdsa(int curve_nid, 30 bool SignaturePolicy::IsAcceptableCurveForEcdsa(int curve_nid,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // TODO(crbug.com/634443): Add parameters for actual and expected modulus 62 // TODO(crbug.com/634443): Add parameters for actual and expected modulus
63 // size. 63 // size.
64 errors->Add(kRsaModulusTooSmall); 64 errors->Add(kRsaModulusTooSmall);
65 return false; 65 return false;
66 } 66 }
67 67
68 return true; 68 return true;
69 } 69 }
70 70
71 } // namespace net 71 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/cert_errors.cc ('k') | net/cert/internal/verify_certificate_chain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698