val_kentry.h (256281) | val_kentry.h (269257) |
---|---|
1/* 2 * validator/val_kentry.h - validator key entry definition. 3 * 4 * Copyright (c) 2007, NLnet Labs. All rights reserved. 5 * 6 * This software is open source. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 7 unchanged lines hidden (view full) --- 16 * this list of conditions and the following disclaimer in the documentation 17 * and/or other materials provided with the distribution. 18 * 19 * Neither the name of the NLNET LABS nor the names of its contributors may 20 * be used to endorse or promote products derived from this software without 21 * specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 1/* 2 * validator/val_kentry.h - validator key entry definition. 3 * 4 * Copyright (c) 2007, NLnet Labs. All rights reserved. 5 * 6 * This software is open source. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 7 unchanged lines hidden (view full) --- 16 * this list of conditions and the following disclaimer in the documentation 17 * and/or other materials provided with the distribution. 18 * 19 * Neither the name of the NLNET LABS nor the names of its contributors may 20 * be used to endorse or promote products derived from this software without 21 * specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 25 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 26 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE 27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 * POSSIBILITY OF SUCH DAMAGE. | 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
34 */ 35 36/** 37 * \file 38 * 39 * This file contains functions for dealing with validator key entries. 40 */ 41 --- 28 unchanged lines hidden (view full) --- 70 * 71 * Can be in three basic states: 72 * isbad=0: good key 73 * isbad=1: bad key 74 * isbad=0 && rrset=0: insecure space. 75 */ 76struct key_entry_data { 77 /** the TTL of this entry (absolute time) */ | 34 */ 35 36/** 37 * \file 38 * 39 * This file contains functions for dealing with validator key entries. 40 */ 41 --- 28 unchanged lines hidden (view full) --- 70 * 71 * Can be in three basic states: 72 * isbad=0: good key 73 * isbad=1: bad key 74 * isbad=0 && rrset=0: insecure space. 75 */ 76struct key_entry_data { 77 /** the TTL of this entry (absolute time) */ |
78 uint32_t ttl; | 78 time_t ttl; |
79 /** the key rrdata. can be NULL to signal keyless name. */ 80 struct packed_rrset_data* rrset_data; 81 /** not NULL sometimes to give reason why bogus */ 82 char* reason; 83 /** list of algorithms signalled, ends with 0, or NULL */ 84 uint8_t* algo; 85 /** DNS RR type of the rrset data (host order) */ 86 uint16_t rrset_type; --- 77 unchanged lines hidden (view full) --- 164 * @param name: the key name 165 * @param namelen: length of name 166 * @param dclass: class of key entry. (host order); 167 * @param ttl: what ttl should the key have. relative. 168 * @param now: current time (added to ttl). 169 * @return new key entry or NULL on alloc failure 170 */ 171struct key_entry_key* key_entry_create_null(struct regional* region, | 79 /** the key rrdata. can be NULL to signal keyless name. */ 80 struct packed_rrset_data* rrset_data; 81 /** not NULL sometimes to give reason why bogus */ 82 char* reason; 83 /** list of algorithms signalled, ends with 0, or NULL */ 84 uint8_t* algo; 85 /** DNS RR type of the rrset data (host order) */ 86 uint16_t rrset_type; --- 77 unchanged lines hidden (view full) --- 164 * @param name: the key name 165 * @param namelen: length of name 166 * @param dclass: class of key entry. (host order); 167 * @param ttl: what ttl should the key have. relative. 168 * @param now: current time (added to ttl). 169 * @return new key entry or NULL on alloc failure 170 */ 171struct key_entry_key* key_entry_create_null(struct regional* region, |
172 uint8_t* name, size_t namelen, uint16_t dclass, uint32_t ttl, 173 uint32_t now); | 172 uint8_t* name, size_t namelen, uint16_t dclass, time_t ttl, 173 time_t now); |
174 175/** 176 * Create a key entry from an rrset, in the given region. 177 * @param region: where to allocate. 178 * @param name: the key name 179 * @param namelen: length of name 180 * @param dclass: class of key entry. (host order); 181 * @param rrset: data for key entry. This is copied to the region. 182 * @param sigalg: signalled algorithm list (or NULL). 183 * @param now: current time (added to ttl of rrset) 184 * @return new key entry or NULL on alloc failure 185 */ 186struct key_entry_key* key_entry_create_rrset(struct regional* region, 187 uint8_t* name, size_t namelen, uint16_t dclass, | 174 175/** 176 * Create a key entry from an rrset, in the given region. 177 * @param region: where to allocate. 178 * @param name: the key name 179 * @param namelen: length of name 180 * @param dclass: class of key entry. (host order); 181 * @param rrset: data for key entry. This is copied to the region. 182 * @param sigalg: signalled algorithm list (or NULL). 183 * @param now: current time (added to ttl of rrset) 184 * @return new key entry or NULL on alloc failure 185 */ 186struct key_entry_key* key_entry_create_rrset(struct regional* region, 187 uint8_t* name, size_t namelen, uint16_t dclass, |
188 struct ub_packed_rrset_key* rrset, uint8_t* sigalg, uint32_t now); | 188 struct ub_packed_rrset_key* rrset, uint8_t* sigalg, time_t now); |
189 190/** 191 * Create a bad entry, in the given region. 192 * @param region: where to allocate 193 * @param name: the key name 194 * @param namelen: length of name 195 * @param dclass: class of key entry. (host order); 196 * @param ttl: what ttl should the key have. relative. 197 * @param now: current time (added to ttl). 198 * @return new key entry or NULL on alloc failure 199 */ 200struct key_entry_key* key_entry_create_bad(struct regional* region, | 189 190/** 191 * Create a bad entry, in the given region. 192 * @param region: where to allocate 193 * @param name: the key name 194 * @param namelen: length of name 195 * @param dclass: class of key entry. (host order); 196 * @param ttl: what ttl should the key have. relative. 197 * @param now: current time (added to ttl). 198 * @return new key entry or NULL on alloc failure 199 */ 200struct key_entry_key* key_entry_create_bad(struct regional* region, |
201 uint8_t* name, size_t namelen, uint16_t dclass, uint32_t ttl, 202 uint32_t now); | 201 uint8_t* name, size_t namelen, uint16_t dclass, time_t ttl, 202 time_t now); |
203 204/** 205 * Obtain rrset from a key entry, allocated in region. 206 * @param kkey: key entry to convert to a rrset. 207 * @param region: where to allocate rrset 208 * @return rrset copy; if no rrset or alloc error returns NULL. 209 */ 210struct ub_packed_rrset_key* key_entry_get_rrset(struct key_entry_key* kkey, 211 struct regional* region); 212 213/** 214 * Get keysize of the keyentry. 215 * @param kkey: key, must be a good key, with contents. 216 * @return size in bits of the key. 217 */ 218size_t key_entry_keysize(struct key_entry_key* kkey); 219 220#endif /* VALIDATOR_VAL_KENTRY_H */ | 203 204/** 205 * Obtain rrset from a key entry, allocated in region. 206 * @param kkey: key entry to convert to a rrset. 207 * @param region: where to allocate rrset 208 * @return rrset copy; if no rrset or alloc error returns NULL. 209 */ 210struct ub_packed_rrset_key* key_entry_get_rrset(struct key_entry_key* kkey, 211 struct regional* region); 212 213/** 214 * Get keysize of the keyentry. 215 * @param kkey: key, must be a good key, with contents. 216 * @return size in bits of the key. 217 */ 218size_t key_entry_keysize(struct key_entry_key* kkey); 219 220#endif /* VALIDATOR_VAL_KENTRY_H */ |