From nobody Fri Oct 09 00:20:33 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j16vj6k6Kz6Z20p for ; Fri, 09 Oct 2026 00:20:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j16vj1Km8z4LVP for ; Fri, 09 Oct 2026 00:20:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ldGygbtTMViwyAJn9wwDdmnXCW7rzfbYqoc6Obw5zO4=; b=TDkFa2qQwmvmrUcgeN4Cgy1/Rj8PSG4KvYTCHLo47GhWX8P9Js3aA6eJD64wxC9kFfPYmN hzHv2xr6quqTKwHtoVF7AyRbnQYhDUZ+BqwUXXaZ76B5a8cpA9YB+lX3pu5BBAPgn8Zp3n 75Evg4xRU8szpfD8F9dex+U7ng5nHoa9035V63C9GHNc+/hZ6fNs059jmcItj6FFJFtd4s zX7IIYNyRlh4+Y8xaMFBq07daPe9cLdHIP0HeMVD28h5EwLEC1dLoXW1b/bW6TQ5StK6Gt Cr2o4GksvqHkSEVHCrTKGcbXQqvjFfSMOCpKKzhVy7sM3VHfVCuWEIQ1G2xZRg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791505233; b=HU2D9asXxnokDoaGAh/WaPnNDuhyJKUsrxR7TzkDpnXN9Z7WHbZFBbw2QV9m+2PNt1BWEV WApnV6qGrZQB+/08OSkCphkL78bl6SpVWxMpJDZBEz/sQj/iMO3iQQnSQkZl2nog4W4VZc LkDXYvBx27B3BUumOtylaWnAnxgdgdBEyQ2rLKtXmWVuU+YpLyxCWt+QAZvsDcfHxjyIJN +rvEckRKy/AZvbqoi/coivX7mCPHhOo2XpEbBA7QU4VESlDHomVaBIe+bjMFWCmuTJXhDm GzQKl8wnWNEAUegQezFHCT/BvNwmYnWiNe3756nVC7tNHOzHHFry3A8PvXT1Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ldGygbtTMViwyAJn9wwDdmnXCW7rzfbYqoc6Obw5zO4=; b=YUsZALSG47ufMVRX+PPOk8Y2ABPL+vwOu7GwItwIMVVbScGorsN8ZCHIs23NR04A7xtHjt W9vheaNue8AhkhejaahAeHR7mo9SP8vERlZj0LDcBlKvY3kn/F4zML5C1B3kLPgaa8WaLn YwRD3DeHvuZ7f2ZCBk4AaBdc7ssUsFwQOXvTnR70WiiPelOSrNR4ZyQfpYY07qv9Jjydew +eCwGIfYuod5ar1BQE6YrFX5BEBeW7YgKC5IPIxJ/Oon+LjMgQ7Wffk/fDNGAO2KyGWdpY hMBB7pqeLkDeyYm04vu6pptjQfMCoQIqDsEzbXQrwQ9e/fS34eihcYhrDPTGQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j16vj0LzTz12dm for ; Fri, 09 Oct 2026 00:20:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1aa5b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 09 Oct 2026 00:20:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 74078264a756 - stable/14 - ppp: Permit CHAP challenges up to 255 bytes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 74078264a756d41d80e9962018b6a48b52d87cb9 Auto-Submitted: auto-generated Date: Fri, 09 Oct 2026 00:20:33 +0000 Message-Id: <6ac83351.1aa5b.6958adc0@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=74078264a756d41d80e9962018b6a48b52d87cb9 commit 74078264a756d41d80e9962018b6a48b52d87cb9 Author: John Baldwin AuthorDate: 2026-06-10 13:44:10 +0000 Commit: John Baldwin CommitDate: 2026-10-08 18:23:14 +0000 ppp: Permit CHAP challenges up to 255 bytes RFC 1994 does not place any limit on the length of the value field in challenge messages except that the length is a single octet which bounds the maximum length to 255. NB: I'm not sure why the local[] and peer[] arrays contain room for an authentication name (AUTHLEN) in addition to a challenge value/response, but I've just left that in place. PR: 271955 Reported by: Robert Morris Reviewed by: des Differential Revision: https://reviews.freebsd.org/D57138 (cherry picked from commit 7e971892dfc5aac20bd62be7817941dbaed55f42) --- usr.sbin/ppp/chap.c | 4 ++-- usr.sbin/ppp/chap.h | 4 ++-- usr.sbin/ppp/defs.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c index 9cefa6db71ce..1129aa7fb2a3 100644 --- a/usr.sbin/ppp/chap.c +++ b/usr.sbin/ppp/chap.c @@ -238,7 +238,7 @@ chap_BuildAnswer(char *name, char *key, u_char id, char *challenge MD5Init(&MD5context); MD5Update(&MD5context, &id, 1); MD5Update(&MD5context, key, klen); - MD5Update(&MD5context, challenge + 1, *challenge); + MD5Update(&MD5context, challenge + 1, (u_char)*challenge); MD5Final(digest, &MD5context); memcpy(digest + 16, name, nlen); @@ -913,7 +913,7 @@ chap_Input(struct bundle *bundle, struct link *l, struct mbuf *bp) if (myans == NULL) key = NULL; else { - if (!chap_Cmp(myans + 1, *myans, ans + 1, alen + if (!chap_Cmp(myans + 1, (u_char)*myans, ans + 1, alen #ifndef NODES , p->link.lcp.want_authtype, lanman #endif diff --git a/usr.sbin/ppp/chap.h b/usr.sbin/ppp/chap.h index f697167ab165..993ed3f060f7 100644 --- a/usr.sbin/ppp/chap.h +++ b/usr.sbin/ppp/chap.h @@ -48,8 +48,8 @@ struct chap { } child; struct authinfo auth; struct { - u_char local[CHAPCHALLENGELEN + AUTHLEN]; /* I invented this one */ - u_char peer[CHAPCHALLENGELEN + AUTHLEN]; /* Peer gave us this one */ + u_char local[CHAPCHALLENGELEN + 1 + AUTHLEN]; /* I invented this one */ + u_char peer[CHAPCHALLENGELEN + 1 + AUTHLEN]; /* Peer gave us this one */ } challenge; #ifndef NODES unsigned NTRespSent : 1; /* Our last response */ diff --git a/usr.sbin/ppp/defs.h b/usr.sbin/ppp/defs.h index c76cbd8ad9cb..31f2577a6c23 100644 --- a/usr.sbin/ppp/defs.h +++ b/usr.sbin/ppp/defs.h @@ -58,7 +58,7 @@ #define DEVICE_LEN SCRIPT_LEN /* Size of individual devices */ #define AUTHLEN 100 /* Size of authname/authkey */ #define CHAPDIGESTLEN 100 /* Maximum chap digest */ -#define CHAPCHALLENGELEN 48 /* Maximum chap challenge */ +#define CHAPCHALLENGELEN 255 /* Maximum chap challenge */ #define CHAPAUTHRESPONSELEN 48 /* Maximum chap authresponse (chap81) */ #define MAXARGS 40 /* How many args per config line */ #define NCP_IDLE_TIMEOUT 180 /* Drop all links */