]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
9 days agoFix missed renames in PKINIT OpenSSL 3 changes master 1444/head
Greg Hudson [Sat, 19 Jul 2025 05:43:52 +0000 (01:43 -0400)] 
Fix missed renames in PKINIT OpenSSL 3 changes

Commit 4963edfac2ef111f3d9e6f39e589d9075a185b51 changed calls to four
OpenSSL functions to use the new preferred names, but missed two call
sites.  Reported by David Morash.

ticket: 9180

2 weeks agoRemove "Retiring DES" documentation 1443/head
Greg Hudson [Mon, 7 Jul 2025 00:17:40 +0000 (20:17 -0400)] 
Remove "Retiring DES" documentation

The "Migrating away from older encryption types" section in
enctypes.rst supersedes it.

2 weeks agoFix ccache config entry updating 1442/head
Greg Hudson [Mon, 7 Jul 2025 22:09:17 +0000 (18:09 -0400)] 
Fix ccache config entry updating

krb5_cc_set_config() originally tried to allow overwriting of existing
config keys, but after commit c0a51fe0c8051e27c6cee4f4f0c705356a715e1e
and 7783054742ddd807f7b2f7157d6ed81b7fb614eb it no longer calls
remove_cred.  Add a call back in, as we rely on config entry updating
for refresh_time in the GSS library.

ticket: 9178

2 weeks agoAvoid large numbers of refresh_time cache entries
Greg Hudson [Mon, 7 Jul 2025 21:22:47 +0000 (17:22 -0400)] 
Avoid large numbers of refresh_time cache entries

Commit 729896467e3c77904666019d6cbbda583ae49b95 amended
kg_cred_time_to_refresh() to attempt a refresh from a client keytab
when creds are close to expiration, even if no refresh_time config
entry is set (as would be the case if the creds were acquired from a
client keytab in the first place).  The added conditional sets a
refresh_time config entry, which is unhelpful as it has no
corresponding check for one.  kg_cred_time_to_refresh() is called
before can_get_initial_creds(), so we add a config entry on every
acquire_cred call when the creds are expired or close to expired, even
with no accessible keytab.  Remove the set_refresh_time() call to
avoid this inefficient behavior.

ticket: 9179 (new)
tags: pullup
target_version: 1.22-next

2 weeks agoImprove password change API docs and behavior 1441/head
Greg Hudson [Thu, 3 Jul 2025 20:49:47 +0000 (16:49 -0400)] 
Improve password change API docs and behavior

For krb5_change_password(), krb5_set_password(), and
krb5_set_password_using_ccache(), document that result_code_string may
be NULL and that the caller should free result_code_string and
result_string with krb5_free_data_contents().  Also ensure that
result_code_string and result_string are initialized along all exit
paths.  Reported by Joonas Tuomisto.

ticket: 9176 (new)

2 weeks agoAvoid undefined memcpy in asn1_encode.c
Greg Hudson [Wed, 11 Jun 2025 18:08:31 +0000 (14:08 -0400)] 
Avoid undefined memcpy in asn1_encode.c

The C standard specifies that passing null pointers to most standard
library functions results in undefined behavior (C99 7.1.4).  This
applies to memcpy() even when the length is 0.  insert_bytes() in
asn1_encode.c may be called with a null pointer from an empty
krb5_data or other counted value in a structure to be encoded.  Do not
call memcpy() in this case.

Reported by Kirill Furman.

ticket: 9175

6 weeks agoFix pkinit_server_verify_padata() error handling 1436/head
Anastasia Belova [Mon, 2 Jun 2025 09:28:49 +0000 (12:28 +0300)] 
Fix pkinit_server_verify_padata() error handling

Avoid a null deference if pkinit_init_kdc_req_context() fails to
allocate reqctx.

[ghudson@mit.edu: fixed cleanup handler to work with reqctx == NULL
instead of avoiding the cleanup handler on allocation failure]

6 weeks agoGive full list of UNIX utilities in Windows README 1438/head
Demon [Sun, 15 Jun 2025 14:46:17 +0000 (22:46 +0800)] 
Give full list of UNIX utilities in Windows README

6 weeks agoRemove libkdb_ldap null argument checks 1434/head
Greg Hudson [Thu, 12 Jun 2025 21:15:24 +0000 (17:15 -0400)] 
Remove libkdb_ldap null argument checks

libkdb_ldap contains some spotty null argument pointer checks, which
is not the project's practice outside of the GSSAPI.  Remove them.
Also remove krb5_ldap_delete_krbcontainer(), which became unused after
commit 0269810b1aec6c554fb746433f045d59fd34ab3a.

6 weeks agoAdd xrealmauthz KDC policy module and tests 1431/head
Dax Kelson [Tue, 13 May 2025 17:54:41 +0000 (11:54 -0600)] 
Add xrealmauthz KDC policy module and tests

This module provides fine-grained access control for cross-realm
authentications by checking string attributes on the incoming
cross-realm TGT entry.  It supports realm-based and principal-specific
authorization rules.

The module is not installed by the build system or loaded by default,
and is documented only in the module source code.

[ghudson@mit.edu: simplified code and tests; edited commit message]

6 weeks agoRefactor dnsglue functions using k5input 1435/head
Greg Hudson [Wed, 21 May 2025 21:11:07 +0000 (17:11 -0400)] 
Refactor dnsglue functions using k5input

Use k5input to make the dnsglue.c and dnssrv.c functions simpler and
more robust.  Rename the dnsglue functions to use the now-preferred
k5_ prefix instead of krb5int_.  Use stdint type names instead of
unsigned char and unsigned short.  Remove some out-of-date comments.

Change the query loop in k5_dns_init() to continue expanding the
buffer if the reported answer length is exactly equal to the buffer
size, as that is the observed behavior from the glibc res_nquery()
when the buffer size is too small for the answer.

6 weeks agoSimplify preauth fallback disabling 1430/head
Greg Hudson [Mon, 12 May 2025 20:21:05 +0000 (16:21 -0400)] 
Simplify preauth fallback disabling

Remove the fallback_disabled field from krb5_init_creds_context, and
instead record the current preauth type as the only allowed preauth
type when a preauth module invokes the disable_fallback() method.

The previous method failed to prevent fallback when a KDC unexpectedly
responds with PREAUTH_REQUIRED partway through the preauth exchange.
Reported by Richard Silverman.

2 months agoFix crash on empty TXT records 1432/head
David Zhou [Fri, 24 May 2024 02:40:06 +0000 (02:40 +0000)] 
Fix crash on empty TXT records

In k5_try_realm_txt_rr(), error out if the first text string in a TXT
record is empty or if its length exceeds the record length.

This function is only used when dns_lookup_realm is set to true in
krb5.conf.  An alternative implementation is used on Windows.

