]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
3 years agoUpdate for krb5-1.18.5-postrelease krb5-1.18
Greg Hudson [Fri, 18 Mar 2022 21:37:30 +0000 (17:37 -0400)] 
Update for krb5-1.18.5-postrelease

3 years agoUpdate for krb5-1.18.5 krb5-1.18.5-final
Greg Hudson [Thu, 10 Mar 2022 06:48:14 +0000 (01:48 -0500)] 
Update for krb5-1.18.5

3 years agomake update-po
Greg Hudson [Thu, 10 Mar 2022 05:46:34 +0000 (00:46 -0500)] 
make update-po

3 years agoUpdate man pages
Greg Hudson [Thu, 10 Mar 2022 05:45:42 +0000 (00:45 -0500)] 
Update man pages

3 years agoUpdate copyright years to 2022
Greg Hudson [Wed, 23 Feb 2022 06:27:01 +0000 (01:27 -0500)] 
Update copyright years to 2022

3 years agoFix KDC null deref on TGS inner body null server
Greg Hudson [Tue, 3 Aug 2021 05:15:27 +0000 (01:15 -0400)] 
Fix KDC null deref on TGS inner body null server

After the KDC decodes a FAST inner body, it does not check for a null
server.  Prior to commit 39548a5b17bbda9eeb63625a201cfd19b9de1c5b this
would typically result in an error from krb5_unparse_name(), but with
the addition of get_local_tgt() it results in a null dereference.  Add
a null check.

Reported by Joseph Sutton of Catalyst.

CVE-2021-37750:

In MIT krb5 releases 1.14 and later, an authenticated attacker can
cause a null dereference in the KDC by sending a FAST TGS request with
no server field.

(cherry picked from commit d775c95af7606a51bf79547a94fa52ddd1cb7f49)

ticket: 9008
version_fixed: 1.18.5

4 years agoUpdate for krb5-1.18.4 krb5-1.18.4-final
Greg Hudson [Thu, 22 Jul 2021 22:49:02 +0000 (18:49 -0400)] 
Update for krb5-1.18.4

4 years agoUpdate man pages and pot file
Greg Hudson [Thu, 22 Jul 2021 21:50:57 +0000 (17:50 -0400)] 
Update man pages and pot file

4 years agoUpdate copyright years to 2021
Greg Hudson [Mon, 11 Jan 2021 17:24:35 +0000 (12:24 -0500)] 
Update copyright years to 2021

4 years agoFix defcred leak in krb5 gss_inquire_cred()
Greg Hudson [Wed, 21 Jul 2021 17:44:30 +0000 (13:44 -0400)] 
Fix defcred leak in krb5 gss_inquire_cred()

Commit 1cd2821c19b2b95e39d5fc2f451a035585a40fa5 altered the memory
management of krb5_gss_inquire_cred(), introducing defcred to act as
an owner pointer when the function must acquire a default credential.
The commit neglected to update the code to release the default cred
along the successful path.  The old code does not trigger because
cred_handle is now reassigned, so the default credential is leaked.

Reported by Pavel Březina.

(a minimal alternative to commit 593e16448e1af23eef74689afe06a7bcc86e79c7)

ticket: 9016
version_fixed: 1.18.4

4 years agoFix use-after-free during krad remote_shutdown()
Robbie Harwood [Sat, 29 May 2021 17:25:59 +0000 (13:25 -0400)] 
Fix use-after-free during krad remote_shutdown()

Since elements of the queue can be removed on out-of-memory errors,
the correct call is K5_TAILQ_FOREACH_SAFE, not K5_TAILQ_FOREACH.
Reported by Coverity.

(cherry picked from commit 8c88defb16b34937d5b72b4832c854ce2dbe32d1)

ticket: 9015
version_fixed: 1.18.4

4 years agoUsing locking in MEMORY krb5_cc_get_principal()
Greg Hudson [Sun, 20 Jun 2021 23:24:07 +0000 (19:24 -0400)] 
Using locking in MEMORY krb5_cc_get_principal()

Without locking, the principal pointer could be freed out from under
krb5_copy_principal() by another thread calling krb5_cc_initialize()
or krb5_cc_destroy().

(cherry picked from commit 1848447291c68e21311f441b0458ae53471d00d3)

ticket: 9014
version_fixed: 1.18.4

4 years agoFix KDC null deref on bad encrypted challenge
Joseph Sutton [Tue, 6 Jul 2021 23:47:44 +0000 (11:47 +1200)] 
Fix KDC null deref on bad encrypted challenge

The function ec_verify() in src/kdc/kdc_preauth_ec.c contains a check
to avoid further processing if the armor key is NULL.  However, this
check is bypassed by a call to k5memdup0() which overwrites retval
with 0 if the allocation succeeds.  If the armor key is NULL, a call
to krb5_c_fx_cf2_simple() will then dereference it, resulting in a
crash.  Add a check before the k5memdup0() call to avoid overwriting
retval.

CVE-2021-36222:

In MIT krb5 releases 1.16 and later, an unauthenticated attacker can
cause a null dereference in the KDC by sending a request containing a
PA-ENCRYPTED-CHALLENGE padata element without using FAST.

[ghudson@mit.edu: trimmed patch; added test case; edited commit
message]

(cherry picked from commit fc98f520caefff2e5ee9a0026fdf5109944b3562)

ticket: 9007
version_fixed: 1.18.4

4 years agoFix argument type errors on Windows
Greg Hudson [Mon, 26 Apr 2021 18:46:31 +0000 (14:46 -0400)] 
Fix argument type errors on Windows

Fix three Windows-specific argument type errors, including a crash bug
in the default replay cache type.  Change the compiler flags to treat
several argument type warnings as errors.

The replay cache bug was reported by Thomas Wagner.

(cherry picked from commit 65b21aee6ab5e7d0851302b98647261c15c71c96)

ticket: 9005
version_fixed: 1.18.4

