blob: c00212ac9410888887f8e383cbbf7ef7dc9a6abc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/cert/internal/signature_policy.h"
#include "base/logging.h"
#include <openssl/obj.h>
namespace net {
bool SignaturePolicy::IsAcceptableSignatureAlgorithm(
const SignatureAlgorithm& algorithm) const {
return true;
}
bool SignaturePolicy::IsAcceptableCurveForEcdsa(int curve_nid) const {
switch (curve_nid) {
case NID_X9_62_prime256v1:
case NID_secp384r1:
case NID_secp521r1:
return true;
}
return false;
}
bool SignaturePolicy::IsAcceptableModulusLengthForRsa(
size_t modulus_length_bits) const {
return modulus_length_bits >= 2048;
}
SimpleSignaturePolicy::SimpleSignaturePolicy(size_t min_rsa_modulus_length_bits)
: min_rsa_modulus_length_bits_(min_rsa_modulus_length_bits) {}
bool SimpleSignaturePolicy::IsAcceptableModulusLengthForRsa(
size_t modulus_length_bits) const {
return modulus_length_bits >= min_rsa_modulus_length_bits_;
}
} // namespace net
|