]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
6 years agoFix 64-bit Windows socket write error handling krb5-1.13
Greg Hudson [Thu, 4 Oct 2018 22:10:48 +0000 (18:10 -0400)] 
Fix 64-bit Windows socket write error handling

Add casts to ensure that the result type of SOCKET_WRITEV() on Windows
can represent -1.  Otherwise it will be treated as 2^32-1 when cast to
ssize_t on 64-bit Windows, which can lead to crashes in
krb5_sendto_kdc().  Reported by Puran Chand.

(cherry picked from commit d98c3238894986765631f1e556f29ca817988816)

ticket: 8746
version_fixed: 1.13.8

8 years agoFix uninitialized flags in MSLSA ccache type
Alexander Karaivanov [Mon, 24 Apr 2017 07:01:12 +0000 (09:01 +0200)] 
Fix uninitialized flags in MSLSA ccache type

The flags field in krb5_lcc_data is not initialized in
krb5_lcc_resolve(), so krb5_lcc_next_cred() can sometimes fail to
include a ticket when retrieving a ccache entry.  This results in a
"Request did not supply a ticket" error from k5_make_tgs_req() when
trying to use the credential.

[ghudson@mit.edu: condensed commit message]

ticket: 8567
target_version: 1.13-next
target_version: 1.14-next
target_version: 1.15-next
tags: pullup
(cherry picked from commit e5a78d4c90d9d6968c94b0c07f2cd3835f02aa5d)

8 years agoUpdate for krb5-1.13.7-postrelease
Tom Yu [Fri, 16 Sep 2016 22:12:55 +0000 (18:12 -0400)] 
Update for krb5-1.13.7-postrelease

8 years agoUpdates for krb5-1.13.7 krb5-1.13.7-final
Tom Yu [Thu, 15 Sep 2016 21:51:24 +0000 (17:51 -0400)] 
Updates for krb5-1.13.7

8 years agomake update-po
Tom Yu [Thu, 15 Sep 2016 20:15:41 +0000 (16:15 -0400)] 
make update-po

8 years agoUpdate man pages
Tom Yu [Thu, 15 Sep 2016 20:14:06 +0000 (16:14 -0400)] 
Update man pages

8 years agoUpdate config.guess, config.sub
Tom Yu [Wed, 31 Aug 2016 22:58:09 +0000 (18:58 -0400)] 
Update config.guess, config.sub

(cherry picked from commit f60ac0e5256d9a4006688b0e1c5cc8caf7c9d2b3)

ticket: 8489
version_fixed: 1.13.7

8 years agoTest bt_split.c unaligned access
Tom Yu [Wed, 7 Sep 2016 22:20:56 +0000 (18:20 -0400)] 
Test bt_split.c unaligned access

(back ported from commit 4613d503986f34f05ff310fcc580f65ba60eec5b)

ticket: 8493
version_fixed: 1.13.7

8 years agoFix unaligned accesses in bt_split.c
Tom Yu [Wed, 7 Sep 2016 21:28:34 +0000 (17:28 -0400)] 
Fix unaligned accesses in bt_split.c

In the libdb2 btree back end, splitting a page at an overflow key
could result in an unaligned access, causing a crash (and data
corruption) on platforms with strict alignment.  This probably occurs
only rarely in practice.

(cherry picked from commit 537aba0dda3a1f696f10fde56348fde06d88939c)

ticket: 8493
version_fixed: 1.13.7

8 years agoFix build with -O3 on ppc64el
Ben Kaduk [Thu, 11 Aug 2016 04:25:47 +0000 (23:25 -0500)] 
Fix build with -O3 on ppc64el

Ubuntu runs ppc64el builds with -O3, which elicited a few warnings
from gcc that were not generated elsewhere, as documented at
https://bugs.launchpad.net/ubuntu/+source/krb5/+bug/1592841 .

Initialize the output variable at the top of a couple of helper functions
to silence the uninitialized-variable warnings.

(cherry picked from commit 7db89952d8d4f806ac8b4908f898ac651df11643)

ticket: 8475
version_fixed: 1.13.7

8 years agoRemove meaningless checks decoding DB2 principals
Greg Hudson [Tue, 6 Sep 2016 16:58:57 +0000 (12:58 -0400)] 
Remove meaningless checks decoding DB2 principals

Commit e3d9f03a658e247dbb43cb345aa93a28782fd995 (ticket 8481) added
several checks for negative length values when decoding DB2 principal
entries, including two unnecessary checks on unsigned values.  Remove
those checks as they can generate warnings.

(cherry picked from commit c0f08f2eadbf179ec30008893a125722536c7802)

ticket: 8491
version_fixed: 1.13.7

8 years agoFix directory changes to use explicit subshells
Robbie Harwood [Fri, 2 Sep 2016 18:53:59 +0000 (14:53 -0400)] 
Fix directory changes to use explicit subshells

We depend on the behavior of having a separate subshell for each line in
our Makefiles, so force it where make (observed FreeBSD 10.3) does not
create one.

[ghudson@mit.edu: also changed rules in config/post.in]

(back ported from commit 69571141ccc2483b54e015a5d7c77d1e926f2822)

ticket: 8492
version_fixed: 1.13.7

8 years agoAvoid byte-swap cache corruption in libdb2
Tom Yu [Thu, 25 Aug 2016 22:02:56 +0000 (18:02 -0400)] 
Avoid byte-swap cache corruption in libdb2

Apply a patch from NetBSD to restore the cached copy of a page to the
machine byte order after a write operation swapped it to the file byte
order.  As a regression test, modify test13 to sync the database file
after each put to exercise this bug.

(cherry picked from commit 56d02135d4c77b6aa0cb7136477d426248c60a6f)

ticket: 8483
version_fixed: 1.13.7

8 years agoAdd known file test case for btree byte swap
Tom Yu [Fri, 26 Aug 2016 22:40:49 +0000 (18:40 -0400)] 
Add known file test case for btree byte swap