4 years agoFix runstatedir makefile substitution
Greg Hudson [Tue, 5 Jan 2021 19:37:44 +0000 (14:37 -0500)] 
Fix runstatedir makefile substitution

Set localstatedir and runstatedir in config/pre.in so that the default
runstatedir value of ${localstatedir}/run works.  Reported by Mike
Jetzer.

(cherry picked from commit fd005a1967510004c9197f7da9f1d85ee81f4734)

ticket: 8975
version_fixed: 1.18.4

4 years agoUpdate for krb5-1.18.3-postrelease
Greg Hudson [Wed, 18 Nov 2020 01:07:02 +0000 (20:07 -0500)] 
Update for krb5-1.18.3-postrelease

4 years agoUpdate for krb5-1.18.3 krb5-1.18.3-final
Greg Hudson [Tue, 17 Nov 2020 17:12:55 +0000 (12:12 -0500)] 
Update for krb5-1.18.3

4 years agomake update-po
Greg Hudson [Tue, 17 Nov 2020 03:39:41 +0000 (22:39 -0500)] 
make update-po

4 years agoFix compatibility with upcoming autoconf 2.70
Sergei Trofimovich [Fri, 6 Nov 2020 08:14:57 +0000 (08:14 +0000)] 
Fix compatibility with upcoming autoconf 2.70

Mainline autoconf generates no shell code for AC_CONFIG_AUX_DIR().
Call it unconditionally to avoid a syntax error.

[ghudson@mit.edu: rewrote commit message]

(cherry picked from commit f78edbe30816f049e1360cb6e203fabfdf7b98df)

ticket: 8960
version_fixed: 1.18.3

4 years agoAdd recursion limit for ASN.1 indefinite lengths
Greg Hudson [Sat, 31 Oct 2020 21:07:05 +0000 (17:07 -0400)] 
Add recursion limit for ASN.1 indefinite lengths

The libkrb5 ASN.1 decoder supports BER indefinite lengths.  It
computes the tag length using recursion; the lack of a recursion limit
allows an attacker to overrun the stack and cause the process to
crash.  Reported by Demi Obenour.

CVE-2020-28196:

In MIT krb5 releases 1.11 and later, an unauthenticated attacker can
cause a denial of service for any client or server to which it can
send an ASN.1-encoded Kerberos message of sufficient length.

(cherry picked from commit 57415dda6cf04e73ffc3723be518eddfae599bfd)

ticket: 8959
version_fixed: 1.18.3

4 years agoSuppress Leash error popup on MSLSA renew failure
Greg Hudson [Wed, 19 Aug 2020 15:49:29 +0000 (11:49 -0400)] 
Suppress Leash error popup on MSLSA renew failure

Attempting to renew the MSLSA cache can commonly fail with
KRB5_CC_NOTFOUND due to LSA policy.  Do not display an error popup in
this case.  Also fix a logic error in the existing suppressions.

(cherry picked from commit bfd407703a938573610af3f17aad4d5ebad615fd)

ticket: 8939
version_fixed: 1.18.3

4 years agoFix Leash crash when ticket autorenewal fails
Greg Hudson [Wed, 19 Aug 2020 15:37:12 +0000 (11:37 -0400)] 
Fix Leash crash when ticket autorenewal fails

CLeashView::RenewTicket() falls back to an ImportTicket or InitTicket
operation if ticket renewal fails.  A 2004 commit (from the old
pismere repository) added code to heuristically determine whether
Leash's cache was imported by comparing the MSLSA cache principal name
to ticketinfo.Krb5.principal.  Commit
9bc411e72fce5bed3ed00ae5b09f8c239309bae0 broke this code by removing
the call to initialize ticketinfo.Krb5 and by making
ticketinfo.Krb5.principal ephemeral.  The strcmp() call now crashes
the process with a null dereference.

Fix the crash by removing the heuristic detection of imported tickets,
using the current value of m_importedTickets (which should be correct
unless Leash was restarted after the tickets were obtained) to decide
whether to import or initialize tickets.

(cherry picked from commit 7fc4cdae79d0689afed32f9bcfeb28f410a9d79c)

ticket: 8938
version_fixed: 1.18.3

4 years agoSet lockdown attribute when creating LDAP KDB
Greg Hudson [Mon, 10 Aug 2020 16:44:21 +0000 (12:44 -0400)] 
Set lockdown attribute when creating LDAP KDB

In kdb5_ldap_util, set lockdown_keys on the special principals when
creating an LDAP KDB, as we do in kdb5_util when creating a regular
KDB.

(cherry picked from commit 6cdf7d82e74f21fb8a37efe6b1bba45744f891ba)

ticket: 8936
version_fixed: 1.18.3

4 years agoFix input length checking in SPNEGO DER decoding
Greg Hudson [Tue, 28 Jul 2020 16:58:26 +0000 (12:58 -0400)] 
Fix input length checking in SPNEGO DER decoding

In get_mech_set(), check the length before reading the first byte, and
decrease the length by the tag byte when reading and verifying the
sequence length.

In get_req_flags(), check the length before reading the first byte,
and check the context tag length after decoding it.

(cherry picked from commit 64f4b75a22212681ca293f8f09ddd24b0244d5b4)

ticket: 8933
version_fixed: 1.18.3

4 years agoAllow gss_unwrap_iov() of unpadded RC4 tokens
Greg Hudson [Sun, 12 Jul 2020 01:57:30 +0000 (21:57 -0400)] 
Allow gss_unwrap_iov() of unpadded RC4 tokens

Windows Remote Management, when used with an RC4 session key, appears
to generate GSS wrap tokens with no padding instead of the expected
one byte (RFC 4757 section 7.3).  These tokens cannot be decoded with
gss_unwrap() or a STREAM buffer (even with Microsoft SSPI), but SSPI
allows them to be decoded using explicit IOVs with either a
zero-length padding buffer or no padding buffer.  Allow these cases to
work in kg_fixup_padding_iov().  (It is already possible to make this
work with HEADER | DATA | DATA, but only by
accident--kg_fixup_padding_iov() doesn't find a data buffer because
kg_locate_iov() only looks for singleton buffers, so it exits early.)