[ghudson@mit.edu: moved zero-length check and added upper bound check;
rewrote commit message]

ticket: 9174 (new)

2 months agoUpdate copyright years to 2025
Greg Hudson [Tue, 6 May 2025 20:01:35 +0000 (16:01 -0400)] 
Update copyright years to 2025

2 months agoUpdates for krb5-1.23-prerelease
Greg Hudson [Tue, 6 May 2025 02:31:22 +0000 (22:31 -0400)] 
Updates for krb5-1.23-prerelease

2 months agomake regen
Greg Hudson [Sun, 4 May 2025 04:15:44 +0000 (00:15 -0400)] 
make regen

Also fix SRCS in util/support/Makefile.in to name regex.cpp and not
regex.c.

2 months agoUpdate features list for 1.22 (again)
Greg Hudson [Fri, 2 May 2025 21:14:02 +0000 (17:14 -0400)] 
Update features list for 1.22 (again)

3 months agoClarify X509_user_identity documentation 1428/head
Greg Hudson [Fri, 18 Apr 2025 16:23:10 +0000 (12:23 -0400)] 
Clarify X509_user_identity documentation

Document that PKINIT identity specifier values must not contain
colons.

ticket: 9154

3 months agoFix kdb5_util ark with no -e option 1427/head
Greg Hudson [Fri, 18 Apr 2025 06:59:33 +0000 (02:59 -0400)] 
Fix kdb5_util ark with no -e option

Avoid passing NULL to krb5_string_to_keysalt() in add_random_key().
When add_random_key() was first written, krb5_string_to_keysalts() did
nothing on a null string input.  After commit
3576bd662be9b7cc2cca97065fe467e745542b69 it calls strdup(NULL) and
crashes.

3 months agoUpdate edwards25519 fiat code from BoringSSL 1426/head
Greg Hudson [Thu, 17 Apr 2025 02:04:58 +0000 (22:04 -0400)] 
Update edwards25519 fiat code from BoringSSL

Bring the SPAKE edwards25519_fiat.h up to date with BoringSSL commit
5813c2c10c73d800f1b0d890a7d74ff973abbffc.  This update adds value
barriers to the conditional move functions, to prevent clang
optimizations that would make them not constant-time.

Update the path reference comments in edwards25519.c and
edwards25519_tables.h, but do not update the code as the upstream
license has changed.

3 months agoOnly set SO_REUSEPORT on macOS 1429/head
Greg Hudson [Wed, 23 Apr 2025 21:19:46 +0000 (17:19 -0400)] 
Only set SO_REUSEPORT on macOS

Recent versions of the Linux kernel (after commit
5b0af621c3f6ef9261cf6067812f2fd9943acb4b) return -1 with errno set to
EOPNOTSUPP when a process attempts to set SO_REUSEPORT on a UNIX
domain socket.  We started setting this flag in commit
c423f13cc2f3fbdbf48390535cb1629b99b0eb27 to work around a test suite
issue on macOS.  Restrict setting SO_REUSEPORT to macOS to avoid
unnecessary interactions with its behavior on other platforms.

3 months agoLimit -keepold for self-service key changes 1425/head
Greg Hudson [Mon, 14 Apr 2025 06:16:10 +0000 (02:16 -0400)] 
Limit -keepold for self-service key changes

In libkadm5, change the type of the keepold parameters from
krb5_boolean to unsigned int (which is the underlying type of
krb5_boolean, so this is not an API or ABI change).  In libkadm5srv,
interpret a keepold value greater than 2 to be a limit on the number
of resulting key versions including the new one.

In kadmind, when a principal changes its own keys, limit the number of
resulting key versions to 5.

ticket: 9173 (new)

3 months agoFix correctness in LDAP delegation ACL checking 1424/head
Greg Hudson [Fri, 11 Apr 2025 06:14:57 +0000 (02:14 -0400)] 
Fix correctness in LDAP delegation ACL checking

The LDAP KDB module synthesizes KRB5_TL_CONSTRAINED_DELEGATION_ACL
tl-data when fetching a principal entry, and checks against those
values in krb5_ldap_check_allowed_to_delegate().  To avoid a locally
incorrect use of a counted data type, adjust the synthesized
attributes to include the trailing zero byte in tl_data_length, and
verify the zero terminator before calling krb5_parse_name() on the
value.

3 months agoFix conditional in kadm5_chpass_principal_3() 1423/head
Greg Hudson [Thu, 10 Apr 2025 00:22:15 +0000 (20:22 -0400)] 
Fix conditional in kadm5_chpass_principal_3()

Ensure that kadm5_chpass_principal_3() does not reference pol or hist
when the principal has a policy reference but the policy does not
exist.  (Both structures are zeroed in this case, so the resulting
checks are pointless but have defined and harmless behavior.)

3 months agoCheck lengths in xdr_krb5_key_data()
Greg Hudson [Thu, 10 Apr 2025 00:19:02 +0000 (20:19 -0400)] 
Check lengths in xdr_krb5_key_data()

Ensure that xdr_krb5_key_data() does not produce an inconsistent
representation if the serialized key_data_contents fields do not match
the corresponding byte array lengths.  (This function is only used by
libkadm5srv to serialize historical key data in per-principal kadmin
data.)

ticket: 9172 (new)

3 months agoOnly handle IAKERB errors in initiator step 1421/head
Andreas Schneider [Fri, 4 Apr 2025 10:04:00 +0000 (12:04 +0200)] 
Only handle IAKERB errors in initiator step

iakerb_initiator_step() must pass through most KRB-ERROR messages in
order to properly handle recoverable AS and TGS errors such as
KDC_ERR_PREAUTH_REQUIRED.  Only stop on IAKERB errors.

[ghudson@mit.edu: changed code to check for com_err codes instead of
protocol codes; changed iakerb_acceptor_realm() to respond with an
IAKERB error when realm determination fails and modified test case
accordingly; added a test case by requiring preauth on the user
principal when testing IAKERB; rewrote commit message]

ticket: 9169

3 months agoFix typo in AS-REQ client code
Richard E. Silverman [Fri, 4 Apr 2025 02:09:11 +0000 (22:09 -0400)] 
Fix typo in AS-REQ client code

Add a missing "else" to init_creds_step_request().  The mistake was
harmless because optimistic preauth can only be present for the first
step, and the other conditions can only be true after the state
machine has processed an error reply.

[ghudson@mit.edu: rewrote commit message]

3 months agoFix getsockname() call in Windows localaddr 1418/head
Rull Deef [Thu, 27 Mar 2025 07:54:46 +0000 (10:54 +0300)] 
Fix getsockname() call in Windows localaddr

