summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/authusekey.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/libntp/authusekey.c')
-rw-r--r--contrib/ntp/libntp/authusekey.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/contrib/ntp/libntp/authusekey.c b/contrib/ntp/libntp/authusekey.c
index 40dd373..c1d0813 100644
--- a/contrib/ntp/libntp/authusekey.c
+++ b/contrib/ntp/libntp/authusekey.c
@@ -1,6 +1,7 @@
/*
* authusekey - decode a key from ascii and use it
*/
+#include <config.h>
#include <stdio.h>
#include <ctype.h>
@@ -15,9 +16,6 @@
* high order bit of each byte a parity bit. "Ascii" means a 1-to-8
* character string whose ascii representation is used as the key.
*/
-
-#define KEY_TYPE_MD5 4
-
int
authusekey(
keyid_t keyno,
@@ -25,23 +23,12 @@ authusekey(
const u_char *str
)
{
- const u_char *cp;
int len;
- cp = str;
- len = strlen((const char *)cp);
- if (len == 0)
- return 0;
-
- switch(keytype) {
- case KEY_TYPE_MD5:
- MD5auth_setkey(keyno, str, (int)strlen((const char *)str));
- break;
-
- default:
- /* Oh, well */
+ len = strlen((const char *)str);
+ if (0 == len)
return 0;
- }
+ MD5auth_setkey(keyno, keytype, str, len);
return 1;
}
OpenPOWER on IntegriCloud