Add a regression test for the preceding bugfix.  This test uses btree
database files with known contents and byte orders with short keys and
overflow data items.

(back ported from commit af3e7a4ac8b49ae8047ae2be7070d32feb69217d)

ticket: 8485
version_fixed: 1.13.7

8 years agoFix btree byte swapping for overflow data
Tom Yu [Fri, 26 Aug 2016 19:24:52 +0000 (15:24 -0400)] 
Fix btree byte swapping for overflow data

When operating on a btree database file of the opposite endianness,
libdb2 was swapping the wrong bytes if a record had a short key but
overflow data.  Fix this bug by not incrementing p when swapping a
P_BIGKEY overflow pointer, and by always skipping the full key size
before swapping a P_BIGDATA overflow pointer (instead of assuming that
a P_BIGKEY pointer always precedes a P_BIGDATA pointer).

(cherry picked from commit b6238a61769ffbf8a8ac653baeed1c3373b961f8)

ticket: 8485
version_fixed: 1.13.7

8 years agoTest btree unaligned byte swapping
Tom Yu [Fri, 26 Aug 2016 16:47:00 +0000 (12:47 -0400)] 
Test btree unaligned byte swapping

Add a regression test for unaligned accesses during btree byte
swapping.

(back ported from commit eaa03649fb5a3d983d48afe0124b15ad12b7bead)

ticket: 8484
version_fixed: 1.13.7

8 years agoAvoid unaligned access in btree byte swapping
Tom Yu [Fri, 26 Aug 2016 17:56:18 +0000 (13:56 -0400)] 
Avoid unaligned access in btree byte swapping

Apply a patch from NetBSD to use temporary character buffers instead
of doing an unaligned read when swapping bytes.

(cherry picked from commit 0936b2578b64be2c53c8cfccd70cbe93519d42fa)

ticket: 8484
version_fixed: 1.13.7

8 years agoImprove checking of decoded DB2 principal values
Greg Hudson [Tue, 23 Aug 2016 17:41:00 +0000 (13:41 -0400)] 
Improve checking of decoded DB2 principal values

In krb5_decode_princ_entry(), verify the length of the principal name
before calling krb5_parse_name() or strlen(), to avoid a possible
buffer read overrun.  Check all length fields for negative values.
Avoid performing arithmetic as part of bounds checks.  If the value of
key_data_ver is unexpected, return KRB5_KDB_BAD_VERSION instead of
aborting.

(cherry picked from commit e3d9f03a658e247dbb43cb345aa93a28782fd995)

ticket: 8481
version_fixed: 1.13.7

8 years agoFix leak in krb5_server_decrypt_ticket_keytab()
Seemant Choudhary [Wed, 24 Aug 2016 16:20:01 +0000 (12:20 -0400)] 
Fix leak in krb5_server_decrypt_ticket_keytab()

When we skip a keytab entry because it is of the wrong enctype, free
it before continuing.

(cherry picked from commit 9984c2343c96f3aaaf8a8d6dfc1b6de1eae533c2)

ticket: 8482
version_fixed: 1.13.7

8 years agoFix GSSRPC server credential memory leak
Greg Hudson [Tue, 23 Aug 2016 16:35:50 +0000 (12:35 -0400)] 
Fix GSSRPC server credential memory leak

In svc_auth_gss.c, stop using the global svcauth_gss_creds, and
instead keep a credential in struct svc_rpc_gss_data.  This change
ensures that the same credential is used for each accept_sec_context
call for a particular context, and ensures that the credential is
freed when the authentication data is destroyed.  Also, do not acquire
a credential when the default name is used (as it is in kadmind) as it
is not needed.

Leave the svcauth_gss_creds around for the backportable fix as it is
in the library export list.  It will be removed in a subsequent
commit.

(cherry picked from commit 670d9828086e979d5cdfd26f00ca88958a03754e)

ticket: 8480
version_fixed: 1.13.7

8 years agoUse responder for non-preauth AS requests
Greg Hudson [Fri, 5 Aug 2016 16:28:03 +0000 (12:28 -0400)] 
Use responder for non-preauth AS requests

If no AS reply key is computed during pre-authentication (typically
because no pre-authentication was required by the KDC), ask for the
password using the responder before calling gak_fct for the key, and
supply any resulting responder items to gak_fct.

(cherry picked from commit 0639adc91ae9f66496171d14a232eae3c02bda0d)

ticket: 8454
version_fixed: 1.13.7

8 years agoHandle errors from curs_init in db2 back end
Tom Yu [Thu, 11 Aug 2016 20:27:33 +0000 (16:27 -0400)] 
Handle errors from curs_init in db2 back end

ctx_iterate could ignore errors from curs_init.  Actually pass them up
to the caller.

(cherry picked from commit da4447bd3a9e12485cf2e6cc925dcc386585a0c1)

ticket: 8473
version_fixed: 1.13.7

8 years agoFix KDC to drop repeated in-progress requests
Sarah Day [Mon, 15 Aug 2016 20:11:31 +0000 (16:11 -0400)] 
Fix KDC to drop repeated in-progress requests

When a KDC receives a repeated request while the original request is
still in progress, it is supposed to be to drop the request.  Commit
f07760088b72a11c54dd72efbc5739f231a4d4b0 introduced a bug in this
logic, causing the KDC to instead send an empty reply.  In
kdc_check_lookaside(), return a NULL reply_packet for empty entries,
restoring the expected behavior.

[ghudson@mit.edu: edited commit message, added a comment]

(cherry picked from commit 847fc7b3caa823c219c97cc307ccb8d7d519a20f)

ticket: 8477
version_fixed: 1.13.7

8 years agoFix leak on error in libkadm5_srv initialization
Greg Hudson [Thu, 14 Jul 2016 15:15:40 +0000 (11:15 -0400)] 
Fix leak on error in libkadm5_srv initialization

In init_any(), free handle->params on failure.

(cherry picked from commit a60ed5c039642ec0bd6cdefba89762c3455fb84c)

ticket: 8453
version_fixed: 1.13.7