When querying local IP addresses, local_addr_fallback_kludge() is
called on Windows if gethostname() or gethostbyname() fails.  This
function's call to getsockname() erroneously passes a small integer as
the third argument instead of a pointer, likely causing a process
crash.  This bug has been present since 1.1, but is rarely encountered
due to the rarity of requests for addressful tickets.  Fix it.

[ghudson@mit.edu: rewrote commit message]

ticket: 9171 (new)

3 months agoAvoid gss_inquire_attrs_for_mech() null outputs 1419/head
Greg Hudson [Mon, 31 Mar 2025 23:01:54 +0000 (19:01 -0400)] 
Avoid gss_inquire_attrs_for_mech() null outputs

gss_inquire_attrs_for_mech() can return successfully with *mech_attrs
or *known_mech_attrs set to GSS_C_NO_OID_SET, which is at best
inconvenient as gss_test_oid_set_member() does not allow
GSS_C_NO_OID_SET as an input.  Create empty sets instead.

ticket: 9170 (new)

3 months agoFix IAKERB error handling 1417/head
Greg Hudson [Tue, 25 Mar 2025 20:09:28 +0000 (16:09 -0400)] 
Fix IAKERB error handling

KRB-ERROR has non-optional realm and sname fields, so we must set a
server field in the krb5_error object before calling krb5_mk_error().

Add KRB-ERROR processing to the initiator state machine.

ticket: 9169 (new)

4 months agoFix IAKERB accept_sec_context null pointer crash 1416/head
Alexander Bokovoy [Fri, 21 Mar 2025 07:52:47 +0000 (09:52 +0200)] 
Fix IAKERB accept_sec_context null pointer crash

When iakerb_gss_accept_sec_context() processes an initial token which
is not an IAKERB token (because the client already has a service
ticket), set *context_handle.  Otherwise subsequent GSS calls using
this context will dereference a null pointer and crash.

[ghudson@mit.edu: moved fix to cleanup handler to avoid code
duplication; added tests; rewrote commit message]

ticket: 9168 (new)

4 months agoAdd initiator-side IAKERB realm discovery 1415/head
Alexander Bokovoy [Mon, 10 Mar 2025 07:40:37 +0000 (09:40 +0200)] 
Add initiator-side IAKERB realm discovery

When importing a name to IAKERB, don't add the default realm when we
parse strings.  Host-based name imports will continue to use
krb5_sname_to_principal(), which may add a realm from [domain_realm]
but won't add the default realm.

In the IAKERB state machine, query for the service's realm if the
client name doesn't have a realm.  To reduce code duplication, make
iakerb_make_token() responsible for saving the token and incrementing
the message count.

[ghudson@mit.edu: added tests; added a discovery state to the machine;
expanded import; adjusted iakerb_make_token() contract; rewrote commit
message]

ticket: 9167 (new)

4 months agoAdd PKINIT paChecksum2 from MS-PKCA v20230920 1411/head
Julien Rische [Tue, 14 Jan 2025 12:31:11 +0000 (13:31 +0100)] 
Add PKINIT paChecksum2 from MS-PKCA v20230920

In 2023, Microsoft updated MS-PKCA to add the optional paChecksum2
element in the PKAuthenticator sequence.  This checksum accepts SHA-1,
SHA-256, SHA-384, and SHA-512 digests.

In Windows Server 2025, this checksum becomes mandatory when using
PKINIT with FFDH (but strangely not with ECDH if SHA-1 is configured as
allowed).

[ghudson@mit.edu: refactored crypto interfaces to reduce complexity of
calling code]

ticket: 9166 (new)

4 months agoDisplay NetBIOS ticket addresses in klist 1413/head
Ivan Korytov [Wed, 5 Mar 2025 12:30:10 +0000 (15:30 +0300)] 
Display NetBIOS ticket addresses in klist

[ghudson@mit.edu: simplified code]

ticket: 9165 (new)

4 months agoUse k5_path_join() in krb5int_open_plugin_dirs() 1412/head
Ken Hornstein [Sun, 2 Mar 2025 04:02:58 +0000 (23:02 -0500)] 
Use k5_path_join() in krb5int_open_plugin_dirs()

Simplify and improve the portability of krb5int_open_plugin_dirs()
using k5_path_join().  (There is no immediate practical benefit as
this function is only used to find kdb5, authdata, and locate plugin
modules.)

[ghudson@mit.edu: further simplified code; edited commit message]

5 months agoBuild PKINIT on Windows 1401/head
Ken Hornstein [Fri, 6 Dec 2024 20:29:33 +0000 (15:29 -0500)] 
Build PKINIT on Windows

Include PKINIT in the Windows build if OPENSSL_DIR is set.

In the installer, require PKINIT to be built, and require
OPENSSL_VERSION to be set in the environment.  Include the PKINIT
module and a copy of the OpenSSL libcrypto DLL.

Document the OpenSSL dependency in windows/README.  Also clarify the
Visual Studio dependencies, and restore the prep-windows build step
which was accidentally removed by commit
5f33fb2cf19562175c8271cb9c54a67212f63b93.

[ghudson@mit.edu: added CI and installer integration; edited README
and commit message]

ticket: 9162 (new)

5 months agoAdd database format documentation 1408/head
Greg Hudson [Tue, 21 Jan 2025 03:47:54 +0000 (22:47 -0500)] 
Add database format documentation

Add a new file under doc/formats documenting the dump format, tl-data
formats, alias principals, and the DB2 and LMDB principal and policy
formats.

Also correct some formatting in cookie.rst, changing a nested list to
a code block for consistency with other documentation of binary
formats.

ticket: 9164 (new)

5 months agoAdd alias support 1393/head
Greg Hudson [Wed, 15 Jan 2025 02:25:51 +0000 (21:25 -0500)] 
Add alias support

Add a new kadmin command add_alias.  Implement it for DB2 and LMDB by
writing stub principal entries with a tl-data entry giving the target
name.  Add libkdb5 functions to create and interpret alias entries.
Handle these stub entries in krb5_db_get_principal(), iteratively
resolving aliases up to a depth of 10.

To allow kadm5_delete_principal() to work on aliases, remove the code
that fetches the entry prior to deletion; it was needed before commit
0780e46fc13dbafa177525164997cd204cc50b51 to decrement the policy
reference count, but now serves no purpose.  Adjust kdb_delete_entry()
to translate KRB5_KDB_NOENTRY instead of ignoring it, as we still want
to return KADM5_UNK_PRINC when deleting a nonexistent principal name.

Modify the LDAP KDB module to work with alias entries.  In
krb5_ldap_put_principal(), recognize stub alias entries and add an
alias to the object for the target principal.  In
krb5_ldap_delete_principal(), don't delete the LDAP object when
deleting an alias name.  In krb5_ldap_iterate(), generate stub entries
for each alias name in addition to the populated entry for the
canonical name.  A small amount of refactoring was done as part of
this work: the LDAP-specific principal name parsing and unparsing
functions were simplified, and a helper function search_princ() was
added to find the LDAP object for a principal name.

