From nobody Thu Oct 08 20:43:38 2026 X-Original-To: dev-commits-src-all@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 4j125R3y2Rz4n2Ty for ; Thu, 08 Oct 2026 20:43:39 +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 4j125R0x6Kz4bRC for ; Thu, 08 Oct 2026 20:43:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791492219; 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=R+SJfwzMEu2K/xwEb81aSWFQ7nKLx4VXT3c+911Quk8=; b=LZ3LgQ3IPGbOtpqIXs6wd2mC5bTGxlgqHRqivKqdWbUx99bVekzx0Ljq03Z+wxYmmbSj1C mv2Vy1Spx2skw0ghTottIbHFG88rFPSwXgf8YnQKKxcKB/YNhD8XCfdph3Tvvf45abiBvv ti2wwfR4s/Z21wDg/E2SAF2dWhdXLxeww0HLJfoNcV5rTrEli8LTrv8HJaA7rjV9yrm3dU MKCBy3eBoG5iwOUG8L/P7ZJlNRa29Q9MC7xGAJDO6lrVh0aCr45Kf7AtSzcFCpr6H4+Qhw JS8r1dwarAUFT+SUcb4F1l71BMpI/pD6oiLMQF90VvPmeMiRaSdaD8rO/S3H2g== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791492219; b=FspbFJx6cl+4bKsrLC/SmzulNzwbyQDfAsBI+5xiTC/fKhcPgrYkWRBIXBsjyqYnytnOBu P6hgSV9WvCMH2wgTMqqa2KXdGbFzdC3a6kt+s9MHwstnNKbJ3+Bna/B63eesAyPla6eopJ 6MPRj5wjMr3v8P+GRWf1lpgWHsubs/qQesv5wiK20qulT7fFV6LZKvqtN7gW7mDt22FCBp FCOSrENzKXqF3y0EkZGiryT4c1J1V5ytcqlHta3H4BCTp6s+AM0b1YrccD1MaW0/uLnWDl oCesfHaQyRX5J4iqzdFUDnfyQBpLRgd9FLePzuautx+2Xmd/WiSg+nbUuasN/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791492219; 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=R+SJfwzMEu2K/xwEb81aSWFQ7nKLx4VXT3c+911Quk8=; b=RM2PROX0wCaQCW5cn2JVzDwi+NT8GKNY5MvKl2hdy0gtiq4lSaOB1qT5nKzV0ddDU3Ijgf SKqY4iMD/mi2hzqoILaZ0pfnHRuaFw4UlB/LR8eX3FJMv5EIBfua/H61tYbFTbz/bmPruY HVlRiSwiuRNNftv5sjVn8MMsKppgX4miHCsxbKCRY4Wm6eUsV9RUKp98KjtIvURZHOXPV6 3bAH1FtOdy3sofRd+zIvhwHEDBuOgWITK7cTu2xGMw+aFTAXrjkM1TErH0wNRIcb31vAhc SA2bzV4QX3PjeQiROjH5RYqKxP1xi8ae+KWa6AbmCq8zN6IKC0bbqsNDhcL7hw== 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 4j125Q74w5zwTn for ; Thu, 08 Oct 2026 20:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32b9e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 08 Oct 2026 20:43:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 89b8fa55b32c - stable/15 - ppp: Permit CHAP challenges up to 255 bytes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/15 X-Git-Reftype: branch X-Git-Commit: 89b8fa55b32c57337515b526989bbad37fc717ff Auto-Submitted: auto-generated Date: Thu, 08 Oct 2026 20:43:38 +0000 Message-Id: <6ac8007a.32b9e.45975486@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=89b8fa55b32c57337515b526989bbad37fc717ff commit 89b8fa55b32c57337515b526989bbad37fc717ff Author: John Baldwin AuthorDate: 2026-06-10 13:44:10 +0000 Commit: John Baldwin CommitDate: 2026-10-08 20:42:30 +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 */