8 years agoFix leak in capaths processing
Greg Hudson [Wed, 29 Jun 2016 04:01:04 +0000 (00:01 -0400)] 
Fix leak in capaths processing

In k5_client_realm_path(), free the list of strings returned by
rtree_capaths_vals().

(cherry picked from commit 08756ce56bddab79afa4ee24b80243d8f822559d)

ticket: 8447
version_fixed: 1.13.7

8 years agoFix leak in kadm5_hook interface
Greg Hudson [Wed, 29 Jun 2016 02:15:17 +0000 (22:15 -0400)] 
Fix leak in kadm5_hook interface

In k5_kadm5_hook_free_handles(), free each handle structure as well as
its module data.

(cherry picked from commit 40f25ae58415304006dd66ad55eeeb7505d1a816)

ticket: 8445
version_fixed: 1.13.7

8 years agoFix unlikely leak in sendto_kdc
Greg Hudson [Wed, 29 Jun 2016 02:10:35 +0000 (22:10 -0400)] 
Fix unlikely leak in sendto_kdc

If a TCP connection is killed after it allocates the buffer (so is no
longer in READING state), free the buffer during cleanup.

(cherry picked from commit 6895dc9f204520e7f4da8da879cc67c149bc4e6b)

ticket: 8444
version_fixed: 1.13.7

8 years agoFix leak in FAST OTP client processing
Greg Hudson [Wed, 29 Jun 2016 01:38:57 +0000 (21:38 -0400)] 
Fix leak in FAST OTP client processing

In set_pa_data(), after encoding the OTP request and stealing the
pointer from the resulting krb5_data object, free the krb5_data
container.

(cherry picked from commit 7029efc11525299b87b9024280ef1d9f82059ec5)

ticket: 8443
version_fixed: 1.13.7

8 years agoFix leak in DB2 krb5_db_promote() implementation
Greg Hudson [Tue, 28 Jun 2016 22:09:35 +0000 (18:09 -0400)] 
Fix leak in DB2 krb5_db_promote() implementation

In krb5_db2_merge_nra_iterator(), free the entry loaded from the
source DB.

(cherry picked from commit 0c5f74a25f226b2ea61a0ad7906a7c6605fc3533)

ticket: 8442
version_fixed: 1.13.7

8 years agoFix leak in ulog_replay()
Greg Hudson [Tue, 28 Jun 2016 22:01:55 +0000 (18:01 -0400)] 
Fix leak in ulog_replay()

ulog_conv_2dbentry() allocates a krb5_db_entry container; the caller
should not also do so.

(cherry picked from commit 2908839fcae0a12c56514d551ed1f19a7797cddb)

ticket: 8441
version_fixed: 1.13.7

8 years agoFix krb5_get_init_creds_password() pwchange leak
Greg Hudson [Tue, 28 Jun 2016 18:52:31 +0000 (14:52 -0400)] 
Fix krb5_get_init_creds_password() pwchange leak

When krb5_get_init_creds_password() attempts to change the password,
make sure to free code_string along all exit paths.

(cherry picked from commit 3e5f7709e1928f1e814c427f2811d9204a167439)

ticket: 8440
version_fixed: 1.13.7

8 years agoFix leak in gss_display_name() for non-MN names
Greg Hudson [Tue, 28 Jun 2016 16:28:11 +0000 (12:28 -0400)] 
Fix leak in gss_display_name() for non-MN names

RFC 2744 states that the gss_display_name() output_name_type result is
"a pointer into static storage, and should be treated as read-only by
the caller (in particular, the application should not attempt to free
it)".  For non-mechanism names, we were making a copy of the name type
from the union name structure, causing a memory leak; stop doing that.

(cherry picked from commit 20fcbf2cb820df0d31e66bb11f64fb50a31008f5)

ticket: 8439
version_fixed: 1.13.7

8 years agoFix leaks on error in krb5 gss_acquire_cred()
Greg Hudson [Mon, 27 Jun 2016 21:49:57 +0000 (17:49 -0400)] 
Fix leaks on error in krb5 gss_acquire_cred()

In acquire_cred_context(), when releasing the partially constructed
cred on error, make sure to free the password and impersonator fields,
and to destroy the ccache if we created it.

(cherry picked from commit ee7315964e52fe351ddb6884e0e8baf1ecce2144)

ticket: 8437
version_fixed: 1.13.7

8 years agoFix leak on error in libkadm5_clnt initialization
Greg Hudson [Mon, 27 Jun 2016 06:00:26 +0000 (02:00 -0400)] 
Fix leak on error in libkadm5_clnt initialization

In init_any(), free handle->lhandle on failure.

(cherry picked from commit 39b96f8531aefa73f1c48f99e0e0229936a7dcaa)

ticket: 8435
version_fixed: 1.13.7

8 years agoFix memory leak destroying DIR ccache
Greg Hudson [Sun, 26 Jun 2016 04:46:39 +0000 (00:46 -0400)] 
Fix memory leak destroying DIR ccache

Credential cache destroy methods are supposed to free the krb5_ccache
structure as well as its contents, but dcc_destroy() was not doing so.

(cherry picked from commit 6f8597f85642562bf672eb9a3be542907d0555c1)

ticket: 8433
version_fixed: 1.13.7

8 years agoWarn about dump -recurse nonfunctionality
Tom Yu [Wed, 3 Aug 2016 21:00:05 +0000 (17:00 -0400)] 
Warn about dump -recurse nonfunctionality

kdb5_util dump -recurse hasn't behaved as documented since krb5-1.5,
when the DAL was integrated.  Restoring it is a nontrivial amount of
work, so just document it for now.

(cherry picked from commit eb8dc865efec4938d74a7955fdcd02bbee4c22b9)

ticket: 8470
version_fixed: 1.13.7

9 years agoUpdate for krb5-1.13.6-postrelease
Tom Yu [Tue, 26 Jul 2016 23:11:56 +0000 (19:11 -0400)] 
Update for krb5-1.13.6-postrelease