In kdb5_util tabdump, add a dump type "alias" to display a list of
aliases in the database.

Based on work by Alexander Bokovoy.

5 months agoRemove 32-bit build from KfW installer 1405/head
Greg Hudson [Wed, 18 Dec 2024 19:52:28 +0000 (14:52 -0500)] 
Remove 32-bit build from KfW installer

In src/windows/README, document only the steps for a 64-bit build.  In
the installer, expect only 64-bit binaries.  In the CI, perform only a
64-bit Windows build, and split up the build into three steps so that
build failures are easier to understand.

5 months agoImprove ulog block resize efficiency 1410/head
Zoltan Borbely [Fri, 31 Jan 2025 17:00:17 +0000 (18:00 +0100)] 
Improve ulog block resize efficiency

When it is necessary to increase the ulog block size, copy the
existing entries instead of reinitializing the log.

[ghudson@mit.edu: added test case; renamed and split INDEX() to avoid
duplication; added sync_ulog() helper; modified copying loop for
clarity; edited commit message]

ticket: 9161 (new)

5 months agoAllow only one salt type per enctype in key data 1409/head
Greg Hudson [Wed, 29 Jan 2025 05:22:57 +0000 (00:22 -0500)] 
Allow only one salt type per enctype in key data

In the default libkdb5 password change method, omit requested key/salt
combinations that duplicate an earlier encryption type, even if they
have a different salt type.  Any use cases for multiple salts for the
same enctype disappeared with single-DES support.  (We already have
this behavior for chrand requests.)

ticket: 9160 (new)

5 months agoAdd support for systemd socket activation 1400/head
Andreas Schneider [Wed, 20 Nov 2024 17:17:29 +0000 (18:17 +0100)] 
Add support for systemd socket activation

If LISTEN_PID and LISTEN_FDS are set in the environment, expect
listener sockets to be present at fds starting at 3.  If any match a
configured listener address and port, use it instead of creating a new
socket.

[ghudson@mit.edu: combined two commits; changed sa_compare() to
sa_equal(); restructured changes to fetch listener sockets into a list
once and to match on socket type as well as address; added tests]

ticket: 9157 (new)

6 months agoPrevent overflow when calculating ulog block size
Zoltan Borbely [Tue, 28 Jan 2025 21:39:25 +0000 (16:39 -0500)] 
Prevent overflow when calculating ulog block size

In kdb_log.c:resize(), log an error and fail if the update size is
larger than the largest possible block size (2^16-1).

CVE-2025-24528:

In MIT krb5 release 1.7 and later with incremental propagation
enabled, an authenticated attacker can cause kadmind to write beyond
the end of the mapped region for the iprop log file, likely causing a
process crash.

[ghudson@mit.edu: edited commit message and added CVE description]

ticket: 9159 (new)
tags: pullup
target_version: 1.21-next

6 months agoSet missing mask flags for kdb5_util operations 1364/head
Julien Rische [Thu, 1 Aug 2024 08:56:07 +0000 (10:56 +0200)] 
Set missing mask flags for kdb5_util operations

Set KADM5_TL_DATA for the use_mkey and update_princ_encryption
commands.  (Commit c877f13c8985d820583b0d7ac1bb4c5dc36e677e did this
for the add_new_mkey and purge_mkeys commands.)  Set appropriate flags
for the add_random_key command.

[ghudson@mit.edu: combined two commits; pruned out proposed mask flag
additions for values represented within key data or tl-data (like
KADM5_MKVNO), as those flags are currently only used in the kadm5
protocol, not to communicate with the KDB module]

ticket: 9158 (new)

6 months agoWork around Debian cyrus-sasl2 leak in t_kdb.py 1406/head
Greg Hudson [Mon, 30 Dec 2024 01:30:56 +0000 (20:30 -0500)] 
Work around Debian cyrus-sasl2 leak in t_kdb.py

A Debian patch to cyrus-sasl2 causes a memory leak in the DIGEST-MD5
plugin.  To avoid CI failures in the asan build, suppress leak
detection during the DIGEST-MD5 tests for now.

6 months agoWork around llvm-symbolizer LD_LIBRARY_PATH issue
Greg Hudson [Mon, 23 Dec 2024 22:16:00 +0000 (17:16 -0500)] 
Work around llvm-symbolizer LD_LIBRARY_PATH issue

On some platforms llvm-symbolizer is linked against libcurl, which
depends on the krb5 libraries.  When the test suite runs programs with
LD_LIBRARY_PATH pointed at asan-compiled krb5 libraries,
llvm-symbolizer will encounter a dynamic linker error at startup,
interfering with the display of stack traces.

In k5test.py, when the build enables asan, wrap the platform's
symbolizer in a script that unsets LD_LIBRARY_PATH (or similar) and
then runs the real llvm-symbolizer.

6 months agoRemove redundant check in acquire_cred_from() 1407/head
Julien Rische [Wed, 8 Jan 2025 11:36:07 +0000 (12:36 +0100)] 
Remove redundant check in acquire_cred_from()

When processing KRB5_CS_PASSWORD_URN, only check for null desired_name
once.

[ghudson@mit.edu: edited commit message]

7 months agoAdd regexp support on Windows using std::regex
Ken Hornstein [Sat, 30 Nov 2024 01:34:53 +0000 (20:34 -0500)] 
Add regexp support on Windows using std::regex

Provide glue code in libkrb5support to emulate the POSIX regex(3)
interface by calling into the C++ std::regex classes.

Eliminate compatibility code for pre-POSIX regex functions.

[ghudson@mit.edu: additional cleanup of regexp callers; minor style
adjustments; removed regerrlen field; edited commit message]

7 months agoFix CI errors on Ubuntu 24.04 1404/head
Greg Hudson [Fri, 20 Dec 2024 06:51:24 +0000 (01:51 -0500)] 
Fix CI errors on Ubuntu 24.04

Supress a warning in the parser generated by Bison from x-deltat.y.
Convert krb5_ldap_get_age() to use a prototype.  Fix memory leaks in
the ASN.1 tests.  Check errflg after argument parsing in kdc5_hammer.

Pin the linux-clang job to Ubuntu 22.04 until we can work around an
llvm-symbolizer issue which causes test suite failures.

7 months agoRemove use of -entry flag for DLLs on Windows 1403/head
Ken Hornstein [Thu, 12 Dec 2024 17:56:52 +0000 (12:56 -0500)] 
Remove use of -entry flag for DLLs on Windows

Remove the use of the -entry flag to specify a DLL entry point on
Windows, as it is no longer recommended.  The default Windows entry
point will call a DllMain() function if one is provided; use that name
in kfwlogon instead of DllEntryPoint().

