OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "net/cert/internal/signature_policy.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 #if defined(USE_OPENSSL) |
| 10 #include <openssl/obj.h> |
| 11 #endif |
| 12 |
| 13 namespace net { |
| 14 |
| 15 bool SignaturePolicy::IsAcceptableSignatureAlgorithm( |
| 16 const SignatureAlgorithm& algorithm) const { |
| 17 return true; |
| 18 } |
| 19 |
| 20 bool SignaturePolicy::IsAcceptableCurveForEcdsa(int curve_nid) const { |
| 21 #if defined(USE_OPENSSL) |
| 22 switch (curve_nid) { |
| 23 case NID_X9_62_prime256v1: |
| 24 case NID_secp384r1: |
| 25 case NID_secp521r1: |
| 26 return true; |
| 27 } |
| 28 #endif |
| 29 return false; |
| 30 } |
| 31 |
| 32 bool SignaturePolicy::IsAcceptableModulusLengthForRsa( |
| 33 size_t modulus_length_bits) const { |
| 34 return modulus_length_bits >= 2048; |
| 35 } |
| 36 |
| 37 SimpleSignaturePolicy::SimpleSignaturePolicy(size_t min_rsa_modulus_length_bits) |
| 38 : min_rsa_modulus_length_bits_(min_rsa_modulus_length_bits) {} |
| 39 |
| 40 bool SimpleSignaturePolicy::IsAcceptableModulusLengthForRsa( |
| 41 size_t modulus_length_bits) const { |
| 42 return modulus_length_bits >= min_rsa_modulus_length_bits_; |
| 43 } |
| 44 |
| 45 } // namespace net |
OLD | NEW |