mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Replace custom isc_u?intNN_t types with C99 u?intNN_t types
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
@@ -197,7 +198,7 @@ dns_dnssec_sign(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_result_t ret;
|
||||
isc_buffer_t *databuf = NULL;
|
||||
char data[256 + 8];
|
||||
isc_uint32_t flags;
|
||||
uint32_t flags;
|
||||
unsigned int sigsize;
|
||||
dns_fixedname_t fnewname;
|
||||
dns_fixedname_t fsigner;
|
||||
@@ -301,7 +302,7 @@ dns_dnssec_sign(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_buffer_usedregion(&envbuf, &r);
|
||||
|
||||
for (i = 0; i < nrdatas; i++) {
|
||||
isc_uint16_t len;
|
||||
uint16_t len;
|
||||
isc_buffer_t lenbuf;
|
||||
isc_region_t lenr;
|
||||
|
||||
@@ -323,7 +324,7 @@ dns_dnssec_sign(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
*/
|
||||
isc_buffer_init(&lenbuf, &len, sizeof(len));
|
||||
INSIST(rdatas[i].length < 65536);
|
||||
isc_buffer_putuint16(&lenbuf, (isc_uint16_t)rdatas[i].length);
|
||||
isc_buffer_putuint16(&lenbuf, (uint16_t)rdatas[i].length);
|
||||
isc_buffer_usedregion(&lenbuf, &lenr);
|
||||
ret = dst_context_adddata(ctx, &lenr);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
@@ -378,7 +379,7 @@ dns_dnssec_verify(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
unsigned char data[300];
|
||||
dst_context_t *ctx = NULL;
|
||||
int labels = 0;
|
||||
isc_uint32_t flags;
|
||||
uint32_t flags;
|
||||
isc_boolean_t downcase = ISC_FALSE;
|
||||
|
||||
REQUIRE(name != NULL);
|
||||
@@ -405,10 +406,10 @@ dns_dnssec_verify(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
/*
|
||||
* Is SIG temporally valid?
|
||||
*/
|
||||
if (isc_serial_lt((isc_uint32_t)now, sig.timesigned)) {
|
||||
if (isc_serial_lt((uint32_t)now, sig.timesigned)) {
|
||||
inc_stat(dns_dnssecstats_fail);
|
||||
return (DNS_R_SIGFUTURE);
|
||||
} else if (isc_serial_lt(sig.timeexpire, (isc_uint32_t)now)) {
|
||||
} else if (isc_serial_lt(sig.timeexpire, (uint32_t)now)) {
|
||||
inc_stat(dns_dnssecstats_fail);
|
||||
return (DNS_R_SIGEXPIRED);
|
||||
}
|
||||
@@ -503,7 +504,7 @@ dns_dnssec_verify(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
isc_buffer_usedregion(&envbuf, &r);
|
||||
|
||||
for (i = 0; i < nrdatas; i++) {
|
||||
isc_uint16_t len;
|
||||
uint16_t len;
|
||||
isc_buffer_t lenbuf;
|
||||
isc_region_t lenr;
|
||||
|
||||
@@ -525,7 +526,7 @@ dns_dnssec_verify(const dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
*/
|
||||
isc_buffer_init(&lenbuf, &len, sizeof(len));
|
||||
INSIST(rdatas[i].length < 65536);
|
||||
isc_buffer_putuint16(&lenbuf, (isc_uint16_t)rdatas[i].length);
|
||||
isc_buffer_putuint16(&lenbuf, (uint16_t)rdatas[i].length);
|
||||
isc_buffer_usedregion(&lenbuf, &lenr);
|
||||
|
||||
/*
|
||||
@@ -754,7 +755,7 @@ dns_dnssec_findzonekeys(dns_db_t *db, dns_dbversion_t *ver,
|
||||
* by named. Try loading the unrevoked version.
|
||||
*/
|
||||
if (result == ISC_R_FILENOTFOUND) {
|
||||
isc_uint32_t flags;
|
||||
uint32_t flags;
|
||||
flags = dst_key_flags(pubkey);
|
||||
if ((flags & DNS_KEYFLAG_REVOKE) != 0) {
|
||||
dst_key_setflags(pubkey,
|
||||
@@ -1015,7 +1016,7 @@ dns_dnssec_verifymessage(isc_buffer_t *source, dns_message_t *msg,
|
||||
dst_context_t *ctx = NULL;
|
||||
isc_mem_t *mctx;
|
||||
isc_result_t result;
|
||||
isc_uint16_t addcount, addcount_n;
|
||||
uint16_t addcount, addcount_n;
|
||||
isc_boolean_t signeedsfree = ISC_FALSE;
|
||||
|
||||
REQUIRE(source != NULL);
|
||||
@@ -1053,12 +1054,12 @@ dns_dnssec_verifymessage(isc_buffer_t *source, dns_message_t *msg,
|
||||
}
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
if (isc_serial_lt((isc_uint32_t)now, sig.timesigned)) {
|
||||
if (isc_serial_lt((uint32_t)now, sig.timesigned)) {
|
||||
result = DNS_R_SIGFUTURE;
|
||||
msg->sig0status = dns_tsigerror_badtime;
|
||||
goto failure;
|
||||
}
|
||||
else if (isc_serial_lt(sig.timeexpire, (isc_uint32_t)now)) {
|
||||
else if (isc_serial_lt(sig.timeexpire, (uint32_t)now)) {
|
||||
result = DNS_R_SIGEXPIRED;
|
||||
msg->sig0status = dns_tsigerror_badtime;
|
||||
goto failure;
|
||||
@@ -1096,7 +1097,7 @@ dns_dnssec_verifymessage(isc_buffer_t *source, dns_message_t *msg,
|
||||
*/
|
||||
memmove(&addcount, &header[DNS_MESSAGE_HEADERLEN - 2], 2);
|
||||
addcount_n = ntohs(addcount);
|
||||
addcount = htons((isc_uint16_t)(addcount_n - 1));
|
||||
addcount = htons((uint16_t)(addcount_n - 1));
|
||||
memmove(&header[DNS_MESSAGE_HEADERLEN - 2], &addcount, 2);
|
||||
|
||||
/*
|
||||
@@ -1335,7 +1336,7 @@ get_hints(dns_dnsseckey_t *key, isc_stdtime_t now) {
|
||||
* If it hasn't already been done, we should also revoke it now.
|
||||
*/
|
||||
if (key->hint_publish && (revset && revoke <= now)) {
|
||||
isc_uint32_t flags;
|
||||
uint32_t flags;
|
||||
key->hint_sign = ISC_TRUE;
|
||||
flags = dst_key_flags(key->key);
|
||||
if ((flags & DNS_KEYFLAG_REVOKE) == 0) {
|
||||
@@ -1561,7 +1562,7 @@ mark_active_keys(dns_dnsseckeylist_t *keylist, dns_rdataset_t *rrsigs) {
|
||||
for (key = ISC_LIST_HEAD(*keylist);
|
||||
key != NULL;
|
||||
key = ISC_LIST_NEXT(key, link)) {
|
||||
isc_uint16_t keyid, sigid;
|
||||
uint16_t keyid, sigid;
|
||||
dns_secalg_t keyalg, sigalg;
|
||||
keyid = dst_key_id(key->key);
|
||||
keyalg = dst_key_alg(key->key);
|
||||
@@ -1646,7 +1647,7 @@ dns_dnssec_keylistfromrdataset(const dns_name_t *origin,
|
||||
* by named. Try loading the unrevoked version.
|
||||
*/
|
||||
if (result == ISC_R_FILENOTFOUND) {
|
||||
isc_uint32_t flags;
|
||||
uint32_t flags;
|
||||
flags = dst_key_flags(pubkey);
|
||||
if ((flags & DNS_KEYFLAG_REVOKE) != 0) {
|
||||
dst_key_setflags(pubkey,
|
||||
|
Reference in New Issue
Block a user