]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/bind9/lib/dns/rdata/generic/nsec3_50.h
MFC r363988:
[FreeBSD/stable/9.git] / contrib / bind9 / lib / dns / rdata / generic / nsec3_50.h
1 /*
2  * Copyright (C) 2008, 2011, 2012  Internet Systems Consortium, Inc. ("ISC")
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14  * PERFORMANCE OF THIS SOFTWARE.
15  */
16
17
18 #ifndef GENERIC_NSEC3_50_H
19 #define GENERIC_NSEC3_50_H 1
20
21 /* $Id$ */
22
23 /*!
24  * \brief Per RFC 5155 */
25
26 #include <isc/iterated_hash.h>
27
28 typedef struct dns_rdata_nsec3 {
29         dns_rdatacommon_t       common;
30         isc_mem_t               *mctx;
31         dns_hash_t              hash;
32         unsigned char           flags;
33         dns_iterations_t        iterations;
34         unsigned char           salt_length;
35         unsigned char           next_length;
36         isc_uint16_t            len;
37         unsigned char           *salt;
38         unsigned char           *next;
39         unsigned char           *typebits;
40 } dns_rdata_nsec3_t;
41
42 /*
43  * The corresponding NSEC3 interval is OPTOUT indicating possible
44  * insecure delegations.
45  */
46 #define DNS_NSEC3FLAG_OPTOUT 0x01U
47
48 /*%
49  * The following flags are used in the private-type record (implemented in
50  * lib/dns/private.c) which is used to store NSEC3PARAM data during the
51  * time when it is not legal to have an actual NSEC3PARAM record in the
52  * zone.  They are defined here because the private-type record uses the
53  * same flags field for the OPTOUT flag above and for the private flags
54  * below.  XXX: This should be considered for refactoring.
55  */
56
57 /*%
58  * Non-standard, private type only.
59  *
60  * Create a corresponding NSEC3 chain.
61  * Once the NSEC3 chain is complete this flag will be removed to signal
62  * that there is a complete chain.
63  *
64  * This flag is automatically set when a NSEC3PARAM record is added to
65  * the zone via UPDATE.
66  *
67  * NSEC3PARAM records containing this flag should never be published,
68  * but if they are, they should be ignored by RFC 5155 compliant
69  * nameservers.
70  */
71 #define DNS_NSEC3FLAG_CREATE 0x80U
72
73 /*%
74  * Non-standard, private type only.
75  *
76  * The corresponding NSEC3 set is to be removed once the NSEC chain
77  * has been generated.
78  *
79  * This flag is automatically set when the last active NSEC3PARAM record
80  * is removed from the zone via UPDATE.
81  *
82  * NSEC3PARAM records containing this flag should never be published,
83  * but if they are, they should be ignored by RFC 5155 compliant
84  * nameservers.
85  */
86 #define DNS_NSEC3FLAG_REMOVE 0x40U
87
88 /*%
89  * Non-standard, private type only.
90  *
91  * When set with the CREATE flag, a corresponding NSEC3 chain will be
92  * created when the zone becomes capable of supporting one (i.e., when it
93  * has a DNSKEY RRset containing at least one NSEC3-capable algorithm).
94  * Without this flag, NSEC3 chain creation would be attempted immediately,
95  * fail, and the private type record would be removed.  With it, the NSEC3
96  * parameters are stored until they can be used.  When the zone has the
97  * necessary prerequisites for NSEC3, then the INITIAL flag can be cleared,
98  * and the record will be cleaned up normally.
99  *
100  * NSEC3PARAM records containing this flag should never be published, but
101  * if they are, they should be ignored by RFC 5155 compliant nameservers.
102  */
103 #define DNS_NSEC3FLAG_INITIAL 0x20U
104
105 /*%
106  * Non-standard, private type only.
107  *
108  * Prevent the creation of a NSEC chain before the last NSEC3 chain
109  * is removed.  This will normally only be set when the zone is
110  * transitioning from secure with NSEC3 chains to insecure.
111  *
112  * NSEC3PARAM records containing this flag should never be published,
113  * but if they are, they should be ignored by RFC 5155 compliant
114  * nameservers.
115  */
116 #define DNS_NSEC3FLAG_NONSEC 0x10U
117
118 #endif /* GENERIC_NSEC3_50_H */