Module Name:    src
Committed By:   roy
Date:           Wed May  2 22:08:45 UTC 2018

Modified Files:
        src/external/bsd/dhcpcd/dist/src: if-options.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/dhcpcd/dist/src/if-options.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/if-options.c
diff -u src/external/bsd/dhcpcd/dist/src/if-options.c:1.8 src/external/bsd/dhcpcd/dist/src/if-options.c:1.9
--- src/external/bsd/dhcpcd/dist/src/if-options.c:1.8	Fri Apr  6 10:47:47 2018
+++ src/external/bsd/dhcpcd/dist/src/if-options.c	Wed May  2 22:08:45 2018
@@ -1850,6 +1850,7 @@ err_sla:
 			logerrx("invalid code: %s", arg);
 			return -1;
 		}
+		fp = strskipwhite(fp);
 		if (fp) {
 			s = parse_string(NULL, 0, fp);
 			if (s == -1) {
@@ -1912,12 +1913,32 @@ err_sla:
 		}
 		if (fp)
 			*fp++ = '\0';
-		if (strcasecmp(arg, "hmacmd5") == 0 ||
-		    strcasecmp(arg, "hmac-md5") == 0)
-			ifo->auth.algorithm = AUTH_ALG_HMAC_MD5;
-		else {
-			logerrx("%s: unsupported algorithm", arg);
-			return 1;
+		if (ifo->auth.protocol == AUTH_PROTO_TOKEN) {
+			np = strchr(arg, '/');
+			if (np) {
+				if (fp == NULL || np < fp)
+					*np++ = '\0';
+				else
+					np = NULL;
+			}
+			if (parse_uint32(&ifo->auth.token_snd_secretid,
+			    arg) == -1)
+				logerrx("%s: not a number", arg);
+			else
+				ifo->auth.token_rcv_secretid =
+				    ifo->auth.token_snd_secretid;
+			if (np &&
+			    parse_uint32(&ifo->auth.token_rcv_secretid,
+			    np) == -1)
+				logerrx("%s: not a number", arg);
+		} else {
+			if (strcasecmp(arg, "hmacmd5") == 0 ||
+			    strcasecmp(arg, "hmac-md5") == 0)
+				ifo->auth.algorithm = AUTH_ALG_HMAC_MD5;
+			else {
+				logerrx("%s: unsupported algorithm", arg);
+				return 1;
+			}
 		}
 		arg = fp;
 		if (arg == NULL) {

Reply via email to