9 years agoUpdates for krb5-1.13.6 krb5-1.13.6-final
Tom Yu [Fri, 22 Jul 2016 20:32:21 +0000 (16:32 -0400)] 
Updates for krb5-1.13.6

9 years agomake update-po
Tom Yu [Thu, 21 Jul 2016 20:12:00 +0000 (16:12 -0400)] 
make update-po

9 years agomake depend
Tom Yu [Thu, 21 Jul 2016 19:55:22 +0000 (15:55 -0400)] 
make depend

9 years agoFix S4U2Self KDC crash when anon is restricted
Greg Hudson [Tue, 19 Jul 2016 15:00:28 +0000 (11:00 -0400)] 
Fix S4U2Self KDC crash when anon is restricted

In validate_as_request(), when enforcing restrict_anonymous_to_tgt,
use client.princ instead of request->client; the latter is NULL when
validating S4U2Self requests.

CVE-2016-3120:

In MIT krb5 1.9 and later, an authenticated attacker can cause krb5kdc
to dereference a null pointer if the restrict_anonymous_to_tgt option
is set to true, by making an S4U2Self request.

  CVSSv2 Vector: AV:N/AC:H/Au:S/C:N/I:N/A:C/E:H/RL:OF/RC:C

(cherry picked from commit 93b4a6306a0026cf1cc31ac4bd8a49ba5d034ba7)
[tlyu@mit.edu: removed test case depending on absent functionality]

ticket: 8458
version_fixed: 1.13.6

9 years agoFix error handling in k5_expand_path()
Greg Hudson [Fri, 15 Jul 2016 22:51:31 +0000 (18:51 -0400)] 
Fix error handling in k5_expand_path()

In k5_expand_path_tokens_extra(), don't throw away non-zero return
statuses in the cleanup handler.  Reported by Will Fiveash.

(cherry picked from commit 55b46445980584644980cbe32f261eb5ba3d14eb)

ticket: 8455
version_fixed: 1.13.6

9 years agoUpdate LDAP docs for password lockout
Greg Hudson [Thu, 7 Jul 2016 20:58:02 +0000 (16:58 -0400)] 
Update LDAP docs for password lockout

The KDC now needs write access to the LDAP KDB, unless password
lockout and tracking of the last successful authentication time are
disabled.  Update the example LDAP access control configuration in
conf_ldap.rst to reflect this, add a note that only read access is
required if lockout is disabled, and add a section to lockout.rst
calling out the need for write access.  Reported by Will Fiveash.

[ci skip]

(cherry picked from commit c6550832235c63ccfaceb61864e887a675b02619)

ticket: 8452
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoFix typo in doc/user/tkt_mgmt.rst
Tom Yu [Tue, 31 May 2016 19:01:21 +0000 (15:01 -0400)] 
Fix typo in doc/user/tkt_mgmt.rst

[ci skip]

(cherry picked from commit 8b5259b9d17a441a6914e141862c3fa29c234c3d)

ticket: 8417
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoFix profile_flush_to_file() state corruption
Greg Hudson [Thu, 23 Jun 2016 16:01:56 +0000 (12:01 -0400)] 
Fix profile_flush_to_file() state corruption

In write_data_to_file(), do not clear the profile data object's flags.
If the call to this function resulted from profile_flush_to_file(), we
do not want to clear the DIRTY flag, and we especially do not want to
clear the SHARED flag for a data object which is part of
g_shared_trees.  Instead, clear the DIRTY flag in
profile_flush_file_data().

Add a test case to prof_test1 to exercise the bug in unfixed code.
Also modify test1 to abandon the altered profile after flushing it to
a file, to preserve the external behavior of the script before this
fix.

(cherry picked from commit 32a05995ff9df0d5ef8aff0d020900a37747670d)

ticket: 8431
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoFix incorrect recv() size calculation in libkrad
Nathaniel McCallum [Tue, 21 Jun 2016 20:12:36 +0000 (16:12 -0400)] 
Fix incorrect recv() size calculation in libkrad

Before this patch libkrad would always subtract the existing buffer
length from pktlen before passing it to recv().  In the case of stream
sockets, this is incorrect since krad_packet_bytes_needed() already
performs this calculation.  Subtracting the buffer length twice could
cause integer underflow on the len parameter to recv().

(cherry picked from commit c969e8a37617e9c7743a28177dd3808f7d08cee9)

ticket: 8430
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoFix kadmin min_life check with nonexistent policy
Greg Hudson [Wed, 8 Jun 2016 04:00:55 +0000 (00:00 -0400)] 
Fix kadmin min_life check with nonexistent policy

In kadmind, self-service key changes require a check against the
policy's min_life field.  If the policy does not exist, this check
should succeed according to the semantics introduced by ticket #7385.
Fix check_min_life() to return 0 if kadm5_get_policy() returns
KADM5_UNK_POLICY.  Reported by John Devitofranceschi.

(back ported from commit 5fca279ca4d18f1b5798847a98e7df8737d2eb7c)

ticket: 8427
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoFix unlikely pointer error in get_in_tkt.c
Greg Hudson [Mon, 9 May 2016 17:45:06 +0000 (13:45 -0400)] 
Fix unlikely pointer error in get_in_tkt.c

In add_padata(), reset the caller's pointer and ensure the list is
terminated as soon as realloc() succeeds; otherwise, the old pointer
could be left behind if a later allocation fails.

(cherry picked from commit 24452cd737951fa6e0f35e97c6a644a9db0aa82d)

ticket: 8413
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoRelax t_sn2princ.py reverse resolution test
Tom Yu [Fri, 27 May 2016 19:19:43 +0000 (15:19 -0400)] 
Relax t_sn2princ.py reverse resolution test

Relax t_sn2princ.py check of the reverse resolution of the test
hostname.  The new requirement is that it be different from the
forward resolved hostname.  (There is also an existing implicit
requirement that it be in the mit.edu domain.)  This makes
t_sn2princ.py more robust against changes in the reverse resolution of
the test hostname.

