diff options
author | Thomas Markwalder <tmark@isc.org> | 2014-09-08 11:26:57 -0400 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2014-09-08 11:26:57 -0400 |
commit | 3ffc07defb567e7789d5deb30539bddb6c46446c (patch) | |
tree | 475113048b565c8e4832ac632a2f755ac672ecc5 /omapip | |
parent | 0ce1aa94454ce9b50d592c08d7e0c559d38d3bc5 (diff) | |
download | isc-dhcp-3ffc07defb567e7789d5deb30539bddb6c46446c.tar.gz |
[master] Addes addtional HMAC TSIG algorithms to DDNS
Merges in rt36947
Diffstat (limited to 'omapip')
-rw-r--r-- | omapip/isclib.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/omapip/isclib.c b/omapip/isclib.c index 69edc2ef..3e5e1c2b 100644 --- a/omapip/isclib.c +++ b/omapip/isclib.c @@ -289,12 +289,24 @@ isclib_make_dst_key(char *inname, dns_name_t *name; dns_fixedname_t name0; isc_buffer_t b; + unsigned int algorithm_code; isc_buffer_init(&b, secret, length); isc_buffer_add(&b, length); - /* We only support HMAC_MD5 currently */ - if (strcasecmp(algorithm, DHCP_HMAC_MD5_NAME) != 0) { + if (strcasecmp(algorithm, DHCP_HMAC_MD5_NAME) == 0) { + algorithm_code = DST_ALG_HMACMD5; + } else if (strcasecmp(algorithm, DHCP_HMAC_SHA1_NAME) == 0) { + algorithm_code = DST_ALG_HMACSHA1; + } else if (strcasecmp(algorithm, DHCP_HMAC_SHA224_NAME) == 0) { + algorithm_code = DST_ALG_HMACSHA224; + } else if (strcasecmp(algorithm, DHCP_HMAC_SHA256_NAME) == 0) { + algorithm_code = DST_ALG_HMACSHA256; + } else if (strcasecmp(algorithm, DHCP_HMAC_SHA384_NAME) == 0) { + algorithm_code = DST_ALG_HMACSHA384; + } else if (strcasecmp(algorithm, DHCP_HMAC_SHA512_NAME) == 0) { + algorithm_code = DST_ALG_HMACSHA512; + } else { return(DHCP_R_INVALIDARG); } @@ -303,7 +315,7 @@ isclib_make_dst_key(char *inname, return(result); } - return(dst_key_frombuffer(name, DST_ALG_HMACMD5, DNS_KEYOWNER_ENTITY, + return(dst_key_frombuffer(name, algorithm_code, DNS_KEYOWNER_ENTITY, DNS_KEYPROTO_DNSSEC, dns_rdataclass_in, &b, dhcp_gbl_ctx.mctx, dstkey)); } |