(cherry picked from commit 3f204ddd567715ef360b4bb0b32961b6a9877f9d)

ticket: 8926
version_fixed: 1.18.3

4 years agoAvoid using LMDB environments across forks
Greg Hudson [Fri, 19 Jun 2020 19:05:37 +0000 (15:05 -0400)] 
Avoid using LMDB environments across forks

In krb5kdc and kadmind, reinitialize the DB state after daemonizing,
to prevent using an LMDB environment in a different process than it
was created.  Otherwise the daemon's reader table slot appears to be
stale and can be claimed by another process.

In kadmind, this change means that global_server_handle changes value
after the loop setup.  Add an extra level of pointer indirection so
that the handle passed to the loop remains valid.

kdb_init_hist() is now called twice by kadmind.  Change it to avoid
leaking hist_princ on the second invocation.

(cherry picked from commit 38b98a14433b8858a3ca5979a0afa194df0df1e9)

ticket: 8918
version_fixed: 1.18.3

4 years agoSet pw_expiration during LDAP load
Greg Hudson [Thu, 4 Jun 2020 17:19:53 +0000 (13:19 -0400)] 
Set pw_expiration during LDAP load

When loading a principal entry in process_k5beta7_princ(), set the
KADM5_PW_EXPIRATION mask bit so that the password expiration time is
set on the principal entry.  Add a regression test.

Reported (with fix) by Glenn Machin.

(cherry picked from commit 778d3fd9de50ab0c87cf0031e1dd24a8ec4bd552)

ticket: 8882
version_fixed: 1.18.3

4 years agoUnregister thread key in SPNEGO finalization
Greg Hudson [Fri, 16 Oct 2020 15:35:18 +0000 (11:35 -0400)] 
Unregister thread key in SPNEGO finalization

Commit d160bc733a3dbeb6d84f4e175234ff18738d9f66 (ticket 7045) added a
new thread key K5_KEY_GSS_SPNEGO_STATUS and registered it in SPNEGO
library initialization, but neglected to unregister it in
finalization.  As a result, loading, unloading, and reloading
libgssapi_krb5 could throw an assertion failure if libkrb5support
remained loaded.  Unregister the key in SPNEGO finalization and add a
test case.

Reported and investigated by Adam Dabrowski.

(cherry picked from commit 07ff54d0bb85109df114612bbbfa6559f4a1e0cb)

ticket: 8614
tags: pullup
target_version: 1.18-next
target_version: 1.17-next

4 years agoUnify kvno option documentation
Robbie Harwood [Thu, 20 Aug 2020 21:49:29 +0000 (17:49 -0400)] 
Unify kvno option documentation

Add missing kvno options to the kvno.rst synopsis and option
descriptions, and to the kvno usage message.  Remove mention of '-h'
(help text), from kvno.rst as it is an implicit option.

Indicate the two exclusions (-u/-S and --u2u with the S4U2Self options)
and dependency (-P on S4U2Self) where they are missing.

Switch xusage() to print only a single localized string, rather than
running each line of output through localization separately.

Leave kvno -C undocumented for now, as the semantics of
KRB5_GC_CANONICALIZE are minimally useful and likely to change.

[ghudson@mit.edu: edited documentation and commit message]

(cherry picked from commit becd1ad6830b526d08ddaf5b2b6f213154c6446c)

ticket: 7476
tags: pullup
target_version: 1.18-next

4 years agoUpdate for krb5-1.18.2-postrelease
Greg Hudson [Tue, 3 Nov 2020 15:48:21 +0000 (10:48 -0500)] 
Update for krb5-1.18.2-postrelease

5 years agoUpdate for krb5-1.18.2 krb5-1.18.2-final
Greg Hudson [Fri, 22 May 2020 00:20:18 +0000 (20:20 -0400)] 
Update for krb5-1.18.2

5 years agoFix SPNEGO acceptor mech filtering
Greg Hudson [Thu, 21 May 2020 18:15:25 +0000 (14:15 -0400)] 
Fix SPNEGO acceptor mech filtering

Commit c2ca2f26eaf817a6a7ed42257c380437ab802bd9 (ticket 8851)
accidentally changed the SPNEGO acceptor code to filter mechanisms by
the obtainability of initiator credentials rather than acceptor
credentials, when the default acceptor credential is used.

(cherry picked from commit e25918cb9efd7361aa78d2d96cd097dd34fdf35d)

ticket: 8908
version_fixed: 1.18.2

5 years agoPrevent use of invalid local TGT key
Greg Hudson [Wed, 13 May 2020 17:05:49 +0000 (13:05 -0400)] 
Prevent use of invalid local TGT key

Commit 570967e11bd5ea60a82fc8157ad7d07602402ebb took a shortcut in
get_local_tgt() by using the first key data entry in the TGT principal
entry.  This is usually correct, but if the first key data entry has
an invalid enctype (such as a single-DES enctype), we can select a key
we can't use.  Call krb5_dbe_find_enctype() instead.  Reported by
Leonard Peirce.

(cherry picked from commit d7ed635e822e13b89fef93463d1d132b1e03b78f)

ticket: 8906
version_fixed: 1.18.2

5 years agoAdd stubs for some removed replay cache functions
Greg Hudson [Sun, 10 May 2020 16:59:24 +0000 (12:59 -0400)] 
Add stubs for some removed replay cache functions

Commit dcb853ac32779b173f39e19c0f24b0087de85771 removed some replay
cache functions that haven't been considered part of the libkrb5 API.
Some of these functions were used in OpenSSL (despite the lack of
prototypes) prior to the OpenSSL 1.1 release.  Run-time linker errors
can occur if an OpenSSL 1.0.x (or earlier) libssl is used with a 1.18
libkrb5, even though the Kerberos code would likely never be used.

Add stubs for the four functions historically used in OpenSSL.