(back ported from commit 45b34f8e8f10009435d86195ac17e02d1dd0684e)

ticket: 8422
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoAvoid setting AS key when OTP preauth fails
Nathaniel McCallum [Thu, 26 May 2016 20:54:29 +0000 (16:54 -0400)] 
Avoid setting AS key when OTP preauth fails

In otp_client_process(), call cb->set_as_key() later in the function
after the OTP request has been created.  The previous position of this
call caused the AS key to be replaced even when later code in the
function failed, preventing other preauth mechanisms from retrieving
the correct AS key.

(cherry picked from commit 0712d0059d72ddeaf1764f8fa173a321e3bc072d)

ticket: 8421
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoClean t_sname_match in lib/krb5/krb
Tom Yu [Thu, 26 May 2016 20:10:49 +0000 (16:10 -0400)] 
Clean t_sname_match in lib/krb5/krb

Add a missing "$" to t_sname_match$(EXEEXT) in the clean rule in
lib/krb5/krb/Makefile.in.

(cherry picked from commit f22510adfba274c7302799965453e5d4aae3823a)

ticket: 8415
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoAdd tests for krb5_sname_match()
Greg Hudson [Thu, 12 May 2016 20:05:46 +0000 (16:05 -0400)] 
Add tests for krb5_sname_match()

(back ported from commit 83dae972736d823216c20dd559e30c7d41361289)

ticket: 8415
version_fixed: 1.13.6

9 years agoCheck princ length in krb5_sname_match()
Greg Hudson [Thu, 12 May 2016 20:03:06 +0000 (16:03 -0400)] 
Check princ length in krb5_sname_match()

krb5_sname_match() can read past the end of princ's component array in
some circumstances (typically when a keytab contains both "x" and
"x/y" principals).  Add a length check.  Reported by Spencer Jackson.

(cherry picked from commit fb9fcfa92fd37221c77e1a4c0b930383e6839e22)

ticket: 8415
version_fixed: 1.13.6

9 years agoAdd missing newline in kinit usage message
Andreas Schneider [Fri, 1 Apr 2016 07:07:29 +0000 (09:07 +0200)] 
Add missing newline in kinit usage message

There should be a newline after "options:" so that the verbose option
is aligned with other options.

(cherry picked from commit b8875152ea7d54eb77b0e83692cd6e803bd34214)

ticket: 8392
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoAdd test for empty K/M key data handling
Matt Rogers [Fri, 22 Apr 2016 16:53:41 +0000 (12:53 -0400)] 
Add test for empty K/M key data handling

(back ported from commit f2286a6493c7aab267cf0d9cca680edaf2968707)

ticket: 8395
version_fixed: 1.13.6
tags: -pullup
status: resolved

9 years agoFix krb5_def_fetch_mkey_list() segfault
Matt Rogers [Fri, 15 Apr 2016 21:27:36 +0000 (17:27 -0400)] 
Fix krb5_def_fetch_mkey_list() segfault

Return KRB5_KDB_NOMASTERKEY if K/M contains no key data, instead of
blindly dereferencing the first key data element.

(cherry picked from commit 83494605b2dd594ab33f9b3cfa5abc82cf0f9e92)

ticket: 8395
version_fixed: 1.13.6

9 years agoUpdate for krb5-1.13.5-postrelease
Tom Yu [Tue, 19 Apr 2016 00:56:22 +0000 (20:56 -0400)] 
Update for krb5-1.13.5-postrelease

9 years agoUpdates for krb5-1.13.5 krb5-1.13.5-final
Tom Yu [Fri, 15 Apr 2016 23:28:38 +0000 (19:28 -0400)] 
Updates for krb5-1.13.5

9 years agomake update-po
Tom Yu [Fri, 15 Apr 2016 23:37:26 +0000 (19:37 -0400)] 
make update-po

9 years agoSkip unnecessary mech calls in gss_inquire_cred()
Greg Hudson [Mon, 29 Feb 2016 21:51:22 +0000 (16:51 -0500)] 
Skip unnecessary mech calls in gss_inquire_cred()

If the caller does not request a name, lifetime, or cred_usage when
calling gss_inquire_cred(), service the call by copying the mechanism
list (if requested) but do not call into the mech.

This change alleviates an issue (reported by Adam Bernstein) where
SPNEGO can fail in the presence of expired krb5 credentials rather
than proceeding with a different mechanism, or can resolve a krb5
credential without the benefit of the target name.

(cherry picked from commit ff5eb892910eeac335d989ae14020da4ffbcc8ec)

ticket: 8373
version_fixed: 1.13.5
status: resolved
tags: -pullup

9 years agoBack to krb5-1.13-postrelease
Tom Yu [Mon, 11 Apr 2016 22:04:21 +0000 (18:04 -0400)] 
Back to krb5-1.13-postrelease

9 years agoUpdates for kfw-4.1-beta3 kfw-4.1-beta3
Tom Yu [Mon, 11 Apr 2016 21:22:19 +0000 (17:22 -0400)] 
Updates for kfw-4.1-beta3

9 years agoUpdates for kfw-4.1-beta3-mit kfw-4.1-beta3-mit
Tom Yu [Mon, 11 Apr 2016 20:31:42 +0000 (16:31 -0400)] 
Updates for kfw-4.1-beta3-mit

9 years agoUpdate copyright years
Tom Yu [Mon, 11 Apr 2016 20:03:12 +0000 (16:03 -0400)] 
Update copyright years

9 years agoDefault to LSA when TGT in LSA is inaccessible
Sarah Day [Thu, 18 Feb 2016 21:54:27 +0000 (16:54 -0500)] 
Default to LSA when TGT in LSA is inaccessible

When UAC is enabled and a domain user with Administrator privileges
logs in, the TGT is inaccessible.  Access to the TGT in a
UAC-restricted session may allow a non-elevated user to bypass the
UAC.  In a UAC-restricted session, ms2mit copies the current tickets
from the LSA ccache to the API ccache except the TGT, effectively
preventing a user session from getting additional service tickets
while appearing, for some purposes, to have a usable ccache.

