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/verify_certificate_chain.h" | 5 #include "net/cert/internal/verify_certificate_chain.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 | 134 |
135 return true; | 135 return true; |
136 } | 136 } |
137 | 137 |
138 // Returns true if |signature_algorithm_tlv| is a valid algorithm encoding for | 138 // Returns true if |signature_algorithm_tlv| is a valid algorithm encoding for |
139 // RSA with SHA1. | 139 // RSA with SHA1. |
140 WARN_UNUSED_RESULT bool IsRsaWithSha1SignatureAlgorithm( | 140 WARN_UNUSED_RESULT bool IsRsaWithSha1SignatureAlgorithm( |
141 const der::Input& signature_algorithm_tlv) { | 141 const der::Input& signature_algorithm_tlv) { |
142 std::unique_ptr<SignatureAlgorithm> algorithm = | 142 std::unique_ptr<SignatureAlgorithm> algorithm = |
143 SignatureAlgorithm::CreateFromDer(signature_algorithm_tlv); | 143 SignatureAlgorithm::Create(signature_algorithm_tlv, nullptr); |
144 | 144 |
145 return algorithm && | 145 return algorithm && |
146 algorithm->algorithm() == SignatureAlgorithmId::RsaPkcs1 && | 146 algorithm->algorithm() == SignatureAlgorithmId::RsaPkcs1 && |
147 algorithm->digest() == DigestAlgorithm::Sha1; | 147 algorithm->digest() == DigestAlgorithm::Sha1; |
148 } | 148 } |
149 | 149 |
150 // Returns true if |cert| has internally consistent signature algorithms. | 150 // Returns true if |cert| has internally consistent signature algorithms. |
151 // | 151 // |
152 // X.509 certificates contain two different signature algorithms: | 152 // X.509 certificates contain two different signature algorithms: |
153 // (1) The signatureAlgorithm field of Certificate | 153 // (1) The signatureAlgorithm field of Certificate |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 | 617 |
618 // TODO(eroman): RFC 5280 forbids duplicate certificates per section 6.1: | 618 // TODO(eroman): RFC 5280 forbids duplicate certificates per section 6.1: |
619 // | 619 // |
620 // A certificate MUST NOT appear more than once in a prospective | 620 // A certificate MUST NOT appear more than once in a prospective |
621 // certification path. | 621 // certification path. |
622 | 622 |
623 return true; | 623 return true; |
624 } | 624 } |
625 | 625 |
626 } // namespace net | 626 } // namespace net |
OLD | NEW |