(cherry picked from commit 58109348cfa70c44b2b36233c18f9bb02a94cf26)

ticket: 8905
version_fixed: 1.18.2

5 years agoFix overzealous SPNEGO src_name/deleg_cred release
Greg Hudson [Tue, 28 Apr 2020 15:37:10 +0000 (11:37 -0400)] 
Fix overzealous SPNEGO src_name/deleg_cred release

Commit 24b844714dea3e47b17511746b5df5b6ddf13d43 (ticket 8845) added
releases of sc->internal_name and sc->deleg_cred before calling the
underlying mech's gss_accept_sec_context(), to avoid a potential leak
if the mech reports a value multiple times.  Commit
c2ca2f26eaf817a6a7ed42257c380437ab802bd9 (ticket 8851) added a branch
which calls negoex_accept() instead of calling directly into the
underlying mech.  If negoex_accept() doesn't call into the mech on the
last acceptor leg, the src_name and deleg_cred values from the final
mech call are lost.

Move the releases to the non-NegoEx branch.  negoex_accept() already
does its own releases when it calls into the mech.

Reported by Luke Howard.

(cherry picked from commit b2fe66fed560ae28917a4acae6f6c0f020156353)

ticket: 8898
version_fixed: 1.18.2

5 years agoUpdate for krb5-1.18.1-postrelease
Greg Hudson [Tue, 14 Apr 2020 03:42:29 +0000 (23:42 -0400)] 
Update for krb5-1.18.1-postrelease

5 years agoUpdate for krb5-1.18.1 krb5-1.18.1-final
Greg Hudson [Sun, 12 Apr 2020 00:17:41 +0000 (20:17 -0400)] 
Update for krb5-1.18.1

5 years agomake update-po
Greg Hudson [Sat, 11 Apr 2020 19:54:03 +0000 (15:54 -0400)] 
make update-po

5 years agoUpdate man pages
Greg Hudson [Sat, 11 Apr 2020 19:53:43 +0000 (15:53 -0400)] 
Update man pages

5 years agoFix typo in SPAKE modprinc example
Daniel Albers [Thu, 9 Apr 2020 09:25:34 +0000 (11:25 +0200)] 
Fix typo in SPAKE modprinc example

(cherry picked from commit 74550f3deabb268a00b43fe0ac7debde0e108938)

ticket: 8896
version_fixed: 1.18.1

5 years agoMake ksu honor KRB5CCNAME again
Greg Hudson [Tue, 7 Apr 2020 00:45:10 +0000 (20:45 -0400)] 
Make ksu honor KRB5CCNAME again

Commit d439e370b70f7af4ed2da9c692a3be7dcf7b4ac6 (ticket 8800) caused
ksu to ignore KRB5CCNAME from the environment.  ksu uses euid
switching to access the source cache, and should honor KRB5CCNAME to
find the ccache to potentially authorize the su operation.

Add a helper function init_ksu_context() to create the ksu context,
with explicit code to honor KRB5CCNAME using
krb5_cc_set_default_name().

(cherry picked from commit 8b1fff99f59f779bf7f7261f17b835576e20d35d)

ticket: 8895
version_fixed: 1.18.1

5 years agoCorrect formatting of trace log microseconds
Greg Hudson [Fri, 3 Apr 2020 05:04:06 +0000 (01:04 -0400)] 
Correct formatting of trace log microseconds

Always use six digits with leading 0s to format the microseconds in
trace log timestamps; otherwise a small value appears as too large of
a fraction of a second.

(cherry picked from commit 734bf341da54e09add9160e65ea7308072b97f13)

ticket: 8894
version_fixed: 1.18.1

5 years agoFix typos in documentation
Greg Hudson [Thu, 2 Apr 2020 17:22:45 +0000 (13:22 -0400)] 
Fix typos in documentation

Correct documentation spelling errors detected using codespell.
Reported by Jens Schleusener.

(cherry picked from commit 022f2cbc7f5abc9fbefa0d68b6025216c1b59353)

ticket: 8891
version_fixed: 1.18.1

5 years agoMake fiat 128-bit typedefs work with older gcc
Greg Hudson [Tue, 24 Mar 2020 06:00:25 +0000 (02:00 -0400)] 
Make fiat 128-bit typedefs work with older gcc

Use the int128_t and uint128_t types defined by edwards25519.c, rather
than [un]signed __int128 which does not compile with gcc 4.4.
Reported by Norm Green.

(cherry picked from commit dd5d6e5e39be6cf7fe9d54a79e824f8cb7301177)

ticket: 8888
version_fixed: 1.18.1

5 years agoDocument client keytab usage
Greg Hudson [Mon, 16 Mar 2020 22:14:30 +0000 (18:14 -0400)] 
Document client keytab usage

(cherry picked from commit 366c64897d55c86cdc616d2d1cf4617ff8a07a99)

ticket: 8886
version_fixed: 1.18.1

5 years agoChange KDC constrained-delegation precedence order
Isaac Boukris [Wed, 29 Jan 2020 21:35:50 +0000 (22:35 +0100)] 
Change KDC constrained-delegation precedence order

MS-SFU errata from 2019/12/09 indicates that legacy constrained
delegation should be prefered over resource-based constrained
delegation, which results slight diferences.

Also clarify that in the get_authdata_info KDB method, the PAC must be
verified and checked for user sensitivity for S4U2Proxy.  Document
that the client name should only be provided in the cross-realm
S4U2Proxy case.

[ghudson@mit.edu: clarified comments and commit message]

(cherry picked from commit cf6b710518bd6da8c491ee4020a9ad8ded321d66)

ticket: 8884
version_fixed: 1.18.1

5 years agoFix null dereference qualifying short hostnames
Greg Hudson [Tue, 3 Mar 2020 17:27:02 +0000 (12:27 -0500)] 
Fix null dereference qualifying short hostnames

Fix the dnsglue.c PRIMARY_DOMAIN macro not to call strdup() with a
null pointer if no DNS search path is configured.