Another bug is that ms2mit always copies from the LSA ccache to the
default ccache, even if the default ccache is itself the LSA ccache.

New behavior:

* If the TGT is accessible in the LSA ccache, copy the LSA ccache to
  the API ccache.

* Set the registry key for the default ccname to "API:" if the copy
  occurred, or to "MSLSA:" if it didn't occur.

[tlyu@mit.edu: edit commit message]

(cherry picked from commit 33b862799efa65b16e2acd1510c84d9f1ded2cbb)

ticket: 8390
version_fixed: 1.13.5
status: resolved
tags: -pullup

9 years agoAdd cleanup label in ms2mit
Sarah Day [Thu, 3 Mar 2016 21:49:06 +0000 (16:49 -0500)] 
Add cleanup label in ms2mit

(cherry picked from commit e033a81c891030741952e4743a0b5503bdbcea17)

ticket: 8390

9 years agoFix LDAP null deref on empty arg [CVE-2016-3119]
Greg Hudson [Mon, 14 Mar 2016 21:26:34 +0000 (17:26 -0400)] 
Fix LDAP null deref on empty arg [CVE-2016-3119]

In the LDAP KDB module's process_db_args(), strtok_r() may return NULL
if there is an empty string in the db_args array.  Check for this case
and avoid dereferencing a null pointer.

CVE-2016-3119:

In MIT krb5 1.6 and later, an authenticated attacker with permission
to modify a principal entry can cause kadmind to dereference a null
pointer by supplying an empty DB argument to the modify_principal
command, if kadmind is configured to use the LDAP KDB module.

    CVSSv2 Vector: AV:N/AC:H/Au:S/C:N/I:N/A:C/E:H/RL:OF/RC:ND

(cherry picked from commit 08c642c09c38a9c6454ab43a9b53b2a89b9eef99)

ticket: 8383
version_fixed: 1.13.5
status: resolved
tags: -pullup

9 years agoFix KDC memory leak on failed S4U2Proxy requests
Greg Hudson [Thu, 25 Feb 2016 16:27:40 +0000 (11:27 -0500)] 
Fix KDC memory leak on failed S4U2Proxy requests

Make sure to release stkt_server in process_tgs_req() if we fail
before its disposition is determined.  Reported by Will Fiveash.

(back ported from commit 194641a8ad7aecc6bc1d4848742c14569f14b900)

ticket: 8363
version_fixed: 1.13.5
status: resolved
tags: -pullup

9 years agoFix memory leak on error in KDC decrypt_2ndtkt()
Greg Hudson [Thu, 25 Feb 2016 16:19:17 +0000 (11:19 -0500)] 
Fix memory leak on error in KDC decrypt_2ndtkt()

Make sure to release the server principal entry in the cleanup handler
if it is not assigned to the output parameter.  Reported by Will
Fiveash.

(cherry picked from commit a1faaa4d6a404e3103f45e639b8890c3b141dfe1)

ticket: 8362
version_fixed: 1.13.5
status: resolved
tags: -pullup

9 years agoUpdate for krb5-1.13.4-postrelease
Tom Yu [Mon, 7 Mar 2016 21:56:06 +0000 (16:56 -0500)] 
Update for krb5-1.13.4-postrelease

9 years agoUpdates for krb5-1.13.4 krb5-1.13.4-final
Tom Yu [Fri, 4 Mar 2016 19:53:59 +0000 (14:53 -0500)] 
Updates for krb5-1.13.4

9 years agoUpdate README
Tom Yu [Fri, 8 Jan 2016 23:17:36 +0000 (18:17 -0500)] 
Update README

Add Sarah Day to the list of Kerberos Team members in the README file.

Update lists of Consortium Sponsors and contributors.

[ci skip]

9 years agomake update-po
Tom Yu [Mon, 29 Feb 2016 22:44:55 +0000 (17:44 -0500)] 
make update-po

9 years agoUpdate man pages
Tom Yu [Mon, 29 Feb 2016 22:44:35 +0000 (17:44 -0500)] 
Update man pages

9 years agoUpdate copyright years to 2016
Michael Mattioli [Tue, 5 Jan 2016 03:17:39 +0000 (22:17 -0500)] 
Update copyright years to 2016

Update copyright years to 2016 where appropriate.

9 years agoUse blocking lock when creating db2 KDB
Greg Hudson [Tue, 23 Feb 2016 22:15:18 +0000 (17:15 -0500)] 
Use blocking lock when creating db2 KDB

In 1.11 we switched from non-blocking to blocking locks in the DB2
module, but we missed one call to krb5_lock_file() in ctx_create_db().
This non-blocking lock can cause krb5_db_promote() to fail if the
database is locked when we try to promote the DB, in turn causing
kdb5_util load to fail.  Correct this call to make krb5_db_promote()
more robust.

(cherry picked from commit 1868916dbb60a64b92da217257b4ed021262afd3)

ticket: 8367
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoFix leaks in kadmin server stubs [CVE-2015-8631]
Greg Hudson [Fri, 8 Jan 2016 18:16:54 +0000 (13:16 -0500)] 
Fix leaks in kadmin server stubs [CVE-2015-8631]

In each kadmind server stub, initialize the client_name and
server_name variables, and release them in the cleanup handler.  Many
of the stubs will otherwise leak the client and server name if
krb5_unparse_name() fails.  Also make sure to free the prime_arg
variables in rename_principal_2_svc(), or we can leak the first one if
unparsing the second one fails.  Discovered by Simo Sorce.

CVE-2015-8631:

In all versions of MIT krb5, an authenticated attacker can cause
kadmind to leak memory by supplying a null principal name in a request
which uses one.  Repeating these requests will eventually cause
kadmind to exhaust all available memory.

    CVSSv2 Vector: AV:N/AC:L/Au:S/C:N/I:N/A:C/E:POC/RL:OF/RC:C

