diff options
author | Damien Neil <source@isc.org> | 2000-12-09 00:10:55 +0000 |
---|---|---|
committer | Damien Neil <source@isc.org> | 2000-12-09 00:10:55 +0000 |
commit | 8c3c6552968783b0a13cce6c86bd7def0aa1489c (patch) | |
tree | b4f76cf0bb748973ea76c0efba9e171da51555f4 /dhcpctl | |
parent | a3239005104eac255d7210c5ec76a376d7ff0116 (diff) | |
download | isc-dhcp-8c3c6552968783b0a13cce6c86bd7def0aa1489c.tar.gz |
Properly add ".SIG-ALG.REG.INT." to OMAPI key algorithms.
Diffstat (limited to 'dhcpctl')
-rw-r--r-- | dhcpctl/remote.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/dhcpctl/remote.c b/dhcpctl/remote.c index 6d14807a..a7c32521 100644 --- a/dhcpctl/remote.c +++ b/dhcpctl/remote.c @@ -74,12 +74,26 @@ dhcpctl_status dhcpctl_new_authenticator (dhcpctl_handle *h, } strcpy (key -> name, name); - key -> algorithm = dmalloc (strlen (algorithm) + 1, MDL); - if (!key -> algorithm) { - omapi_auth_key_dereference (&key, MDL); - return ISC_R_NOMEMORY; + /* If the algorithm name isn't an FQDN, tack on the + .SIG-ALG.REG.NET. domain. */ + if (strchr (algorithm, '.') == 0) { + static char add[] = ".SIG-ALG.REG.INT."; + key -> algorithm = dmalloc (strlen (algorithm) + + sizeof (add), MDL); + if (!key -> algorithm) { + omapi_auth_key_dereference (&key, MDL); + return ISC_R_NOMEMORY; + } + strcpy (key -> algorithm, algorithm); + strcat (key -> algorithm, add); + } else { + key -> algorithm = dmalloc (strlen (algorithm) + 1, MDL); + if (!key -> algorithm) { + omapi_auth_key_dereference (&key, MDL); + return ISC_R_NOMEMORY; + } + strcpy (key -> algorithm, algorithm); } - strcpy (key -> algorithm, algorithm); status = omapi_data_string_new (&key -> key, secret_len, MDL); if (status != ISC_R_SUCCESS) { |