(cherry picked from commit cd82bf377e7fad2409c76bf8b241920692f34fda)

ticket: 8881
version_fixed: 1.18.1

5 years agoFix typo in musl build fix
Greg Hudson [Thu, 12 Mar 2020 04:44:10 +0000 (00:44 -0400)] 
Fix typo in musl build fix

Commit cbdbc8d00d31344fafe00e0fdf984e04e631f7c4 checked for
__GLIBC__PREREQ instead of __GLIBC_PREREQ, thus accidentally reverting
the workaround introduced in commit
bf5953c549a6d279977df69ffe89b2ba51460eaf.  Fix the typo.

(cherry picked from commit b009cca2026b615ef5386faa4c0230bc27c4161d)

ticket: 8880
version_fixed: 1.18.1

5 years agoFix Linux build error with musl libc
TBK [Wed, 26 Feb 2020 20:12:45 +0000 (21:12 +0100)] 
Fix Linux build error with musl libc

Commit bf5953c549a6d279977df69ffe89b2ba51460eaf caused a build failure
on non-glibc Linux build environments.  Change the conditionalization
so that __GLIBC_PREREQ will only be used if it is defined.

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

(cherry picked from commit cbdbc8d00d31344fafe00e0fdf984e04e631f7c4)

ticket: 8880
version_fixed: 1.18.1

5 years agoAllow deletion of require_auth with LDAP KDB
Greg Hudson [Tue, 25 Feb 2020 16:32:09 +0000 (11:32 -0500)] 
Allow deletion of require_auth with LDAP KDB

In update_ldap_mod_auth_ind(), if there is no string attribute value
for require_auth, check for krbPrincipalAuthInd attributes that might
need to be removed.  (This will only work if the entry is loaded and
then modified, but that is the normal case for an existing entry.)

Move the update_ldap_mod_auth_ind() call inside the tl-data
conditional (which should perhaps be a check for KADM5_TL_DATA in the
mask instead).  A modification which did not intend to update tl-data
should not remove the krbPrincipalAuthInd attributes.

Change get_int_from_tl_data() to to zero its output so that it can't
leave a garbage value behind if it returns 0 (as it does if no
KDB_TL_USER_INFO tl-data is present).

Based on a patch by Glenn Machin.

(cherry picked from commit 6d9da7bb216f96cbdd731aa894714bd84213a9d0)

ticket: 8877
version_fixed: 1.18.1

5 years agoFix AS-REQ checking of KDB-modified indicators
Greg Hudson [Wed, 19 Feb 2020 20:36:38 +0000 (15:36 -0500)] 
Fix AS-REQ checking of KDB-modified indicators

Commit 7196c03f18f14695abeb5ae4923004469b172f0f (ticket 8823) gave the
KDB the ability to modify auth indicators, but it happens after the
asserted indicators are checked against the server principal
requirements.  In finish_process_as_req(), move the call to
check_indicators() after the call to handle_authdata() so that the
final indicator list is checked.

For the test case, add string attribute functionality to the test KDB
module, and fix a bug where test_get_principal() would return failure
if a principal has no keys.  Also add a test case for AS-REQ
enforcement of normally asserted auth indicators.

(cherry picked from commit 109e30ce22c20f18b8233119f274935bdf573886)

ticket: 8876
version_fixed: 1.18.1

5 years agoUpdate copyright years to 2020
Greg Hudson [Mon, 9 Mar 2020 20:21:17 +0000 (16:21 -0400)] 
Update copyright years to 2020

5 years agoFix typo and DES section in 1.18 README
Greg Hudson [Tue, 17 Mar 2020 18:54:27 +0000 (14:54 -0400)] 
Fix typo and DES section in 1.18 README

5 years agoUpdate for krb5-1.18-postrelease
Greg Hudson [Wed, 12 Feb 2020 23:18:00 +0000 (18:18 -0500)] 
Update for krb5-1.18-postrelease

5 years agoUpdate for krb5-1.18 krb5-1.18-final
Greg Hudson [Wed, 12 Feb 2020 17:21:11 +0000 (12:21 -0500)] 
Update for krb5-1.18

5 years agomake update-po
Greg Hudson [Wed, 12 Feb 2020 16:50:17 +0000 (11:50 -0500)] 
make update-po

5 years agoUpdate mitK5features.rst for beta2 features
Greg Hudson [Tue, 11 Feb 2020 21:58:42 +0000 (16:58 -0500)] 
Update mitK5features.rst for beta2 features

5 years agoAlways use S4U2Proxy second ticket parsed authdata
Isaac Boukris [Thu, 30 Jan 2020 18:38:44 +0000 (19:38 +0100)] 
Always use S4U2Proxy second ticket parsed authdata

When the KDC handles an S4U2Proxy request, if the KDB module returned
parsed authdata for the header ticket and not for the second ticket,
we could erroneously pass the header ticket's parsed authdata to
handle_authdata().  Make sure we always pass the parsed authdata for
the second ticket.

[ghudson@mit.edu: added comment; rewrote commit message]

(cherry picked from commit 21d823991a81d64af460ec62a98585c85534850b)

ticket: 8874
version_fixed: 1.18

5 years agoDon't assume OpenSSL failures are memory errors
Robbie Harwood [Wed, 5 Feb 2020 17:56:00 +0000 (12:56 -0500)] 
Don't assume OpenSSL failures are memory errors

More recent versions of OpenSSL can fail for other reasons.  Indicate
a crypto-related error occurred rather than a memory error to aid
debugging.

(cherry picked from commit bf9b2134ceddd6c727362be894b1c95c297a0f17)

ticket: 8873
version_fixed: 1.18

5 years agoTest that PAC is the first authdata element
Isaac Boukris [Sat, 1 Feb 2020 12:21:39 +0000 (13:21 +0100)] 
Test that PAC is the first authdata element

In the test KDB module, set the PAC as the first authdata element.  In
adata.c, add PAC service verification and verify that a PAC does not
appear in authdata elements after the first.

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