[ghudson@mit.edu: edited commit message]

7 months agoDefault kdc_tcp_listen to kdc_listen value 1398/head
Greg Hudson [Mon, 2 Dec 2024 19:11:38 +0000 (14:11 -0500)] 
Default kdc_tcp_listen to kdc_listen value

If kdc_tcp_listen is not specified in the realm or in [kdcdefaults],
use the same listeners as were given for UDP instead of separately
defaulting to port 88.  This change makes the kdc_listen and
kpasswd_listen more consistent, while still allowing UDP and TCP
listening to be separately configured when required for the KDC.

ticket: 9152 (new)

7 months agoFix t_ctxprf.c to return 0 from main
Greg Hudson [Thu, 12 Dec 2024 03:37:05 +0000 (22:37 -0500)] 
Fix t_ctxprf.c to return 0 from main

Add a missing return at the end of main to the end of the test program
added in commit 0a3acc20564e82ba33741248cf25ca4d085d777f.

ticket: 9121

7 months agoAllow KDB module stacking 1396/head
Andreas Schneider [Fri, 29 Nov 2024 10:04:00 +0000 (11:04 +0100)] 
Allow KDB module stacking

Add an API krb5_db_load_module() to cause the KDB handle for a context
to use a specified KDB module instead of the configured one.

[ghudson@mit.edu: Renamed new API; added comment; wrote commit
message.  Also contains work by Alexander Bokovoy.]

ticket: 9156 (new)

7 months agoAdd support for UNIX domain sockets 1359/head
Andreas Schneider [Tue, 9 Jul 2024 09:38:26 +0000 (11:38 +0200)] 
Add support for UNIX domain sockets

Make the KDC and kadmind listen on UNIX domain sockets if any are
listed in kdc_listen, kadmind_listen, or kpasswd_listen.  Send KDC and
kpasswd requests on UNIX domain sockets if any are listed in the kdc
and primary_kdc realm variables.

[ghudson@mit.edu: combined several commits; simplified client side by
treating UNIX domain socket entries like module-generated addresses;
edited commit message]

ticket: 9155

7 months agoAdd underpinnings of UNIX domain socket support
Andreas Schneider [Tue, 9 Jul 2024 09:32:34 +0000 (11:32 +0200)] 
Add underpinnings of UNIX domain socket support

Add sa2sun() and ss2sun() helpers to socket-utils.h.  Add UNIX domain
socket support to sa_socklen() and print_addr().  Expand buffers for
printing addresses to 128 bytes to accomodate the maximum UNIX domain
socket path length.

Add loop_add_unix_socket() to net-server.c, primarily using the
existing TCP support (renamed to "stream").

As there is no standard Kerberos address type for UNIX domain sockets,
add basic directional address support.  Add a definition for
ADDRTYPE_DIRECTIONAL in krb5.h.  Add private constant krb5_address
objects to libkrb5 for initiator and acceptor directional addresses.
Use directional addresses for the KRB-SAFE/KRB-PRIV source address in
the kprop and password change protocols when the transport is not IPv4
or IPv6.

krb5_address objects are used for auditing purposes in the KDC audit
and KDB pluggable interfaces.  Add a local-use address type
ADDRTYPE_UNIXSOCK for use in these cases.  Add a flag to
k5_sockaddr_to_address() to indicate whether this address type can be
used.  Add UNIX domains socket conversion support to the test audit
plugin module.

[ghudson@mit.edu: combined several commits; used directional addresses
for KRB-SAFE/KRB-PRIV; reduced duplication in net-server.c support;
wrote commit message.  Also based on work by Alexander Bokovoy.]

ticket: 9155

7 months agoRefactor libapputils handling of socket addresses
Greg Hudson [Thu, 14 Nov 2024 03:51:20 +0000 (22:51 -0500)] 
Refactor libapputils handling of socket addresses

Add private libkrb5 APIs for sockaddr-to-krb5-address conversion and
for printing socket addresses.  Use them in the KDC, kadmind,
kprop/kpropd, and trace logging.

In net-server.c, do not convert the local and remote socket addresses
to krb5_address; instead pass them directly to dispatch().  Convert
the addresses where needed in the KDC and kadmind.

7 months agoRemove unused GSS mechglue source file 1402/head
Greg Hudson [Sun, 8 Dec 2024 06:39:23 +0000 (01:39 -0500)] 
Remove unused GSS mechglue source file

The functions in g_mechname.c have been unused since release 1.5.
Remove the file.

7 months agoFix minor logic errors 1392/head
Greg Hudson [Sun, 17 Nov 2024 18:54:12 +0000 (13:54 -0500)] 
Fix minor logic errors

In k5_externalize_auth_context(), serialize the correct field when
remote_port is set.  This is not a reachable bug because the function
is only accessible via gss_export_sec_context(), and the GSS library
does not set a remote port.

In generic_gss_oid_to_str(), remove an inconsistently-applied test for
a null minor_status.  Also remove minor_status null checks from
generic_gss_release_oid() and generic_gss_str_to_oid(), but add output
initializations and pointer checks to the API functions in g_oid_ops.c
in a similar manner to other GSSAPI functions.  Remove
gssint_copy_oid_set() and replace its one call with a call to
generic_gss_copy_oid_set().

In the checksum functions, avoid crashing if the caller passes a null
key and checksum type 0.  An error will be returned instead when
find_cksumtype() can't find the checksum type.
(krb5_k_verify_checksum() already had this check.)

In pkinit_open_session(), remove an unnecessary null check for
ctx->p11_module_name, and add a check for p11name being null due to an
asprintf() failure.

In profile_add_node(), add a check for null ret_node in the duplicate
subsection check.  This is not a reachable bug because the function is
currently never called with null ret_node and null value.

In ksu's main(), check for krb5_cc_default_name() returning NULL
(which only happens on allocation failure).  Also clean up some
vestiges left behind by commit
9ebae7cb434b9b177c0af85c67a6d6267f46bc68.

In ksu's get_authorized_princ_names(), close login_fp if we fail to
open k5users_path.

In the KDC and kpropd write_pid_file(), avoid briefly leaking the file
handle on write failure.

Reported by Valery Fedorenko.

7 months agoFix Windows regression in k5_make_uri_query() 1399/head
Ken Hornstein [Wed, 4 Dec 2024 02:54:35 +0000 (21:54 -0500)] 
Fix Windows regression in k5_make_uri_query()

Commit d035119c3b2b402f3ad49a4c7b6264826ea923bb introduced an extra
parameter to the function k5_make_uri_query(), but did not add that
parameter to the Windows stub version of this function, causing a null
pointer exception when this function was called.  Add the parameter
now.

[ghudson@mit.edu: edited commit message]