(cherry picked from commit 83ed75feba32e46f736fcce0d96a0445f29b96c2)

ticket: 8343
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoCheck for null kadm5 policy name [CVE-2015-8630]
Greg Hudson [Fri, 8 Jan 2016 17:52:28 +0000 (12:52 -0500)] 
Check for null kadm5 policy name [CVE-2015-8630]

In kadm5_create_principal_3() and kadm5_modify_principal(), check for
entry->policy being null when KADM5_POLICY is included in the mask.

CVE-2015-8630:

In MIT krb5 1.12 and later, an authenticated attacker with permission
to modify a principal entry can cause kadmind to dereference a null
pointer by supplying a null policy value but including KADM5_POLICY in
the mask.

    CVSSv2 Vector: AV:N/AC:H/Au:S/C:N/I:N/A:C/E:POC/RL:OF/RC:C

(cherry picked from commit b863de7fbf080b15e347a736fdda0a82d42f4f6b)

ticket: 8342
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoVerify decoded kadmin C strings [CVE-2015-8629]
Greg Hudson [Fri, 8 Jan 2016 17:45:25 +0000 (12:45 -0500)] 
Verify decoded kadmin C strings [CVE-2015-8629]

In xdr_nullstring(), check that the decoded string is terminated with
a zero byte and does not contain any internal zero bytes.

CVE-2015-8629:

In all versions of MIT krb5, an authenticated attacker can cause
kadmind to read beyond the end of allocated memory by sending a string
without a terminating zero byte.  Information leakage may be possible
for an attacker with permission to modify the database.

    CVSSv2 Vector: AV:N/AC:H/Au:S/C:P/I:N/A:N/E:POC/RL:OF/RC:C

(cherry picked from commit df17a1224a3406f57477bcd372c61e04c0e5a5bb)

ticket: 8341
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoFix iprop server stub error management
Greg Hudson [Thu, 14 Jan 2016 22:51:53 +0000 (17:51 -0500)] 
Fix iprop server stub error management

The ipropd stubs free client_name and server_name in the cleanup
handler, so should not free them in out-of-memory conditions.
Reported by Will Fiveash.

(cherry picked from commit d998b088adb875bc0a4e13c184075f91fb23336b)

ticket: 8347
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoFix EOF check in kadm5.acl line processing
Robbie Harwood [Wed, 13 Jan 2016 23:17:09 +0000 (18:17 -0500)] 
Fix EOF check in kadm5.acl line processing

On platforms where the char type is unsigned, the check for EOF (which
is negative) will always fail, leaving a 255 byte at the end of the
line.  This can cause a syntax error, in turn causing the contents of
kadm5.acl to be ignored.  Fix this bug by removing the cast on EOF.

[ghudson@mit.edu: more precisely describe consequences of bug in
commit message]

(cherry picked from commit 8fd85a77789496b8d7f8092f6e8a2824bc09a6cf)

ticket: 8346
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoFix memory leak in SPNEGO gss_init_sec_context()
Greg Hudson [Wed, 25 Nov 2015 19:43:35 +0000 (14:43 -0500)] 
Fix memory leak in SPNEGO gss_init_sec_context()

After the initial call to spnego_gss_init_sec_context(), the context
handle can leak if init_ctx_cont() returns an error, because the
cleanup handler assumes that spnego_ctx contains the value of
*context_handle.  Fix this leak by setting spnego_ctx before the if
block which contains that call.  Reported by Adam Bernstein.

(cherry picked from commit 159dbbd5ff14fdc2fa71fb3a8804eb401c914399)

ticket: 8281
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoMake ksu work with prompting clpreauth modules
Greg Hudson [Fri, 8 Jan 2016 16:54:55 +0000 (11:54 -0500)] 
Make ksu work with prompting clpreauth modules

Commit 5fd5a67c5a93514e7d0a64425baa007ad91f57de switched ksu from
using krb5_get_in_tkt_with_password() to
krb5_get_init_creds_password(), but did not supply a prompter
argument.  Pass krb5_prompter_posix so that clpreauth modules can
prompt for additional information during authentication.

(cherry picked from commit 23a16fb5eac733880e34a770882ed17b93b5d66c)

ticket: 8340
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoAdd .travis.yml
Tom Yu [Wed, 30 Dec 2015 20:26:54 +0000 (15:26 -0500)] 
Add .travis.yml

Do Travis CI testing with clang and gcc, on 64-bit Ubuntu Trusty.
Performance would probably be better using the container-based Travis
infrastructure, but that is currently limited to Precise, and we would
need some important apt packages whitelisted, e.g., dejagnu.

(cherry picked from commit 09e8307da049cf90bb1f7b9b4b1608a0b9130fd9)

ticket: 8339
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoIncrease hostname length in ipropd_svc.c
Tom Yu [Wed, 6 Jan 2016 20:46:40 +0000 (15:46 -0500)] 
Increase hostname length in ipropd_svc.c

On some systems, MAXHOSTNAMELEN is too short for valid fully qualified
domain names.  Use NI_MAXHOST instead in ipropd_svc.c.

(cherry picked from commit 39802ad406c294306a407ea3d1199941d8b5d773)

ticket: 8336
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoDon't canonicalize hostname in sim_client.c
Tom Yu [Wed, 30 Dec 2015 22:17:02 +0000 (17:17 -0500)] 
Don't canonicalize hostname in sim_client.c

krb5_mk_req() already canonicalizes the target hostname, so don't try
to use a buffer of size MAXHOSTNAMELEN to canonicalize the hostname
beforehand.  This buffer will be too short for some unusually long
FQDNs.

(cherry picked from commit 0491c778064e80aaf2aaeb4475a0db333542fed9)

ticket: 8336

9 years agoWork around uninitialized warning in cc_kcm.c
Tom Yu [Wed, 6 Jan 2016 20:24:16 +0000 (15:24 -0500)] 
Work around uninitialized warning in cc_kcm.c