(cherry picked from commit d40d7c8ee8d7fb547e45c545365b21a818050130)

ticket: 8872
version_fixed: 1.18

5 years agoPut KDB authdata first
Isaac Boukris [Sat, 1 Feb 2020 15:13:30 +0000 (16:13 +0100)] 
Put KDB authdata first

Windows services, as well as some versions of Samba, may refuse
tickets if the PAC is not in the first AD-IF-RELEVANT container.  In
fetch_kdb_authdata(), change the merge order so that authdata from the
KDB module appears first.

[ghudson@mit.edu: added comment and clarified commit message]

(cherry picked from commit 331fa4bdd34263ea20667a0f51338cb84357fdaa)

ticket: 8872
version_fixed: 1.18

5 years agoUpdate for krb5-1.18-beta2-postrelease
Greg Hudson [Mon, 27 Jan 2020 22:00:09 +0000 (17:00 -0500)] 
Update for krb5-1.18-beta2-postrelease

5 years agoUpdate for krb5-1.18-beta2 krb5-1.18-beta2
Greg Hudson [Mon, 27 Jan 2020 18:35:30 +0000 (13:35 -0500)] 
Update for krb5-1.18-beta2

5 years agomake update-po
Greg Hudson [Mon, 27 Jan 2020 16:39:14 +0000 (11:39 -0500)] 
make update-po

5 years agoUpdate man pages
Greg Hudson [Mon, 27 Jan 2020 16:38:48 +0000 (11:38 -0500)] 
Update man pages

5 years agomake depend
Greg Hudson [Mon, 27 Jan 2020 16:38:16 +0000 (11:38 -0500)] 
make depend

5 years agoHonor transited-policy-checked flag in servers
Greg Hudson [Fri, 24 Jan 2020 15:25:18 +0000 (10:25 -0500)] 
Honor transited-policy-checked flag in servers

For consistency with Heimdal and simplicity of server configuration,
do not check the transited field in krb5_rd_req() if the
transited-policy-checked flag is set in the ticket.

Add a cross-realm test using the gcred and rdreq harnesses to test
server transited processing.  Also fix the KDC capaths case so that
the client actually doesn't know the path to the server realm.  In
k5test.py, adjust _cfg_merge() to remove keys mapped to None in the
second dictionary (instead of mapping them to None in the result), so
that deleting whole sections works.  Remove the corresponding check
for None in _write_cfg_section() as it is no longer needed.

(cherry picked from commit a5aa5969bc6ed404b86318b47c38dfc3d3aeb8df)

ticket: 8870
version_fixed: 1.18

5 years agoApply permitted_enctypes to KDC request enctypes
Robbie Harwood [Tue, 14 Jan 2020 19:23:00 +0000 (14:23 -0500)] 
Apply permitted_enctypes to KDC request enctypes

permitted_enctypes was initially intended only to restrict the
processing of AP requests (and was later applied to KDB key data
searches so that the KDC wouldn't issue a ticket it would refuse to
accept).  Because the documentation was never clear about its scope,
many configurations assume that permitted_enctypes also applies to
clients.

In light of the existing configurations, take the simple way out and
use permitted_enctypes as the default for default_tkt_enctypes and
default_tgs_enctypes.  Update the documentation, add a test to
explicitly check the new behavior, and remove now-unnecessary
configuration from the test suite.

[ghudson@mit.edu: unrolled helper function; edited documentation and
commit message; simplified test case]

(cherry picked from commit 8f13fb2342b2a715cfb694688e3435e7f11691f8)

ticket: 8869
version_fixed: 1.18

5 years agoFurther simplify test KDB module authdata code
Greg Hudson [Thu, 23 Jan 2020 19:49:24 +0000 (14:49 -0500)] 
Further simplify test KDB module authdata code

Commit 94f7c9705879500b1dc8dda8592490efce05688f simplified the
generation of authdata elements, but left behind some unnecessary
conditionalization when assembling the elements into a list, causing a
Coverity defect.  Further simplify the code.

(cherry picked from commit d035dc269e80b58cb73fd2b644b06bc5fb53e9cb)

ticket: 8868
version_fixed: 1.18

5 years agoAllow cross-realm RBCD with PAC and other authdata
Isaac Boukris [Wed, 15 Jan 2020 10:14:00 +0000 (11:14 +0100)] 
Allow cross-realm RBCD with PAC and other authdata

For cross-realm S4U2Proxy requests, require a PAC to be present to
bypass signedpath verification, but do not require it to be the only
authdata element.  For within-realm requests, add and verify
signedpath authdata regardless of the presence of a PAC.

Simplify the test KDB authdata module and the existing RBCD tests as
we no longer need a way to suppress the test module's KDB authdata.

[ghudson@mit.edu: rewrote commit message; reordered a condition for
efficiency]

(cherry picked from commit 94f7c9705879500b1dc8dda8592490efce05688f)

ticket: 8868
version_fixed: 1.18

5 years agoFix KDC crash in handle_signticket
Isaac Boukris [Wed, 15 Jan 2020 12:54:44 +0000 (13:54 +0100)] 
Fix KDC crash in handle_signticket

Commit d47f7dba3779c9e36e1dedaac830dac1dd248fb3 changed the parameters
passed to sign_authdata() for S4U2Proxy requests so that client is the
entry for the impersonated client (not the impersonator), and added a
new parameter for the impersonator entry.  It should have changed the
call to handle_signticket() to use the impersonator entry.  Fix the
handle_signticket() call, and change some parameter names to more
clearly indicate the flow of subject_server from process_tgs_req() to
handle_authdata() to its helpers.

[ghudson@mit.edu: edited commit message]

(cherry picked from commit 96e5d384acf174e6079b0aeeec14bd8100d24840)

ticket: 8867
version_fixed: 1.18

5 years agoAdd tests for S4U request-authdata handling
Isaac Boukris [Thu, 12 Dec 2019 02:20:44 +0000 (03:20 +0100)] 
Add tests for S4U request-authdata handling

