version 1.2.2.2, 2018/09/06 06:55:00 |
version 1.2.2.3, 2019/01/18 08:49:53 |
|
|
|
|
#include <config.h> |
#include <config.h> |
|
|
|
#include <stdbool.h> |
#include <stddef.h> |
#include <stddef.h> |
|
#include <inttypes.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
|
#include <isc/region.h> |
#include <isc/region.h> |
|
|
|
|
#include "dst_internal.h" |
#include "dst_internal.h" |
|
|
isc_uint16_t |
uint16_t |
dst_region_computeid(const isc_region_t *source, unsigned int alg) { |
dst_region_computeid(const isc_region_t *source, unsigned int alg) { |
isc_uint32_t ac; |
uint32_t ac; |
const unsigned char *p; |
const unsigned char *p; |
int size; |
int size; |
|
|
Line 48 dst_region_computeid(const isc_region_t |
|
Line 50 dst_region_computeid(const isc_region_t |
|
ac += ((*p) << 8); |
ac += ((*p) << 8); |
ac += (ac >> 16) & 0xffff; |
ac += (ac >> 16) & 0xffff; |
|
|
return ((isc_uint16_t)(ac & 0xffff)); |
return ((uint16_t)(ac & 0xffff)); |
} |
} |
|
|
isc_uint16_t |
uint16_t |
dst_region_computerid(const isc_region_t *source, unsigned int alg) { |
dst_region_computerid(const isc_region_t *source, unsigned int alg) { |
isc_uint32_t ac; |
uint32_t ac; |
const unsigned char *p; |
const unsigned char *p; |
int size; |
int size; |
|
|
Line 75 dst_region_computerid(const isc_region_t |
|
Line 77 dst_region_computerid(const isc_region_t |
|
ac += ((*p) << 8); |
ac += ((*p) << 8); |
ac += (ac >> 16) & 0xffff; |
ac += (ac >> 16) & 0xffff; |
|
|
return ((isc_uint16_t)(ac & 0xffff)); |
return ((uint16_t)(ac & 0xffff)); |
} |
} |
|
|
dns_name_t * |
dns_name_t * |
Line 102 dst_key_alg(const dst_key_t *key) { |
|
Line 104 dst_key_alg(const dst_key_t *key) { |
|
return (key->key_alg); |
return (key->key_alg); |
} |
} |
|
|
isc_uint32_t |
uint32_t |
dst_key_flags(const dst_key_t *key) { |
dst_key_flags(const dst_key_t *key) { |
REQUIRE(VALID_KEY(key)); |
REQUIRE(VALID_KEY(key)); |
return (key->key_flags); |
return (key->key_flags); |
Line 126 dst_key_class(const dst_key_t *key) { |
|
Line 128 dst_key_class(const dst_key_t *key) { |
|
return (key->key_class); |
return (key->key_class); |
} |
} |
|
|
isc_boolean_t |
bool |
dst_key_iszonekey(const dst_key_t *key) { |
dst_key_iszonekey(const dst_key_t *key) { |
REQUIRE(VALID_KEY(key)); |
REQUIRE(VALID_KEY(key)); |
|
|
if ((key->key_flags & DNS_KEYTYPE_NOAUTH) != 0) |
if ((key->key_flags & DNS_KEYTYPE_NOAUTH) != 0) |
return (ISC_FALSE); |
return (false); |
if ((key->key_flags & DNS_KEYFLAG_OWNERMASK) != DNS_KEYOWNER_ZONE) |
if ((key->key_flags & DNS_KEYFLAG_OWNERMASK) != DNS_KEYOWNER_ZONE) |
return (ISC_FALSE); |
return (false); |
if (key->key_proto != DNS_KEYPROTO_DNSSEC && |
if (key->key_proto != DNS_KEYPROTO_DNSSEC && |
key->key_proto != DNS_KEYPROTO_ANY) |
key->key_proto != DNS_KEYPROTO_ANY) |
return (ISC_FALSE); |
return (false); |
return (ISC_TRUE); |
return (true); |
} |
} |
|
|
isc_boolean_t |
bool |
dst_key_isnullkey(const dst_key_t *key) { |
dst_key_isnullkey(const dst_key_t *key) { |
REQUIRE(VALID_KEY(key)); |
REQUIRE(VALID_KEY(key)); |
|
|
if ((key->key_flags & DNS_KEYFLAG_TYPEMASK) != DNS_KEYTYPE_NOKEY) |
if ((key->key_flags & DNS_KEYFLAG_TYPEMASK) != DNS_KEYTYPE_NOKEY) |
return (ISC_FALSE); |
return (false); |
if ((key->key_flags & DNS_KEYFLAG_OWNERMASK) != DNS_KEYOWNER_ZONE) |
if ((key->key_flags & DNS_KEYFLAG_OWNERMASK) != DNS_KEYOWNER_ZONE) |
return (ISC_FALSE); |
return (false); |
if (key->key_proto != DNS_KEYPROTO_DNSSEC && |
if (key->key_proto != DNS_KEYPROTO_DNSSEC && |
key->key_proto != DNS_KEYPROTO_ANY) |
key->key_proto != DNS_KEYPROTO_ANY) |
return (ISC_FALSE); |
return (false); |
return (ISC_TRUE); |
return (true); |
} |
} |
|
|
void |
void |
dst_key_setbits(dst_key_t *key, isc_uint16_t bits) { |
dst_key_setbits(dst_key_t *key, uint16_t bits) { |
unsigned int maxbits; |
unsigned int maxbits; |
REQUIRE(VALID_KEY(key)); |
REQUIRE(VALID_KEY(key)); |
if (bits != 0) { |
if (bits != 0) { |
Line 166 dst_key_setbits(dst_key_t *key, isc_uint |
|
Line 168 dst_key_setbits(dst_key_t *key, isc_uint |
|
key->key_bits = bits; |
key->key_bits = bits; |
} |
} |
|
|
isc_uint16_t |
uint16_t |
dst_key_getbits(const dst_key_t *key) { |
dst_key_getbits(const dst_key_t *key) { |
REQUIRE(VALID_KEY(key)); |
REQUIRE(VALID_KEY(key)); |
return (key->key_bits); |
return (key->key_bits); |