7 months agoFix LDAP module leak on authentication error 1395/head
Feng Guo [Thu, 28 Nov 2024 13:32:37 +0000 (21:32 +0800)] 
Fix LDAP module leak on authentication error

In initialize_server(), unbind the server handle if authenticate()
fails.

[ghudson@mit.edu: rewrote commit message]

ticket: 9153 (new)

7 months agoCheck for sys/random.h 1397/head
Ken Hornstein [Fri, 29 Nov 2024 21:32:06 +0000 (16:32 -0500)] 
Check for sys/random.h

The function getentropy() is supported on newer versions of MacOS X,
but requires the include file sys/random.h.  Check for that and include
it where getentropy() is used.

ticket: 9149

8 months agoConstify some socket-utils.h functions
Greg Hudson [Mon, 18 Nov 2024 23:45:16 +0000 (18:45 -0500)] 
Constify some socket-utils.h functions

Accept constant pointers in sa_getport(), sa_is_inet(),
sa_is_wildcard(), and sa_socklen().

Make sa2sin() and sa2sin6() accept and return constant pointers.  For
the most part we write to sockaddr_storage and read from sockaddr.
The biggest exception is udppktinfo.c; adjust its internal APIs to use
sockaddr_storage for output and inferred lengths for input.  All of
the other exceptions use sa_setport().

8 months agoAdd kadmind support for disabling listening
Andreas Schneider [Fri, 8 Nov 2024 08:57:59 +0000 (09:57 +0100)] 
Add kadmind support for disabling listening

Currently setting kdc_listen or kdc_tcp_listen to the empty string
disables listening for UDP and TCP connections respectively, but
setting kadmind_listen or kpasswd_listen to the empty string listens
on the wildcard address.  Make the behavior consistent by changing
loop_add_addresses() to add no listeners when the string contains no
tokens.  Remove the conditionals from the KDC code.

Document the new behavior of kadmind_listen and kpasswd_listen, and
the existing behavior of kdc_listen.

[ghudson@mit.edu: simplified loop_add_addresses(); combined several
commits and rewrote commit message]

ticket: 9151 (new)

8 months agoRemove missing SecurID header file 1390/head
Ken Hornstein [Wed, 13 Nov 2024 18:48:28 +0000 (13:48 -0500)] 
Remove missing SecurID header file

It turns out the SecurID SDK no longer provides sdi_athd.h, so
remove our include of it.

8 months agoUpdate upload-artifact version in cifuzz.yml
Greg Hudson [Thu, 14 Nov 2024 04:13:37 +0000 (23:13 -0500)] 
Update upload-artifact version in cifuzz.yml

Commit 177d750222b758f5f5769c727340d12bfcd79488 missed a use of
upload-artifact@v3.  Update it now.

8 months agoRemove ovload.c 1388/head
Greg Hudson [Fri, 1 Nov 2024 17:45:15 +0000 (13:45 -0400)] 
Remove ovload.c

Commit 23b93fd48bc445005436c5be98a7269b599b1800 removed the only
caller of process_ov_record(), but left behind the code.  Remove it
now.

8 months agoFix various small logic errors
Greg Hudson [Fri, 1 Nov 2024 17:42:44 +0000 (13:42 -0400)] 
Fix various small logic errors

Correct five logic errors (all unlikely to manifest as user-visible
bugs) found by static analysis.  Reported by Valery Fedorenko.

8 months agoPrevent undefined shift in decode_krb5_flags() 1389/head
Greg Hudson [Wed, 6 Nov 2024 22:31:37 +0000 (17:31 -0500)] 
Prevent undefined shift in decode_krb5_flags()

In the statement "f |= bits[i] << (8 * (3 - i))", bits[i] is
implicitly promoted from uint8_t to int according to the integer
promotion rules (C99 6.3.1.1).  If i is 0 and bits[i] >= 128, the
result cannot be represented as an int and the behavior of the shift
is undefined (C99 6.5.7).  To ensure that the shift operation is
defined, cast bits[i] to uint32_t.