In adata.c, look up the server in the keytab by ticket->server (which
has the canonicalized realm), to allow testing of cross-realm RBCD
(although unused for now).

In s4u2proxy.c, set KRB5_GC_CANONICALIZE to support RBCD, and add an
authdata request option.  Add an s4u2self test harness with authdata
request option.

[ghudson@mit.edu: minor code simplifications; edited commit message]

(cherry picked from commit 2d039a2b4c3ba6d71da8fcf76658dc63bc659f0c)

ticket: 8866
version_fixed: 1.18

5 years agoFix S4U client authdata handling
Isaac Boukris [Thu, 12 Dec 2019 02:40:04 +0000 (03:40 +0100)] 
Fix S4U client authdata handling

Only send client authdata in the initial request, and note
request authdata in out_creds.

(cherry picked from commit ef655640db9ac51979fa4529168aa05a4a8f45e4)

ticket: 8866
version_fixed: 1.18

5 years agoCheck cross-realm TGT name for RBCD requests
Isaac Boukris [Sun, 12 Jan 2020 16:32:09 +0000 (17:32 +0100)] 
Check cross-realm TGT name for RBCD requests

(cherry picked from commit deb64d5eca602c7147b4253e51976c45f58b465f)

ticket: 8865
version_fixed: 1.18

5 years agoFix error handling in gssint_mechglue_init()
Greg Hudson [Sat, 11 Jan 2020 04:47:34 +0000 (23:47 -0500)] 
Fix error handling in gssint_mechglue_init()

In the unlikely event that one of the functions called by
gssint_mechglue_init() returns an error, return that error to the
caller rather than continuing on and discarding the error status.
Returning success when some of the operations failed could fool the
library finalizer into thinking that initialization completed.
Reported by Spencer Malone.

(cherry picked from commit c120ed5b211ee684b830a6722fc3ab3222afbfa1)

ticket: 8864
version_fixed: 1.18

5 years agoFix typo in 1.18 release notes
Greg Hudson [Mon, 13 Jan 2020 17:22:02 +0000 (12:22 -0500)] 
Fix typo in 1.18 release notes

5 years agoUpdate for krb5-1.17-beta1-postrelease
Greg Hudson [Thu, 9 Jan 2020 16:31:06 +0000 (11:31 -0500)] 
Update for krb5-1.17-beta1-postrelease

5 years agoUpdate for krb5-1.18-beta1 krb5-1.18-beta1
Greg Hudson [Thu, 9 Jan 2020 01:01:05 +0000 (20:01 -0500)] 
Update for krb5-1.18-beta1

5 years agomake update-po
Greg Hudson [Thu, 9 Jan 2020 00:31:20 +0000 (19:31 -0500)] 
make update-po

5 years agoUpdate man pages
Greg Hudson [Thu, 9 Jan 2020 00:31:09 +0000 (19:31 -0500)] 
Update man pages

5 years agomake depend
Greg Hudson [Wed, 8 Jan 2020 23:32:34 +0000 (18:32 -0500)] 
make depend

5 years agoUpdate config.guess and config.sub
Greg Hudson [Wed, 8 Jan 2020 23:28:15 +0000 (18:28 -0500)] 
Update config.guess and config.sub

5 years agoUpdate README for krb5-1.18
Greg Hudson [Wed, 8 Jan 2020 19:40:08 +0000 (14:40 -0500)] 
Update README for krb5-1.18

5 years agoUpdate features list for 1.18
Greg Hudson [Wed, 8 Jan 2020 19:20:15 +0000 (14:20 -0500)] 
Update features list for 1.18

5 years agoFix LDAP policy enforcement of pw_expiration 1016/head
Robbie Harwood [Tue, 17 Dec 2019 22:37:41 +0000 (17:37 -0500)] 
Fix LDAP policy enforcement of pw_expiration

In the LDAP backend, the change mask is used to determine what LDAP
attributes to update.  As a result, password expiration was not set
from policy when running during addprinc, among other issues.
However, when the mask did not contain KADM5_PRINCIPAL, pw_expiration
would be applied regardless, which meant that (for instance) changing
the password would cause the password application to be applied.

Remove the check for KADM5_PRINCIPAL, and fix the mask to contain
KADM5_PW_EXPIRATION where appropriate.  Add a regression test to
t_kdb.py.

[ghudson@mit.edu: also set KADM5_ATTRIBUTES for randkey and setkey
since they both unset KRB5_KDB_REQUIRES_PWCHANGE; edited comments and
commit message]

ticket: 8861 (new)
tags: pullup
target_version: 1.17-next

5 years agoAllow kprop over NATs 1022/head
Greg Hudson [Fri, 3 Jan 2020 23:17:09 +0000 (18:17 -0500)] 
Allow kprop over NATs

In kpropd, don't set a remote address in the auth context, so that
propagation can work if the client address is changed by a NAT.

ticket: 8860 (new)

5 years agoFix handling of invalid CAMMAC service verifier 1021/head
Jeffrey Arbuckle [Sun, 22 Dec 2019 03:59:20 +0000 (22:59 -0500)] 
Fix handling of invalid CAMMAC service verifier

In extract_cammacs(), avoid a null dereference if the CAMMAC service
verifier is invalid or the CAMMAC is empty.

ticket: 8856
tags: pullup
target_version: 1.17-next

5 years agoWork around macOS SIP in the test suite 1020/head
Greg Hudson [Thu, 19 Dec 2019 18:52:32 +0000 (13:52 -0500)] 
Work around macOS SIP in the test suite

In macOS 10.11 and later with System Integrity Protection enabled,
system programs (including the shell) purge DYLD_LIBRARY_PATH from the
environment at startup.  As a result, any part of "make check" which
runs via a shell script must explicitly restore the runtime
environment.  Add a common rule for runenv.sh, and create and source
it where shell scripts are run.  Dejagnu's runtest is a shell script,
so create a tcl file for the kadmin and RPC unit tests and source it
from unix.exp.  Avoid using the shell to run commands in several
places.  Use return_trace=True for tests that previously indirected
through /usr/bin/env.

