diff options
| author | Roy Marples <roy@marples.name> | 2016-11-18 13:51:50 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-11-18 13:51:50 +0000 |
| commit | 2de9a84057ca252345ef74982608291f0a879e47 (patch) | |
| tree | f3dd131343069c24955d10dd3e259896105c1e96 | |
| parent | 37940841bd17e9ec7d7bd98478cdbdce7ec2aae5 (diff) | |
| parent | c2603990c437fe70a5cf01c274c6e19c9aedb7a6 (diff) | |
| download | dhcpcd-2de9a84057ca252345ef74982608291f0a879e47.tar.xz | |
Merge fixes from dhcpcd-6 for authentication token algo.
| -rw-r--r-- | auth.c | 1 | ||||
| -rw-r--r-- | auth.h | 1 | ||||
| -rw-r--r-- | dhcpcd.conf.5.in | 5 | ||||
| -rw-r--r-- | if-options.c | 5 |
4 files changed, 9 insertions, 3 deletions
@@ -520,6 +520,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: @@ -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/dhcpcd.conf.5.in b/dhcpcd.conf.5.in index 1a2ef421..4c8d30c0 100644 --- a/dhcpcd.conf.5.in +++ b/dhcpcd.conf.5.in @@ -79,9 +79,10 @@ Authenticate DHCP messages. See the Supported Authentication Protocols section. .It Ic authtoken Ar secretid Ar realm Ar expire Ar key Define a shared key for use in authentication. -.Ar realm can be "" to for use with the +.Ar realm +can be "" to for use with the .Ar delayed -prptocol. +protocol. .Ar expire is the date the token expires and should be formatted "yyy-mm-dd HH:MM". You can use the keyword diff --git a/if-options.c b/if-options.c index c282adde..1ecf1cab 100644 --- a/if-options.c +++ b/if-options.c @@ -1902,7 +1902,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; } |