(f and the function output are int32_t, but the conversion of uint32_t
to int32_t is implementation-defined when the value cannot be
represented, not undefined.  We check in configure.ac that the
platform is two's complement.)

(Discovered by OSS-Fuzz.)

8 months agoUse getentropy() when available 1387/head
Greg Hudson [Wed, 30 Oct 2024 21:08:00 +0000 (17:08 -0400)] 
Use getentropy() when available

When available, use getentropy() in preference to SYS_getrandom or
/dev/urandom.  This binding is present in glibc 2.25 and the BSDs.

ticket: 9149 (new)

8 months agoFix krb5_ldap_list_policy() filtering loop 1384/head
Greg Hudson [Sun, 27 Oct 2024 23:01:51 +0000 (19:01 -0400)] 
Fix krb5_ldap_list_policy() filtering loop

The loop at the end of this function is intended to ignore ticket
policy DNs that can't be converted to names.  But it instead leaves a
hole in the output list if that happens, effectively truncating the
list and leaking any subsequent entries.  Use the correct index for
the output list.

ticket: 9148 (new)

8 months agoFix type violation in libkrad 1385/head
Greg Hudson [Mon, 28 Oct 2024 15:51:54 +0000 (11:51 -0400)] 
Fix type violation in libkrad

remote.c uses casts to cover up a signature difference between
iterator() and krad_packet_iter_cb.  The difference is unimportant in
typical platform ABIs, but calling the function this way is undefined
behavior (C99 6.3.2.8).  Fix iterator() to conform to
krad_packet_iter_cb and remove the casts.

8 months agoAdd new OSS-Fuzz targets 1366/head
Arjun [Fri, 11 Oct 2024 06:28:06 +0000 (11:58 +0530)] 
Add new OSS-Fuzz targets

[ghudson@mit.edu: made minor style edits; edited commit message]

bigredbutton: whitespace

8 months agoAdd coverage to existing OSS-Fuzz targets
Arjun [Mon, 30 Sep 2024 11:44:10 +0000 (17:14 +0530)] 
Add coverage to existing OSS-Fuzz targets

Also fix the dependencies of fuzz_chpw, remove NDROBJ from Makefile in
favor of including ndr.c from fuzz_ndr.c, and add one new corpus for
fuzz_gss.

[ghudson@mit.edu: added initializers to variables used in cleanup
handlers; edited commit message]

9 months agoAdd numeric constants to krad.h and use them 1381/head
Greg Hudson [Thu, 17 Oct 2024 00:26:57 +0000 (20:26 -0400)] 
Add numeric constants to krad.h and use them

ticket: 9147 (new)

9 months agoUse size_t indexes for null-terminated arrays 1373/head
Greg Hudson [Sat, 14 Sep 2024 22:14:51 +0000 (18:14 -0400)] 
Use size_t indexes for null-terminated arrays

When operating on arrays that don't have a specified integer bound,
use size_t indexes for improved safety.  Reported by James Watt.

9 months agoAllow null keyblocks in IOV checksum functions 1382/head
Greg Hudson [Sun, 20 Oct 2024 06:09:26 +0000 (02:09 -0400)] 
Allow null keyblocks in IOV checksum functions

Null keyblocks are allowed by the libk5crypto checksum functions when
the checksum type is not keyed.  However, krb5_c_make_checksum_iov()
and krb5_c_verify_checksum_iov() crash on null keyblock inputs because
they do not check before converting to krb5_key as their non-IOV
variants do.  Add the missing null checks.

ticket: 9146 (new)

9 months agoPrevent late initialization of GSS error map 1383/head
Greg Hudson [Mon, 21 Oct 2024 23:04:08 +0000 (19:04 -0400)] 
Prevent late initialization of GSS error map

Some of the peripheral libgssapi_krb5 utility functions, such as
gss_str_to_oid(), do not access the mechanism list and therefore do
not reach any of the calls to gssint_mechglue_initialize_library().
If one of these functions is called early and produces an error, its
call to map_error() will operate on the uninitialized error map.  When
the library is later initialized, any entries added to the error map
this way will be leaked.

To ensure that the error map is initialized before it is operated on,
add library initialization calls to gssint_mecherrmap_map() and
gssint_mecherrmap_get().

ticket: 9145 (new)

9 months agoFix unlikely password change leak
Andreas Schneider [Fri, 11 Oct 2024 10:45:13 +0000 (12:45 +0200)] 
Fix unlikely password change leak

In kpasswd_sendto_msg_callback(), if getsockname() does not reveal the
local address, a copy of the first local address's contents is made
and never freed.  Instead of making an allocated copy of the address
contents, make a shallow copy of the whole address.  Delay freeing the
address array until the end of the function so that alias pointer made
by the shallow copy remains valid.

[ghudson@mit.edu: further simplified code; rewrote commit message]

9 months agoFix libkadm5 parameter leak
Andreas Schneider [Fri, 11 Oct 2024 09:38:03 +0000 (11:38 +0200)] 
Fix libkadm5 parameter leak

Commit aa91cb5dbbd4356c7a9069f4f52a10f70d91bc00 added kadmind_listen,
kpasswd_listen, and iprop_listen fields to kadm5_config_params, but
did not add them to the fields freed in kadm5_free_config_params().
Add them now.

[ghudson@mit.edu: rewrote commit message]

9 months agoGenerate and verify message MACs in libkrad 1370/head
Julien Rische [Thu, 22 Aug 2024 15:15:50 +0000 (17:15 +0200)] 
Generate and verify message MACs in libkrad

Implement some of the measures specified in
draft-ietf-radext-deprecating-radius-03 for mitigating the BlastRADIUS
attack (CVE-2024-3596):

* Include a Message-Authenticator MAC as the first attribute when
  generating a packet of type Access-Request, Access-Reject,
  Access-Accept, or Access-Challenge (sections 5.2.1 and 5.2.4), if
  the secret is non-empty.  (An empty secret indicates the use of Unix
  domain socket transport.)

* Validate the Message-Authenticator MAC in received packets, if
  present.

FreeRADIUS enforces Message-Authenticator as of versions 3.2.5 and
3.0.27.  libkrad must generate Message-Authenticator attributes in
order to remain compatible with these implementations.

[ghudson@mit.edu: adjusted style and naming; simplified some
functions; edited commit message]

ticket: 9142 (new)
tags: pullup
target_version: 1.21-next

9 months agoFix potential PAC processing crash 1378/head
Arjun [Fri, 11 Oct 2024 03:22:52 +0000 (08:52 +0530)] 
Fix potential PAC processing crash

An input to krb5_pac_parse() with a zero-length buffer at the end of
the PAC can cause an assertion failure in k5_pac_locate_buffer() due
to an off-by-one error.  Correct the assertion.

[ghudson@mit.edu: edited commit message]

ticket: 9144 (new)
tags: pullup
target_version: 1.21-next

9 months agoFix memory leak in PAC checksum verification
Arjun [Thu, 10 Oct 2024 19:25:59 +0000 (00:55 +0530)] 
Fix memory leak in PAC checksum verification

If the server checksum length is invalid, do proper cleanup in
verify_pac_checksums() before returning.

[ghudson@mit.edu: edited commit message]

ticket: 9143 (new)
tags: pullup
target_version: 1.21-next

9 months agoDisable include and includedir in fuzzing build
Arjun [Thu, 10 Oct 2024 19:07:52 +0000 (00:37 +0530)] 
Disable include and includedir in fuzzing build

When building for fuzz teting, ignore "include" and "incluedir"
directives in the profile library's parse_line(), to prevent it from
trying to open non-existent paths generated by the fuzzing library.

[ghudson@mit.edu: edited commit message]

9 months agoRemove ancient platforms from shlib.conf 1372/head
Greg Hudson [Thu, 19 Sep 2024 06:26:02 +0000 (02:26 -0400)] 
Remove ancient platforms from shlib.conf

Remove the shared library settings for DEC OSF (last release in 1992),
SINIX (1995), AIX 4 (1999), BSD/OS (2003), and IRIX (2006).

9 months agoUpdate upload action versions in CI scripts 1377/head
Greg Hudson [Tue, 8 Oct 2024 02:22:40 +0000 (22:22 -0400)] 
Update upload action versions in CI scripts

Increment the versions of the upload actions in doc.yml and cifuzz.yml
as documented in:

https://github.blog/news-insights/product-news/get-started-with-v4-of-github-actions-artifacts/
https://github.blog/changelog/2024-01-12-code-scanning-deprecation-of-codeql-action-v2/

Also fix the conditional in cifuzz.yml to react to changes in itself,
not in build.yml.

9 months agoAvoid mutex locking in krb5int_trace() 1375/head
Alexey Tikhonov [Fri, 4 Oct 2024 16:00:21 +0000 (18:00 +0200)] 
Avoid mutex locking in krb5int_trace()

Trace logging doesn't need unique timestamps, so the locking within
krb5_crypto_us_timeofday() makes trace logging slower for no reason.
Add a new helper k5_us_timeofday(), which is merely a wrapper around
the existing get_time_now(), and use it in krb5int_trace().

[ghudson@mit.edu: edited commit message]

9 months agoFix krb5_crypto_us_timeofday() microseconds check 1374/head
Alexey Tikhonov [Thu, 3 Oct 2024 16:40:04 +0000 (18:40 +0200)] 
Fix krb5_crypto_us_timeofday() microseconds check

Commit a60db180211a383bd382afe729e9309acb8dcf53 mistakenly reversed
the sense of the krb5_crypto_us_timeofday() conditional that enforces
fowards movement of the microseconds value within a second.  Moreover,
the macros ts_after() and ts_incr() should not have been applied to
non-timestamp values.  Revert the incorrect changes.

[ghudson@mit.edu: rewrote commit message]

ticket: 9141 (new)
tags: pullup
target_version: 1.21-next

10 months agoFix various issues detected by static analysis 1371/head
Julien Rische [Fri, 6 Sep 2024 15:18:11 +0000 (17:18 +0200)] 
Fix various issues detected by static analysis

In klists's show_credential(), ensure that the column counter doesn't
decrease if printf() fails.

In process_k5beta7_princ(), bounds-check the e_length field.

In ndr_enc_delegation_info(), initialize b so it is always valid for
the cleanup handler.

In krb5_dbe_def_decrypt_key_data(), change the flow control so ret is
always set by the end of the function.  Return KRB5_KDB_INVALIDKEYSIZE
if there isn't enough data in the first key_data_contents field or if
the serialized key length is invalid.

In svcauth_gss_validate(), expand rpchdr to accomodate the header plus
MAX_AUTH_BYTES.

In svcudp_reply(), change slen to unsigned to match the return type of
XDR_GETPOS() and eliminate an unnecessary check for slen >= 0.

In krb5int_pthread_loaded()(), remove pthread_equal() from the weak
symbol checks.  It is implemented as an inline function in some glibc
versions, which makes the comparison "&pthread_equal == 0" always
false.

[ghudson@mit.edu: further modified krb5_dbe_def_decrypt_key_data() for
clarity; added detail to commit message]

10 months agoBlock library unloading to avoid finalizer races 1368/head
Greg Hudson [Thu, 29 Aug 2024 19:25:54 +0000 (15:25 -0400)] 
Block library unloading to avoid finalizer races

Library finalizers can run due to the library being unloaded or the
process exiting.  If the library is being unloaded, global memory
resources must be released to avoid memory leaks.  But if the process
is exiting, releasing memory resources can lead to race conditions if
another thread invokes functions from the library during or after
finalizer execution.  Most commonly this manifests as an assertion
error about trying to lock a destroyed mutex.

We can block unloading of our library on ELF platforms by passing "-z
nodelete" to the linker.  Add a shell variable "lib_unload_prevented"
to the shlib.conf outputs, set it on platforms where we can block
unloading, and suppress finalizers when it is set.

On Windows we can detect if the process is exiting by checking for a
non-null lpvReserved argument in DllMain().  Do not execute finalizers
when the process is executing.

ticket: 9139 (new)

11 months agomake regen
Greg Hudson [Tue, 20 Aug 2024 20:45:56 +0000 (16:45 -0400)] 
make regen

11 months agoUpdate config.guess, config.sub
Greg Hudson [Tue, 20 Aug 2024 20:44:44 +0000 (16:44 -0400)] 
Update config.guess, config.sub

11 months agoUpdate features list for 1.22
Greg Hudson [Tue, 20 Aug 2024 20:43:07 +0000 (16:43 -0400)] 
Update features list for 1.22

11 months agoReplace Windows installer FilesInUse dialog text 1367/head
Greg Hudson [Thu, 15 Aug 2024 15:30:07 +0000 (11:30 -0400)] 
Replace Windows installer FilesInUse dialog text

Windows installers must provide a FilesInUse dialog, with the intent
of minimizing the need to restart the system after software
installations.  For reasons related to the LSA cache, the KfW
installer always schedules a post-installation reboot (see commit
50a3c3cbeab32577fba2b21deb72a64015c48ec7).  Reword the FilesInUse
dialog text to recommend clicking Ignore, causing the conflicting
files to replaced on the reboot.  (The affected files are likely C
runtime DLLs, and the existing versions will almost certainly suffice
if KfW programs are run prior to a reboot.)

ticket: 9135 (new)

11 months agoDocument dns_lookup_realm relation 1365/head
Greg Hudson [Mon, 5 Aug 2024 21:37:06 +0000 (17:37 -0400)] 
Document dns_lookup_realm relation

ticket: 9134
tags: pullup
target_version: 1.21-next

11 months agoRefactor GSS per-message token parsing 1362/head
Greg Hudson [Mon, 24 Jun 2024 19:46:50 +0000 (15:46 -0400)] 
Refactor GSS per-message token parsing

Replace kg_unseal_v1() and gss_krb5int_unseal_token_v3() with new
functions using current coding practices.  Notable differences
include:

* The new functions use k5input for improved safety.
* The new functions do not modify the input buffer.
* The new functions will never try to allocate zero bytes of memory.
* There are separate functions for unwrap and verify_mic, which means
  there is no message_buffer parameter acting conditionally as an
  input or output.

11 months agoUpdate k5_sendto() comment 1363/head
Greg Hudson [Thu, 1 Aug 2024 06:41:15 +0000 (02:41 -0400)] 
Update k5_sendto() comment

Edit the block comment above k5_sendto() to take into account commits
802318cda963456b3ed7856c836e89da891483be (which added request_timeout)
and 6436a3808061da787a43c6810f5f0370cdfb6e36 (which made the open TCP
connection wait indefinite).

12 months agoRestore test coverage for old session key types 1361/head
Greg Hudson [Mon, 29 Jul 2024 16:34:10 +0000 (12:34 -0400)] 
Restore test coverage for old session key types

Commit 1b57a4d134bbd0e7c52d5885a92eccc815726463 made the KDC stop
issuing des3 and rc4 session keys by default.  To make the des3 and
arcfour passes of the test suite work, it added aes256-sha1 to the
permitted enctypes for those passes.  Negotiating AES session keys
reduces coverage of pre-CFX GSSAPI code and other uses of the older
enctypes.  Instead set the enable_des3 and enable_rc4 variables.

12 months agoRefactor GSS token header parsing 1353/head
Greg Hudson [Wed, 19 Jun 2024 22:55:35 +0000 (18:55 -0400)] 
Refactor GSS token header parsing

Rewrite g_verify_token_header() to use k5input and not to handle
two-byte token IDs (which are specific to the krb5 mechanism).  Add a
more general g_get_token_header() which can handle detached wrappers
and cases where the mech is not known in advance.  Adjust all current
callers, and get rid of the duplicate DER parsing code added in commit
b0a2f8a5365f2eec3e27d78907de9f9d2c80505a.

In k5-input.h, split out tag and length parsing into
k5_der_get_taglen(), needed by g_get_token_header().

12 months agoAdd fortify flag to gcc CI build 1360/head
Greg Hudson [Fri, 19 Jul 2024 22:07:46 +0000 (18:07 -0400)] 
Add fortify flag to gcc CI build

12 months agoRemove unused files 1358/head
Greg Hudson [Thu, 11 Jul 2024 19:15:46 +0000 (15:15 -0400)] 
Remove unused files