Do not include <malloc.h> in t_parse_host_string.c, as it does not
exist on macOS and is not needed.

Skip the iprop tests on macOS when SIP is enabled, as signal
restrictions appear to prevent the kpropd child process from informing
the parent process that a full resync has completed.

In net-server.c, set SO_REUSEPORT as well as SO_REUSEADDR on listener
sockets.  Otherwise the krb5kdc processes run by the test suite
sometimes fail to start with "address in use" errors.

In configure.ac, only generate po/Makefile if we will descend into it.

5 years agoAdd return_trace option to k5test.py
Greg Hudson [Tue, 7 Jan 2020 20:05:08 +0000 (15:05 -0500)] 
Add return_trace option to k5test.py

If return_trace=True is specified when running a command in a Python
test, collect the trace output and return it in a tuple with the
regular output.

5 years agoMake IPv6 pktinfo work on macOS
Greg Hudson [Fri, 20 Dec 2019 21:26:22 +0000 (16:26 -0500)] 
Make IPv6 pktinfo work on macOS

Define __APPLE_USE_RFC_3542 to expose the definition of IPV6_PKTINFO
on macOS.

ticket: 8349

5 years agoFix xdr_bytes() strict-aliasing violations 1012/head
Greg Hudson [Tue, 10 Dec 2019 17:06:05 +0000 (12:06 -0500)] 
Fix xdr_bytes() strict-aliasing violations

When xdr_bytes() is used for a gss_buffer_desc object, a temporary
character pointer must be used for the data value to avoid a strict
aliasing violation.

When xdr_bytes() is used for a krb5_keyblock object, a temporary
character pointer must also be used, even though the data pointer is
of type unsigned char *, to avoid a clang warning on macOS due to the
"#pragma pack" declaration in krb5.h.

5 years agoAdd NegoEx assertion to squash defect
Greg Hudson [Mon, 9 Dec 2019 16:42:47 +0000 (11:42 -0500)] 
Add NegoEx assertion to squash defect

Coverity sees negoex_init() test whether input_token is null before
parsing messages, then dereference input_token in verify_checksum().
Of course verify_checksum() will not find a checksum message if no
messages were parsed.  Add an assert to squash the false positive
forward-null defect.

5 years agoFix error return case in serialization code
Greg Hudson [Mon, 9 Dec 2019 16:33:57 +0000 (11:33 -0500)] 
Fix error return case in serialization code

One of the changes in commit 81e47875e3de0e52fbb11d61ef30a9406497af73
unintentionally caused the return value of profile_ser_externalize()
to be ignored.

5 years agoRemove KRB5_KDB_FLAG_ALIAS_OK 1018/head
Isaac Boukris [Wed, 25 Dec 2019 23:23:21 +0000 (00:23 +0100)] 
Remove KRB5_KDB_FLAG_ALIAS_OK

It is simpler and more consistent with Windows to let the KDB module
always return aliases, and use KDC logic (already present) to decide
whether to use the requested or canonical principal name in the
ticket.

With the removal of this flag, "kinit alias" (without the -C flag)
against the LDAP KDB module will issue a ticket for the alias name,
instead of failing with a "client not found" error.

[ghudson@mit.edu: edited comments; wrote commit message]

ticket: 8859 (new)

5 years agoDo not always canonicalize enterprise principals
Isaac Boukris [Sat, 2 Nov 2019 12:32:32 +0000 (13:32 +0100)] 
Do not always canonicalize enterprise principals

When processing an AS request in the KDC, do not assume
KRB5_KDB_FLAG_CANONICALIZE for enterprise client names.  This change
allows the KDB module to only canonicalize enterprise client names if
the canonicalize flag was set on the request, as Windows does.  The
KDB module may check the principal type and apply canonicalization as
appropriate.

[ghudson@mit.edu: edited comments; rewrote commit message]

ticket: 8858 (new)

5 years agoDon't warn in kadmin when no policy is specified 1019/head
Robbie Harwood [Thu, 19 Dec 2019 22:49:05 +0000 (17:49 -0500)] 
Don't warn in kadmin when no policy is specified

Not having policy defined is a normal occurrence.  While it's a useful
message to log in case it's unexpected, the current form is
unnecessarily alarmist.

ticket: 8857 (new)

5 years agoRemove unused kadmin and RPC test scripts 1015/head
Greg Hudson [Thu, 19 Dec 2019 07:29:11 +0000 (02:29 -0500)] 
Remove unused kadmin and RPC test scripts

5 years agoSimplify keytab creation in kadmin and RPC tests
Greg Hudson [Thu, 19 Dec 2019 07:25:15 +0000 (02:25 -0500)] 
Simplify keytab creation in kadmin and RPC tests

In init_db and init.exp, do not create an ovsec_adm.keytab; kadmind
has authenticated directly against the KDB since commit
416d9a774090ee78c30a844025887bd2b9e79d16.  Since we no longer create
ovsec_adkm principals, perform the deletion and recreation tests with
kadmin/ principals.

In helpers.exp, use kadmin to create the server keytab file, instead
of using make-host-keytab.pl.

Remove environment variable settings for make-host-keytab.pl from
scripts that no longer use it.

5 years agoIn mkrel, build documentation with python3
Greg Hudson [Wed, 11 Dec 2019 17:09:27 +0000 (12:09 -0500)] 
In mkrel, build documentation with python3

After commit 95830231758de259abbbccedbac01613f578768a, the
documentation cannot be built with Python 2.  Run make with
"PYTHON=python3" to ensure that we use Python 3.

5 years agoAdd NegoEx tests 980/head
Greg Hudson [Fri, 27 Sep 2019 15:04:45 +0000 (11:04 -0400)] 
Add NegoEx tests

Add a mock NegoEx-only GSS module, a test program which establishes a
SPNEGO context, and a Python script to exercise a variety of NegoEx
negotiation scenarios.

ticket: 8851