| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |