| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_BASE_DNSSEC_CHAIN_VERIFIER_H_ | 5 #ifndef NET_BASE_DNSSEC_CHAIN_VERIFIER_H_ |
| 6 #define NET_BASE_DNSSEC_CHAIN_VERIFIER_H_ | 6 #define NET_BASE_DNSSEC_CHAIN_VERIFIER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/string_piece.h" | 12 #include "base/string_piece.h" |
| 13 #include "net/base/net_api.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 | 16 |
| 16 // DNSSECChainVerifier verifies a chain of DNSSEC records. These records | 17 // DNSSECChainVerifier verifies a chain of DNSSEC records. These records |
| 17 // eventually prove the validity of a set of resource records for the target | 18 // eventually prove the validity of a set of resource records for the target |
| 18 // name. For example, if the fingerprint of a certificate was stored in a CERT | 19 // name. For example, if the fingerprint of a certificate was stored in a CERT |
| 19 // record for a given domain, then a chain could prove the validity of that | 20 // record for a given domain, then a chain could prove the validity of that |
| 20 // fingerprint. | 21 // fingerprint. |
| 21 class DNSSECChainVerifier { | 22 class NET_TEST DNSSECChainVerifier { |
| 22 public: | 23 public: |
| 23 enum Error { | 24 enum Error { |
| 24 OK = 0, | 25 OK = 0, |
| 25 BAD_DATA, // The chain was corrupt in some fashion. | 26 BAD_DATA, // The chain was corrupt in some fashion. |
| 26 UNKNOWN_ROOT_KEY, // The chain is assuming an unknown DNS root. | 27 UNKNOWN_ROOT_KEY, // The chain is assuming an unknown DNS root. |
| 27 UNKNOWN_DIGEST, // An omitted DS record used an unknown hash function. | 28 UNKNOWN_DIGEST, // An omitted DS record used an unknown hash function. |
| 28 UNKNOWN_TERMINAL_RRTYPE, // The chain proved an unknown RRTYPE. | 29 UNKNOWN_TERMINAL_RRTYPE, // The chain proved an unknown RRTYPE. |
| 29 BAD_SIGNATURE, // One of the signature was incorrect. | 30 BAD_SIGNATURE, // One of the signature was incorrect. |
| 30 NO_DS_LINK, // a DS set didn't include the next entry key. | 31 NO_DS_LINK, // a DS set didn't include the next entry key. |
| 31 OFF_COURSE, // the chain is diverging from the target name. | 32 OFF_COURSE, // the chain is diverging from the target name. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 bool already_entered_zone_; | 102 bool already_entered_zone_; |
| 102 uint16 rrtype_; | 103 uint16 rrtype_; |
| 103 std::vector<base::StringPiece> rrdatas_; | 104 std::vector<base::StringPiece> rrdatas_; |
| 104 // A list of pointers which need to be free()ed on destruction. | 105 // A list of pointers which need to be free()ed on destruction. |
| 105 std::vector<void*> scratch_pool_; | 106 std::vector<void*> scratch_pool_; |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 } // namespace net | 109 } // namespace net |
| 109 | 110 |
| 110 #endif // NET_BASE_DNSSEC_CHAIN_VERIFIER_H_ | 111 #endif // NET_BASE_DNSSEC_CHAIN_VERIFIER_H_ |
| OLD | NEW |