From: Roy Marples Date: Fri, 18 Nov 2016 13:49:22 +0000 (+0000) Subject: Authentication token support should have an algo of 0. X-Git-Tag: v6.11.6~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2603990c437fe70a5cf01c274c6e19c9aedb7a6;p=thirdparty%2Fdhcpcd.git Authentication token support should have an algo of 0. --- diff --git a/auth.c b/auth.c index 4a6d7ea6..48bf04ab 100644 --- a/auth.c +++ b/auth.c @@ -514,6 +514,7 @@ dhcp_auth_encode(struct auth *auth, const struct token *t, } switch(auth->algorithm) { + case AUTH_ALG_NONE: case AUTH_ALG_HMAC_MD5: break; default: diff --git a/auth.h b/auth.h index cfc17df8..fdd92ad4 100644 --- a/auth.h +++ b/auth.h @@ -45,6 +45,7 @@ #define AUTH_PROTO_DELAYEDREALM 2 #define AUTH_PROTO_RECONFKEY 3 +#define AUTH_ALG_NONE 0 #define AUTH_ALG_HMAC_MD5 1 #define AUTH_RDM_MONOTONIC 0 diff --git a/if-options.c b/if-options.c index f08a7a87..6b88982a 100644 --- a/if-options.c +++ b/if-options.c @@ -1920,7 +1920,10 @@ err_sla: fp = strwhite(arg); if (arg == NULL) { ifo->auth.options |= DHCPCD_AUTH_SEND; - ifo->auth.algorithm = AUTH_ALG_HMAC_MD5; + if (ifo->auth.protocol == AUTH_PROTO_TOKEN) + ifo->auth.protocol = AUTH_ALG_NONE; + else + ifo->auth.algorithm = AUTH_ALG_HMAC_MD5; ifo->auth.rdm = AUTH_RDM_MONOTONIC; break; }