15 Commits
Author SHA1 Message Date
Cy Schubert fce16f60de krb5: Fix reachable assert when importing krb5 names
If a name token contains trailing garbage, error out from
krb5_gss_import_name() instead of crashing the process with an
assertion failure.

Commit message details obtained from upstream commit.
Obtained from:	upstream commit 07818f1fd
Reported by:	Aisle Research (Ze Sheng, Dmitrijs Trizna,
		Luigino Camastra, Guido Vranken) to krb5-bugs
MFC after:	3 days
2026-06-08 06:52:04 -07:00
Cy Schubert efb5c07f91 krb5: Fix null dereference in SPNEGO token processing
krb5 1.22.1 erroneously removed a check from get_negTokenResp() for
successful decoding of the mechListMIC field.  Restore the check to
prevent a null pointer dereference.

Commit message details obtained from upstream commit.
Obtained from:	Upstream commit 4ae75cded
MFC after:	3 days
2026-06-08 06:52:04 -07:00
Cy Schubert c9dd7bffa5 krb5: Fix two NegoEx parsing vulnerabilities
Bring in upstream commit 2e75f0d93 fixing two CVEs. Upstream commit
log is:

 In parse_nego_message(), check the result of the second call to
 vector_base() before dereferencing it.  In parse_message(), check for
 a short header_len to prevent an integer underflow when calculating
 the remaining message length.

 Reported by Cem Onat Karagun.

 CVE-2026-40355:

 In MIT krb5 release 1.18 and later, if an application calls
 gss_accept_sec_context() on a system with a NegoEx mechanism
 registered in /etc/gss/mech, an unauthenticated remote attacker can
 trigger a null pointer dereference, causing the process to terminate.

 CVE-2026-40356:

 In MIT krb5 release 1.18 and later, if an application calls
 gss_accept_sec_context() on a system with a NegoEx mechanism
 registered in /etc/gss/mech, an unauthenticated remote attacker can
 trigger a read overrun of up to 52 bytes, possibly causing the process
 to terminate.  Exfiltration of the bytes read does not appear
 possible.
2026-04-30 17:11:25 -07:00
Cy Schubert 736e411a73 krb5: import MIT 1.22.2
Merge commit '90c687295e2d62f9411fc5b571f5af4e8ee187a7'
2026-04-30 17:10:53 -07:00
Mark Johnston 4c247f1204 krb5: Make the build a bit quieter
compile_et.sh is run during buildworld and prints a bunch of debug
output.  It's intrusive and probably not needed, at least by default, so
let's make the build output a bit cleaner.  This is an upstream script,
but it hasn't been modified in 15 years so the local modification is
unlikely to cause any pain.

Also remove a print that shows up in buildworld -s output.

Reviewed by:	cy
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D55317
2026-02-17 14:46:52 +00:00
Igor Ostapenko 2d9fd2c573 mit-krb5.pc: Add missing -lkrb5profile
Fixes the ports that prefer static linking:
https://reviews.freebsd.org/D49277

Reviewed by:	ivy, dch, cy
Sponsored by:	SkunkWerks, GmbH
Differential Revision:	https://reviews.freebsd.org/D52910
2025-10-11 10:20:44 +00:00
Cy Schubert 3e13aae0d1 krb5: Remove tests
Tests contains a file that contains spaces in it. This causes the
freebsd-update build scripts some issues. As we don't need the tests
directory let's simply remove it.

MFC after:	3 days or as determined by re@
MFC to:		stable/15
2025-09-22 08:42:15 -07:00
Cy Schubert 621e0e7f27 krb5: Update to 1.22.1
Reviewed by:		des
Differential revision:	https://reviews.freebsd.org/D52100

Merge commit 'e5fe63eaf1d35ebbeac17eeed04cf873fbb9b3da' into main
2025-08-26 07:33:03 -07:00
Cy Schubert 5bc59bbb48 krb5: Remove documentation
Requested by des in D52100.
2025-08-26 06:20:50 -07:00
Cy Schubert f96110babb krb5: Fix MIT KRB5 Bug #9181
According to https://krbdev.mit.edu/rt/Ticket/Display.html?id=9181,

The function verify_mic_v3() in src/lib/gssapi/krb5/verify_mic.c
calls kg_verify_checksum_v3() as it returns an OM_uint32 status
but kg_verify_checksum_v3() returns a krb5_boolean which has
the opposite interpretation:
 - OM_uint32 0 is GSS_S_COMPLETE so no error
 - krb5_boolean 0 is false so failure

This patch will be in MIT KRB5 1.22.1.

Obtained from:		Greg Hudson <[email protected]> on krbdev.mit.edu ML.
Reviewed by:		ivy, ngie
Differential review:	https://reviews.freebsd.org/D51990
2025-08-19 07:41:12 -07:00
Cy Schubert f1c4c3dacc krb5: Update MIT KRB5 from 1.21 to 1.22
Merge commit 'd82a140dad3a571d66abb2da24acbba90191f168'
2025-08-09 22:29:02 -07:00
Lexi Winter d1095367eb krb5: Rename the ALIGN macro in aestab.h
This conflicts with ALIGN() from <sys/param.h>.  Rather than trying
to excise <sys/param.h> from all of krb5, rename the macro.

Reviewed by:	des (previous version), cy
Differential Revision:	https://reviews.freebsd.org/D51574
2025-08-02 06:30:17 +01:00
Baptiste Daroussin 7b68893ffa krb5: remove libedit from the bootstrap tools
libedit breaks the bootstrap on MacOS and Linux.

Activate libedit only for the regular build not for the bootstrap
tools

While here fix the definition of the dependency chain between
libkrb5ss and libedit (and libtinfow) via src.libnames.mk

Remove a local patch to find the readline compatible header and
find them via proper CFLAGS.
2025-07-29 17:49:44 +02:00
Cy Schubert 55f9c25f17 krb5: Apply patches to build under FreeBSD
These patches fix the MIT KRB5 on FreeBSD. Some are obtained from
ports/security/krb5-121.

Sponsored by:	The FreeBSD Foundation
2025-06-04 19:53:04 -07:00
Cy Schubert 7f2fe78b9d krb5: Import MIT 1.21.3
Import MIT KRB5 1.21.3, which will gracefully replace KTH Heimdal.

The tarball used in this import is the same tarball used in
ports/krb5-121.

The Makefiles to add MIT KRB5 to the build will be added later.

Obtained from:	http://web.mit.edu/kerberos/dist/

Sponsored by:	The FreeBSD Foundation

Add 'crypto/krb5/' from commit '8f7d3ef26dec89a92ec0665de84a5936310a5574'

git-subtree-dir: crypto/krb5
git-subtree-mainline: bf6873c578
git-subtree-split: 8f7d3ef26d
2025-06-04 19:47:53 -07:00