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

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

Issue 1259313002: Add some policy controls for VerifySignedData(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_python
Patch Set: Address more comments Created 5 years, 4 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/signature_policy.h ('k') | net/cert/internal/verify_signed_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « net/cert/internal/signature_policy.h ('k') | net/cert/internal/verify_signed_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698