Some versions of clang erroneously detect use of an uninitialized
variable reply_len in kcmio_call() when building on non-Mac platforms.
Initialize it to work around this warning.

(cherry picked from commit 40b007c0d8e2a12c6f4205ac111dee731c9d970c)

ticket: 8335
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoCheck internal context on init context errors
Simo Sorce [Tue, 5 Jan 2016 17:11:59 +0000 (12:11 -0500)] 
Check internal context on init context errors

If the mechanism deletes the internal context handle on error, the
mechglue must do the same with the union context, to avoid crashes if
the application calls other functions with this invalid union context.

[ghudson@mit.edu: edit commit message and code comment]

(cherry picked from commit 3beb564cea3d219efcf71682b6576cad548c2d23)

ticket: 8337
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoCheck context handle in gss_export_sec_context()
Tomas Kuthan [Tue, 29 Dec 2015 10:47:49 +0000 (11:47 +0100)] 
Check context handle in gss_export_sec_context()

After commit 4f35b27a9ee38ca0b557ce8e6d059924a63d4eff, the
context_handle parameter in gss_export_sec_context() is dereferenced
before arguments are validated by val_exp_sec_ctx_args().  With a null
context_handle, the new code segfaults instead of failing gracefully.
Revert this part of the commit and only dereference context_handle if
it is non-null.

(cherry picked from commit b6f29cbd2ab132e336b5435447348400e9a9e241)

ticket: 8334
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoSet TL_DATA mask flag for master key operations
Simo Sorce [Wed, 9 Dec 2015 23:09:18 +0000 (18:09 -0500)] 
Set TL_DATA mask flag for master key operations

When kdb5_util adds or removes master keys, it modifies tl-data but
doesn't set the KADM5_TL_DATA mask flag, causing KDB modules that rely
on this signaling (such as the LDAP module) not to store the tl-data
changes.  Fix this issue by setting the mask bit in add_new_mkey() and
kdb5_purge_mkeys().

[ghudson@mit.edu: edit commit message]

(cherry picked from commit c877f13c8985d820583b0d7ac1bb4c5dc36e677e)

ticket: 8327
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoAdd libkrb5support dependencies to test plugins
Greg Hudson [Fri, 11 Dec 2015 16:05:32 +0000 (11:05 -0500)] 
Add libkrb5support dependencies to test plugins

In some build environments, dependencies on libkrb5support can be
generated just from static inline functions in our header files, even
if those functions aren't used.  In two test plugin modules, use
$(KRB5_BASE_DEPLIBS) and $(KRB5_BASE_LIBS) to depend on libkrb5support
as well as libkrb5.  (This also pulls in libk5crypto, which is
unnecessary for these modules, but is inconsequential for a test
module.)  Reported by Will Fiveash.

(cherry picked from commit 5568d31f45fb78f505340a5b520b22d4dd3f6522)

ticket: 8326
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoFix k5crypto NSS iov processing bug
Greg Hudson [Mon, 7 Dec 2015 17:16:41 +0000 (12:16 -0500)] 
Fix k5crypto NSS iov processing bug

In k5_nss_gen_stream_iov(), don't stop processing the iov array if we
run across a zero-length iov.

(cherry picked from commit 08fafff29a11e61036021196aaae8c303d1a5662)

ticket: 8300
version_fixed: 1.13.4
tags: -pullup
status: resolved

9 years agoUpdate for krb5-1.13.3-postrelease
Tom Yu [Fri, 4 Dec 2015 18:52:41 +0000 (13:52 -0500)] 
Update for krb5-1.13.3-postrelease

9 years agoUpdates for krb5-1.13.3 krb5-1.13.3-final
Tom Yu [Thu, 3 Dec 2015 21:26:25 +0000 (16:26 -0500)] 
Updates for krb5-1.13.3

9 years agomake update-po
Tom Yu [Wed, 2 Dec 2015 22:03:55 +0000 (17:03 -0500)] 
make update-po

9 years agoUpdate man pages
Tom Yu [Wed, 2 Dec 2015 22:03:17 +0000 (17:03 -0500)] 
Update man pages

9 years agomake depend
Tom Yu [Wed, 2 Dec 2015 22:57:19 +0000 (17:57 -0500)] 
make depend

9 years agoCheck output params on GSS OID set functions
Tomas Kuthan [Wed, 30 Sep 2015 13:18:05 +0000 (15:18 +0200)] 
Check output params on GSS OID set functions

Add sanity checks for the output parameters of
generic_gss_create_empty_oid_set() and
generic_gss_add_oid_set_member(), which are used directly by the API
functions gss_create_empty_oid_set() and gss_add_oid_set_member().

[ghudson@mit.edu: edit commit message]

(cherry picked from commit c9e035794caa784b6cdf416e2b3f1d641d011390)

ticket: 8294 (new)
version_fixed: 1.13
status: resolved

9 years agoFix gss_inquire_names_for_mech() on MS krb5 mech
Tomas Kuthan [Wed, 30 Sep 2015 13:24:24 +0000 (15:24 +0200)] 
Fix gss_inquire_names_for_mech() on MS krb5 mech

Allow the krb5 mech to query names for the gss_mech_krb5_wrong OID
(the erroneous OID used in old Microsoft SPNEGO implementations).

[ghudson@mit.edu: edit commit message]

(cherry picked from commit 95736f7d51cce7551c3c20450ff56831a71043df)

ticket: 8293 (new)
version_fixed: 1.13.3
status: resolved

9 years agoFix typo in GSS_S_UNAUTHORIZED error message
Tomas Kuthan [Wed, 30 Sep 2015 13:14:40 +0000 (15:14 +0200)] 
Fix typo in GSS_S_UNAUTHORIZED error message

Remove an erroneous double space in the gss_display_status() result
for GSS_S_UNAUTHORIZED.

[ghudson@mit.edu: edit commit message]

(cherry picked from commit 36732bf2084803eef52ad56576e5a50f37ccd115)

ticket: 8292 (new)
version_fixed: 1.13.3
status: resolved