summaryrefslogtreecommitdiffstats
path: root/contrib/bind/lib/dst/support.c
diff options
context:
space:
mode:
authorasmodai <asmodai@FreeBSD.org>2001-07-30 16:51:36 +0000
committerasmodai <asmodai@FreeBSD.org>2001-07-30 16:51:36 +0000
commit4764c8658fdd2787fdd421279037fe93eb05ac7c (patch)
tree575f66c4e2766172b1fb832ef43000016e089b3c /contrib/bind/lib/dst/support.c
parentc56e32d41edb68ef6a2360025bff9df4a544e5fa (diff)
downloadFreeBSD-src-4764c8658fdd2787fdd421279037fe93eb05ac7c.zip
FreeBSD-src-4764c8658fdd2787fdd421279037fe93eb05ac7c.tar.gz
Virgin import of BIND v8.2.4-REL
Diffstat (limited to 'contrib/bind/lib/dst/support.c')
-rw-r--r--contrib/bind/lib/dst/support.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/contrib/bind/lib/dst/support.c b/contrib/bind/lib/dst/support.c
index d07df5a..d191eb4 100644
--- a/contrib/bind/lib/dst/support.c
+++ b/contrib/bind/lib/dst/support.c
@@ -1,4 +1,4 @@
-static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/support.c,v 1.8 1999/10/13 16:39:24 vixie Exp $";
+static const char rcsid[] = "$Header: /proj/cvs/isc/bind8/src/lib/dst/support.c,v 1.9 2001/04/05 22:00:06 bwelling Exp $";
/*
@@ -200,7 +200,7 @@ dst_s_calculate_bits(const u_char *str, const int max_bits)
/*
- * calculates a checksum used in kmt for a id.
+ * calculates a checksum used in dst for an id.
* takes an array of bytes and a length.
* returns a 16 bit checksum.
*/
@@ -225,34 +225,27 @@ dst_s_id_calc(const u_char *key, const int keysize)
}
/*
- * dst_s_dns_key_id() Function to calculated DNSSEC footprint from KEY reocrd
- * rdata (all of record)
+ * dst_s_dns_key_id() Function to calculate DNSSEC footprint from KEY record
+ * rdata
* Input:
* dns_key_rdata: the raw data in wire format
* rdata_len: the size of the input data
* Output:
- * the key footprint/id calcuated from the key data
+ * the key footprint/id calculated from the key data
*/
u_int16_t
dst_s_dns_key_id(const u_char *dns_key_rdata, const int rdata_len)
{
- int key_data = 4;
-
- if (!dns_key_rdata || (rdata_len < key_data))
+ if (!dns_key_rdata)
return 0;
- /* check the extended parameters bit in the DNS Key RR flags */
- if (dst_s_get_int16(dns_key_rdata) & DST_EXTEND_FLAG)
- key_data += 2;
-
/* compute id */
if (dns_key_rdata[3] == KEY_RSA) /* Algorithm RSA */
return dst_s_get_int16((u_char *)
&dns_key_rdata[rdata_len - 3]);
else
/* compute a checksum on the key part of the key rr */
- return dst_s_id_calc(&dns_key_rdata[key_data],
- (rdata_len - key_data));
+ return dst_s_id_calc(dns_key_rdata, rdata_len);
}
/*
OpenPOWER on IntegriCloud