aboutsummaryrefslogtreecommitdiff
path: root/contrib/bind9/lib/dns/rdata/generic/ds_43.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bind9/lib/dns/rdata/generic/ds_43.c')
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/ds_43.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/contrib/bind9/lib/dns/rdata/generic/ds_43.c b/contrib/bind9/lib/dns/rdata/generic/ds_43.c
index fcaa69b73c0f..ee74ab67713f 100644
--- a/contrib/bind9/lib/dns/rdata/generic/ds_43.c
+++ b/contrib/bind9/lib/dns/rdata/generic/ds_43.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ds_43.c,v 1.12 2007-06-18 23:47:43 tbox Exp $ */
+/* $Id: ds_43.c,v 1.16 2010-12-23 23:47:08 tbox Exp $ */
/* draft-ietf-dnsext-delegation-signer-05.txt */
@@ -74,12 +74,20 @@ fromtext_ds(ARGS_FROMTEXT) {
/*
* Digest.
*/
- if (c == DNS_DSDIGEST_SHA1)
+ switch (c) {
+ case DNS_DSDIGEST_SHA1:
length = ISC_SHA1_DIGESTLENGTH;
- else if (c == DNS_DSDIGEST_SHA256)
+ break;
+ case DNS_DSDIGEST_SHA256:
length = ISC_SHA256_DIGESTLENGTH;
- else
+ break;
+ case DNS_DSDIGEST_GOST:
+ length = ISC_GOST_DIGESTLENGTH;
+ break;
+ default:
length = -1;
+ break;
+ }
return (isc_hex_tobuffer(lexer, target, length));
}
@@ -152,7 +160,9 @@ fromwire_ds(ARGS_FROMWIRE) {
(sr.base[3] == DNS_DSDIGEST_SHA1 &&
sr.length < 4 + ISC_SHA1_DIGESTLENGTH) ||
(sr.base[3] == DNS_DSDIGEST_SHA256 &&
- sr.length < 4 + ISC_SHA256_DIGESTLENGTH))
+ sr.length < 4 + ISC_SHA256_DIGESTLENGTH) ||
+ (sr.base[3] == DNS_DSDIGEST_GOST &&
+ sr.length < 4 + ISC_GOST_DIGESTLENGTH))
return (ISC_R_UNEXPECTEDEND);
/*
@@ -164,6 +174,8 @@ fromwire_ds(ARGS_FROMWIRE) {
sr.length = 4 + ISC_SHA1_DIGESTLENGTH;
else if (sr.base[3] == DNS_DSDIGEST_SHA256)
sr.length = 4 + ISC_SHA256_DIGESTLENGTH;
+ else if (sr.base[3] == DNS_DSDIGEST_GOST)
+ sr.length = 4 + ISC_GOST_DIGESTLENGTH;
isc_buffer_forward(source, sr.length);
return (mem_tobuffer(target, sr.base, sr.length));
@@ -213,6 +225,9 @@ fromstruct_ds(ARGS_FROMSTRUCT) {
case DNS_DSDIGEST_SHA256:
REQUIRE(ds->length == ISC_SHA256_DIGESTLENGTH);
break;
+ case DNS_DSDIGEST_GOST:
+ REQUIRE(ds->length == ISC_GOST_DIGESTLENGTH);
+ break;
}
UNUSED(type);
@@ -318,4 +333,9 @@ checknames_ds(ARGS_CHECKNAMES) {
return (ISC_TRUE);
}
+static inline int
+casecompare_ds(ARGS_COMPARE) {
+ return (compare_ds(rdata1, rdata2));
+}
+
#endif /* RDATA_GENERIC_DS_43_C */