]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
5 years agoUpdate for krb5-1.16.4-postrelease krb5-1.16
Greg Hudson [Thu, 12 Dec 2019 00:51:48 +0000 (19:51 -0500)] 
Update for krb5-1.16.4-postrelease

5 years agoUpdate for krb5-1.16.4 krb5-1.16.4-final
Greg Hudson [Wed, 11 Dec 2019 22:59:57 +0000 (17:59 -0500)] 
Update for krb5-1.16.4

5 years agomake update-po
Greg Hudson [Wed, 11 Dec 2019 20:43:17 +0000 (15:43 -0500)] 
make update-po

5 years agomake depend
Greg Hudson [Wed, 11 Dec 2019 20:34:48 +0000 (15:34 -0500)] 
make depend

5 years agoVarious gssalloc fixes
Greg Hudson [Sat, 23 Nov 2019 16:42:59 +0000 (11:42 -0500)] 
Various gssalloc fixes

The DEBUG_GSSALLOC version of gssalloc_realloc() must add the sentinel
size to the byte count.

The mechglue gss_decapsulate_token(), gss_encapsulate_token(), and
gss_export_sec_context() must use gssalloc_malloc() to allocate
output buffers.

The krb5 mech's gss_export_name_composite() and gss_pseudo_random()
implementations must use gssalloc_malloc() to allocate output buffers.

SPNEGO's gss_display_status() implementation must use gssalloc for the
output buffer.

The sample GSS server must use gss_release_buffer() to free the result
of gss_export_sec_context().

(cherry picked from commit ab5c4259bdbe51dd3f4b5c5aff22628188d04322)

ticket: 8852
version_fixed: 1.16.4

5 years agoFix gss_set_sec_context_option() context creation
Luke Howard [Tue, 19 Nov 2019 18:00:50 +0000 (13:00 -0500)] 
Fix gss_set_sec_context_option() context creation

If gss_set_sec_context_option() creates a union context object, it
must set the loopback pointer.

[ghudson@mit.edu: extracted this from a larger commit and wrote commit
message]

(cherry picked from commit 93b6d2a83849e157d7bec4f83fd94dbef10d6f05)

ticket: 8850
version_fixed: 1.16.4

5 years agoFix kadmin addprinc -randkey -kvno
Greg Hudson [Sun, 17 Nov 2019 00:54:51 +0000 (19:54 -0500)] 
Fix kadmin addprinc -randkey -kvno

Commit f07bca9fc94a5cf2e3c0f58226c7973a4b86b7a9 made addprinc -randkey
use a single RPC request, but the server-side handling always creates
the random keys with kvno 1.  If a kvno is specified in the RPC
request, set the kvno of the key data after creating it.  Reported by
Andreas Ladanyi.

(cherry picked from commit 462e85208d57b8d4120c99e801fbd156b9ccf16f)

ticket: 8848
version_fixed: 1.16.4

5 years agoFix SPNEGO fallback context handling
Greg Hudson [Mon, 11 Nov 2019 17:25:41 +0000 (12:25 -0500)] 
Fix SPNEGO fallback context handling

In init_ctx_call_init(), if gss_init_sec_context() fails while
producing the first SPNEGO initiator token, we remove the first
candidate mechanism from sc->mech_set and try again.  If
sc->ctx_handle is present after the error (more likely after commit
56f7b1bc95a2a3eeb420e069e7655fb181ade5cf), we must clear it before
falling back or it will cause subsequent attempts to fail.

(cherry picked from commit 40ecfad10dd36700028ff0f3d0d79ce7925fe545)

ticket: 8846
version_fixed: 1.16.4

5 years agoAccept GSS mechs which don't supply attributes
Greg Hudson [Sun, 6 Oct 2019 22:35:50 +0000 (18:35 -0400)] 
Accept GSS mechs which don't supply attributes

If gss_inquire_attrs_for_mech() is called for a mechanism which does
not implement it, the call will succeed with mech_attrs set to
GSS_C_NO_OID_SET (as is explicitly allowed by RFC 5587).
generic_gss_test_oid_set_member() returns an error on this value,
causing gss_accept_sec_context() to erroneously deny the mechanism
when no verifier credential handle is supplied.  Change
allow_mech_by_default() to explicitly check for no mech attribute set.

(cherry picked from commit bd321c9caa6dc4b034bc3279a1af39af4c41210d)

ticket: 8840
version_fixed: 1.16.4

5 years agoDon't skip past zero byte in profile parsing
Greg Hudson [Wed, 14 Aug 2019 15:46:14 +0000 (11:46 -0400)] 
Don't skip past zero byte in profile parsing

In parse_quoted_string(), only process an escape sequence if there is
a second character after the backlash, to avoid reading past the
terminating zero byte.  Reported by Lutz Justen.

(cherry picked from commit a449bfc16c32019fec8b4deea963a3e474b0d14d)

ticket: 8825
version_fixed: 1.16.4

5 years agoInitialize life/rlife in kdcpolicy interface
Robbie Harwood [Fri, 9 Aug 2019 18:07:22 +0000 (14:07 -0400)] 
Initialize life/rlife in kdcpolicy interface

A value of 0 indicates that the plugin doesn't wish to modify lifetimes.
Make this the default, rather than requiring all plugins to set these
values themselves.

(cherry picked from commit d81c5870013240c04642c8e0cb994b4c49e40ddf)

ticket: 8824
version_fixed: 1.16.4

5 years agoFix some return code handling bugs
Robbie Harwood [Thu, 2 May 2019 18:05:38 +0000 (14:05 -0400)] 
Fix some return code handling bugs

Fix five cases where return codes could be set (in unlikely cases) but
did not result in error exits.

[ghudson@mit.edu: squashed commits and rewrote commit message]

(cherry picked from commit 7c26740f9df3c79c3f01c3a4dda4d9dabba5298d)

ticket: 8801
version_fixed: 1.16.4

5 years agoFix t_otp.py for pyrad 2.2
Greg Hudson [Mon, 21 Oct 2019 17:56:55 +0000 (13:56 -0400)] 
Fix t_otp.py for pyrad 2.2

pyrad 2.2 throws a KeyError exception in DecodePacket if any
attributes from the packet are not defined in the dictionary.  Add a
dictionary entry for Service-Type so this doesn't happen.

(cherry picked from commit e60d01eb1686e112fba4743d4216ba61fec2bdc0)

ticket: 8841
version_fixed: 1.16.4

5 years agoEliminate qualname.plin
Greg Hudson [Wed, 31 Jul 2019 03:59:27 +0000 (23:59 -0400)] 
Eliminate qualname.plin

Rewriting the qualname Perl script to use getaddrinfo created an
unchecked dependency on Perl 5.14.  Instead, remove the script and use
the C program in tests/resolve for the kadmin and gssrpc test suites.

(cherry picked from commit 2a852b1f3fb00c7d19f4dbfba76f5ff7ebccd2c7)

5 years agoFix test suite issues affecting Travis images
Greg Hudson [Fri, 26 Jul 2019 22:33:28 +0000 (18:33 -0400)] 
Fix test suite issues affecting Travis images

In the utilities used by the dejagnu test suites, use
getaddrinfo()/getnameinfo() instead of
gethostbyname()/gethostbyaddr(), as the results can vary when the
local hostname appears in multiple lines in /etc/hosts.

In t_ccselect.py, don't cause an error if the canonicalized local
hostname is "localhost".  The tests will continue to run in this case,
as long as we don't try to create duplicate principals.

In sim_server.c, bind to the wildcard address instead of the resolved
local hostname, to resolve a mysterious problem observed in Travis
where the second of three sim_client send() operations fails with
ECONNREFUSED.

(cherry picked from commit c2497d46b4bad473e164943d67b58cd1ae261c3a)

6 years agoFix memory leak in 'none' replay cache type
Corene Casper [Sat, 16 Feb 2019 05:49:26 +0000 (00:49 -0500)] 
Fix memory leak in 'none' replay cache type

Commit 0f06098e2ab419d02e89a1ca6bc9f2828f6bdb1e fixed part of a memory
leak in the 'none' replay cache type by freeing the outer container,
but we also need to free the mutex.

[ghudson@mit.edu: wrote commit message]

(cherry picked from commit af2a3115cb8feb5174151b4b40223ae45aa9db17)

ticket: 8783
version_fixed: 1.16.4

6 years agoUpdate for krb5-1.16.3-postrelease
Greg Hudson [Mon, 7 Jan 2019 22:56:43 +0000 (17:56 -0500)] 
Update for krb5-1.16.3-postrelease

6 years agoUpdate for krb5-1.16.3 krb5-1.16.3-final
Greg Hudson [Mon, 7 Jan 2019 17:15:49 +0000 (12:15 -0500)] 
Update for krb5-1.16.3

6 years agoUpdate man pages
Greg Hudson [Mon, 7 Jan 2019 16:47:40 +0000 (11:47 -0500)] 
Update man pages

6 years agoUpdate copyright years to 2019
Greg Hudson [Mon, 7 Jan 2019 16:24:59 +0000 (11:24 -0500)] 
Update copyright years to 2019

(cherry picked from commit 7e127ebdbf88dccae9f9e5427e90319981a69266)

6 years agoFix double-close in ksu get_authorized_princ_names
Robbie Harwood [Tue, 18 Dec 2018 20:18:13 +0000 (15:18 -0500)] 
Fix double-close in ksu get_authorized_princ_names

If list_union() fails due to an allocation failure, then close_time()
will attempt to fclose users_fp and login_fp a second time.

This bug was originally introduced in commit
be95b52c2d0c21b1fe92f9f90166fc2fa8eecc95, and has been present in
every krb5 release since 1.1.

(cherry picked from commit 0b8c6f3e1e8e561aa56a7d4e2171320119991dae)

ticket: 8768
version_fixed: 1.16.3

6 years agoRemove incorrect KDC assertion
Isaac Boukris [Sat, 15 Dec 2018 09:56:36 +0000 (11:56 +0200)] 
Remove incorrect KDC assertion

The assertion in return_enc_padata() is reachable because
kdc_make_s4u2self_rep() may have previously added encrypted padata.
It is no longer necessary because the code uses add_pa_data_element()
instead of allocating a new list.

CVE-2018-20217:

In MIT krb5 1.8 or later, an authenticated user who can obtain a TGT
using an older encryption type (DES, DES3, or RC4) can cause an
assertion failure in the KDC by sending an S4U2Self request.

[ghudson@mit.edu: rewrote commit message with CVE description]

(cherry picked from commit 94e5eda5bb94d1d44733a49c3d9b6d1e42c74def)

ticket: 8767
version_fixed: 1.16.3

6 years agoDon't include all MEMORY ccaches in collection
Greg Hudson [Wed, 1 Aug 2018 19:53:12 +0000 (15:53 -0400)] 
Don't include all MEMORY ccaches in collection

In the MEMORY ccache implementation, only yield a cache in the
per-type cursor if it is the context default cache, matching the
behavior of FILE after commit 45360c9688ca963f75a2480f2cf818424fc3dc7b
(ticket 6955).

(cherry picked from commit 49bb627fed70c5258c151c5135ac3d95ed1ee55d)

ticket: 8720
version_fixed: 1.16.3

6 years agoUpdate for krb5-1.16.2-postrelease
Greg Hudson [Fri, 2 Nov 2018 04:46:36 +0000 (00:46 -0400)] 
Update for krb5-1.16.2-postrelease

6 years agoUpdate for krb5-1.16.2 krb5-1.16.2-final
Greg Hudson [Thu, 1 Nov 2018 23:49:46 +0000 (19:49 -0400)] 
Update for krb5-1.16.2

6 years agomake update-po
Greg Hudson [Thu, 1 Nov 2018 23:39:04 +0000 (19:39 -0400)] 
make update-po

6 years agoUpdate man pages
Greg Hudson [Thu, 1 Nov 2018 23:38:36 +0000 (19:38 -0400)] 
Update man pages

6 years agomake depend
Greg Hudson [Thu, 1 Nov 2018 23:37:23 +0000 (19:37 -0400)] 
make depend

6 years agoFix leak on error in kadm5 randkey handling
Greg Hudson [Thu, 25 Oct 2018 15:56:58 +0000 (11:56 -0400)] 
Fix leak on error in kadm5 randkey handling

An attempt to change the kadmin/history key with the -keepold flag
would leak the KDB entry and keysalt tuple as it returned an error.
Use the cleanup handler instead of returning directly.  Reported by
Bean Zhang.

(cherry picked from commit c4bdb3a1c890149a472ed98a94cf85316b143265)

ticket: 8759
version_fixed: 1.16.2

6 years agoUpdate man pages to reference kerberos(7)
Robbie Harwood [Mon, 15 Oct 2018 19:19:12 +0000 (15:19 -0400)] 
Update man pages to reference kerberos(7)

Remove broken references to old kerberos(1).  Reference kerberos(7)
from all man pages, and create/update their environment section so
that it references kerberos(7).

(cherry picked from commit 52cbe198d0d6f0085d4653b2f6a1ecc84d139118)

ticket: 8755
version_fixed: 1.16.2

6 years agoModernize kerberos(7)
Robbie Harwood [Mon, 15 Oct 2018 17:20:30 +0000 (13:20 -0400)] 
Modernize kerberos(7)

Update environment variable descriptions, using env_variables.rst as a
guide.  Replace the content in env_variables.rst with a pointer to
documentation at kerberos(7) so that we don't break external links and
don't duplicate content.

Replace references to rlogin.  Clarify and modernize other language.

(cherry picked from commit cdccdefa2d74d3abf5a8ae126e423af9d467d34f)

ticket: 8755
version_fixed: 1.16.2

6 years agoBring back general kerberos man page
Robbie Harwood [Tue, 9 Oct 2018 21:05:10 +0000 (17:05 -0400)] 
Bring back general kerberos man page

Restore the content of kerberos(1) as it stood in
0f81e372a2830c9170f6e08dfa956841d0ebdfb1.  Convert to ReST to match
the other man pages, and install it as the more appropriate
kerberos(7).

Build kerberos(7) and check it in to avoid breaking the build.

(cherry picked from commit c38197ee9808503f86ccffd4a2bd94389e17df0b)

ticket: 8755
version_fixed: 1.16.2

6 years agoCorrect kpasswd_server description in krb5.conf(5)
Robbie Harwood [Tue, 16 Oct 2018 21:32:29 +0000 (17:32 -0400)] 
Correct kpasswd_server description in krb5.conf(5)

(cherry picked from commit 762d804701f78fc76f728ec05a205eea6a2b2dd7)

ticket: 8754
version_fixed: 1.16.2

6 years agoFix up kdb5_util documentation
Greg Hudson [Mon, 15 Oct 2018 22:00:35 +0000 (18:00 -0400)] 
Fix up kdb5_util documentation

In kdb5_util.rst, reorder the main option summary to match the order
they are documented in below, and document the -x option.  Remove the
kdb5_util create -h switch case as 'h' has never been in the getopt
string.  Add the -r18 option to the kdb5_util dump and load option
summaries.  Reword the kdb5_util load -hash option.  Remove the
nonexistent kdb5_util load dbname parameter.

In database.rst, alter the example for loading a single principal to
use the dump principal filtering functionality, as that functionality
does not currently exist for load.

In the kdb5_util usage error message, reorder the main options to
match the order in the documentation and to fit within 79 columns.
Also add the -P option.

(cherry picked from commit fa000575085be71bfc326221a4d4d23fc00a1462)

ticket: 8751
version_fixed: 1.16.2

6 years agoFix incorrect TRACE usages to use {str}
Robbie Harwood [Thu, 27 Sep 2018 21:45:59 +0000 (17:45 -0400)] 
Fix incorrect TRACE usages to use {str}

(cherry picked from commit 3023a7d253c3052897b3d77d2f7ce992ff93e913)

ticket: 8743
version_fixed: 1.16.2

6 years agoDon't rely on default realm in S4U2Self client
Isaac Boukris [Sat, 15 Sep 2018 07:28:48 +0000 (10:28 +0300)] 
Don't rely on default realm in S4U2Self client

When converting server principal to enterprise name (to be possibly
used for cross-realm), ignore the realm when reparsing, to avoid a
spurious error if a default realm isn't configured.

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

(cherry picked from commit 13967567ca65a306c2d5fcb4a4aff71fb422cd80)

ticket: 8741
version_fixed: 1.16.2

6 years agoFix memory bugs in gss_add_cred() extension case
Greg Hudson [Thu, 13 Sep 2018 20:31:36 +0000 (16:31 -0400)] 
Fix memory bugs in gss_add_cred() extension case

If gss_add_cred() is called with both an input_cred_handle and an
output_cred_handle, it creates a new credential with the elements of
the input credential plus the requested element.  Making a shallow
copy of mechs_array and cred_array from the old credential creates
aliased pointers which become invalid when one of the two credentials
is released, leading to use-after-free and double-free errors.

Instead, make a full copy of the input cred for this case.  Make this
copy at the beginning so that union_cred can always be modified in
place (and freed on error using gss_release_cred() if we created it),
removing the need for new_union_cred, new_mechs_array, and
new_cred_array.  Use a stack object for target_mechs to simplify
cleanup and reduce the number of failure cases.

GSSAPI provides no facility for copying a credential; since we mostly
use the GSSAPI as our SPI for mechanisms, we have no simple way to
copy mechanism creds when copying the union cred.  Use
gss_export_cred() and gss_import_cred() if the mechanism provides
them; otherwise fall back to gss_inquire_cred() and
gss_acquire_cred().

(cherry picked from commit 288cbada833dc6af7d43dd308563b48b73347dfb)

ticket: 8734
version_fixed: 1.16.2

6 years agoAlways honor desired_name in gss_add_cred()
Greg Hudson [Sat, 15 Sep 2018 00:35:50 +0000 (20:35 -0400)] 
Always honor desired_name in gss_add_cred()

Remove the conditionalization around the desired_name processing in
gss_add_cred_from(), so that we always honor the requested name.

(cherry picked from commit 6d4eb6eb473c93f0db05409195448364382760a9)

ticket: 8737
version_fixed: 1.16.2

6 years agoClarify documentation on pkinit_identities
Greg Hudson [Thu, 6 Sep 2018 17:20:56 +0000 (13:20 -0400)] 
Clarify documentation on pkinit_identities

The documentation for pkinit_identities implies that we try harder to
use each value before ignoring the rest, when in fact we only go as
far as the first successful parse.  Soften the language and describe
the most likely use case for multiple values under the current
semantics.

(cherry picked from commit e095b436d92d9aa30106509b5ccf76719e1668b3)

ticket: 8733
version_fixed: 1.16.2

6 years agoDocument that DESTDIR must be an absolute path
Greg Hudson [Tue, 28 Aug 2018 16:11:35 +0000 (12:11 -0400)] 
Document that DESTDIR must be an absolute path

(cherry picked from commit 405dd1f1b56b39c2e7576df554a819ae5ab0076f)

ticket: 8731
version_fixed: 1.16.2

6 years agoFix memory leak in gss_add_cred() creation case
Greg Hudson [Thu, 13 Sep 2018 15:29:46 +0000 (11:29 -0400)] 
Fix memory leak in gss_add_cred() creation case

If gss_add_cred() is called with no input_cred_handle, it creates a
new credential with one element.  At the end of the function, use the
created credential as the output container, rather than creating a
second one and leaking the first.

Add a test program for gss_add_cred() and run it.

(cherry picked from commit 9e32161dc307a323fd36fd59e252583fe7b90526)

ticket: 8729
version_fixed: 1.16.2

6 years agoCheck mech cred in gss_inquire_cred_by_mech()
Greg Hudson [Thu, 13 Sep 2018 21:03:36 +0000 (17:03 -0400)] 
Check mech cred in gss_inquire_cred_by_mech()

If gss_inquire_cred_by_mech() is called with a mechanism and there is
no corresponding mechanism credential in the union cred, return
GSS_S_NO_CRED (as Heimdal does) instead of interrogating the mechanism
about the default credential.

(cherry picked from commit 8ea7e36661cfa6d8acb2b1af615870092a408cce)

ticket: 8736
version_fixed: 1.16.2

6 years agoFix a typo in the kswitch man page
Greg Hudson [Mon, 13 Aug 2018 02:53:29 +0000 (22:53 -0400)] 
Fix a typo in the kswitch man page

Fix a typo introduced by commit
fe44da52deea41483326debf2d9ad525f65e19f6.  Reported by Matthew
Krupcale.

(cherry picked from commit ab91899708731c1fb8fb880d5a6b300048478f66)

ticket: 8728
version_fixed: 1.16.2

6 years agoCheck strdup return in kadm5_get_config_params()
Greg Hudson [Tue, 28 Aug 2018 01:10:53 +0000 (21:10 -0400)] 
Check strdup return in kadm5_get_config_params()

When copying the realm string, if strdup() returns NULL, fail out with
ENOMEM instead of pretending the realm wasn't specified.  When copying
KRB5_DEFAULT_SUPPORTED_ENCTYPES, if strdup() returns NULL, fail out
with ENOMEM instead of crashing.  Reported by Bean Zhang.

(cherry picked from commit c0af219be218c02e72160ecd0521bc5b9bad546f)

ticket: 8727
version_fixed: 1.16.2

6 years agoUpdate many documentation links to https
Greg Hudson [Wed, 8 Aug 2018 19:30:38 +0000 (15:30 -0400)] 
Update many documentation links to https

Use secure URLs in the documentation where possible.  The Sphinx web
site does not appear to have a valid server cert, but does have a more
official URL.

(cherry picked from commit 71000b3361e08d9ef4980028679ae58ec0506095)

ticket: 8725
version_fixed: 1.16.2

6 years agoRemove outdated note in krb5kdc man page
Greg Hudson [Tue, 17 Jul 2018 15:33:03 +0000 (11:33 -0400)] 
Remove outdated note in krb5kdc man page

Commit af5b77c887bfff24603715f8296c00d5eb839b0c (ticket 8348) removed
the interface-scanning workaround for platforms without pktinfo
support, so there is no longer an interaction between the krb5kdc -w
option and this workaround.

(cherry picked from commit 728b66ab867e31c4c338c6a6309d629d39a4ec3f)

ticket: 8716
version_fixed: 1.16.2

6 years agoCorrectly handle fallback in KDC OTP callback
Robbie Harwood [Tue, 3 Oct 2017 18:28:47 +0000 (14:28 -0400)] 
Correctly handle fallback in KDC OTP callback

In otp_state.c:callback(), avoid invoking the failure callback when we
fall back to the next token.  Since request_send() consumes the
request, don't try to free it.

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

(cherry picked from commit 09c9b7d6f64767429e90ad11a529e6ffa9538043)

ticket: 8708
version_fixed: 1.16.2

6 years agoFix OTP secret file leak and whitespace removal
Greg Hudson [Tue, 26 Jun 2018 16:47:10 +0000 (12:47 -0400)] 
Fix OTP secret file leak and whitespace removal

In read_secret_file() in the OTP kdcpreauth module, add a cleanup
label and free filename on exit.  Also fix the whitespace stripping
code to correctly find the end offset, and use size_t rather than int
offsets.  The leak was reported by Bean Zhang.

(cherry picked from commit 396c736c0add2e13f4a9aaaefc9c86445b701953)

ticket: 8704
version_fixed: 1.16.2

6 years agoFix option parsing on Windows
Greg Hudson [Wed, 16 May 2018 04:52:08 +0000 (21:52 -0700)] 
Fix option parsing on Windows

Commit 8f9ade8ec50cde1176411085294f85ecfb2820a4 (ticket 8391) moved
the built-in getopt() and getopt_long() implementations from a static
library in util/windows to util/support, where (on Windows) it is
built into k5sprt32.dll or k5sprt64.dll.  The getopt() interface uses
global variables opterr, optind, optopt, and optarg, each renamed via
macro to have a k5_ prefix when we use the built-in implementation.
Data objects exported from DLLs need special handling in Windows; they
must be marked as DATA in the DLL .def file, and they must be declared
with "__declspec(dllimport)" in calling code.  Without this handling,
optind begins with a garbage value and getopt_long() returns -1
immediately, so client programs always behave as if they have no
arguments.

Stop unnecessarily declaring optind and optarg in client programs.
Declare the getopt() global variables with __declspec(dllimport) on
Windows, except when compiling getopt.c itself.  When creating
libkrb5support.exports on Windows (this file is later used by
lib/Makefile.in to create k5sprt32.def), add a DATA tag to the data
objects.

(cherry picked from commit 63246cf3513a0e8bdfc734db985af14c8c5170c5)

ticket: 8684
version_fixed: 1.16.2

6 years agoDisable canonicalization in ccselect tests
Greg Hudson [Wed, 4 Jul 2018 16:11:45 +0000 (16:11 +0000)] 
Disable canonicalization in ccselect tests

DNS canonicalization can interfere with the fallback tests by changing
"localhost" to have multiple components, or (less likely) changing the
parent domain of foo.krbtest.com or foo.krbtest2.com.

(cherry picked from commit b5457d8fb719a583b89e1ace186301a144e2c4c9)

6 years agoEscape curly braces in def-check.pl regexes
Greg Hudson [Sat, 5 May 2018 17:40:37 +0000 (13:40 -0400)] 
Escape curly braces in def-check.pl regexes

Recent versions of Perl issue a warning or error when an unescaped
open curly brace is used in a position where it might introduce a
quantifier in a regular expression.  Escape all regexp literal curly
braces in def-check.pl.

(cherry picked from commit 523e4ab050b13404a6929cc56ef873de8023e25c)

ticket: 8677
version_fixed: 1.16.2

6 years agoFix bugs with concurrent use of MEMORY ccaches
Greg Hudson [Sun, 1 Jul 2018 04:12:25 +0000 (00:12 -0400)] 
Fix bugs with concurrent use of MEMORY ccaches

A memory ccache iterator stores an alias into the cache object's
linked list of credentials.  If the cache is reinitialized while the
iterator is active, the alias becomes invalid.  Also, multiple handles
referencing the same memory ccache all use aliases to the same data
object; if one of the handles is destroyed, the other contains a
dangling pointer.

Fix the first issue by adding a generation counter to the cache and to
cursors, incremented each time the cache is initialized or destroyed.
Check the generation on each cursor step and end the iteration if the
list was invalidated.  Fix the second issue by adding a reference
count to the cache object, counting one reference for the table slot
and one for each open handle.  Empty the cache object on each destroy
operation, but only release the object when the last handle to it is
destroyed or closed.

Add regression tests for the two issues to t_cc.c.

The first issue was reported by Sorin Manolache.

(cherry picked from commit 146dadec8fe7ccc4149eb2e3f577cc320aee6efb)

ticket: 8202
version_fixed: 1.16.2

7 years agoUpdate for krb5-1.16.1-postrelease
Greg Hudson [Fri, 4 May 2018 14:26:30 +0000 (10:26 -0400)] 
Update for krb5-1.16.1-postrelease

7 years agoUpdate for krb5-1.16.1 krb5-1.16.1-final
Greg Hudson [Thu, 3 May 2018 14:33:33 +0000 (10:33 -0400)] 
Update for krb5-1.16.1

7 years agomake update-po
Greg Hudson [Wed, 2 May 2018 22:13:23 +0000 (18:13 -0400)] 
make update-po

7 years agoUpdate man pages
Greg Hudson [Wed, 2 May 2018 22:12:49 +0000 (18:12 -0400)] 
Update man pages

7 years agomake depend
Greg Hudson [Wed, 2 May 2018 22:12:16 +0000 (18:12 -0400)] 
make depend

7 years agoBack off Travis build to default dist
Greg Hudson [Thu, 18 Jan 2018 21:56:12 +0000 (16:56 -0500)] 
Back off Travis build to default dist

Travis appears to have deployed a testing xenial environment which
runs a daemon that sometimes interferes with apt commands.  Remove the
"dist: xenial" line so we run in the default, supported distribution
(currently trusty).

(cherry picked from commit 7011c2c5c027852138283f46416917cea41b96cb)

7 years agoSet error message on KCM get_princ failure
Robbie Harwood [Fri, 27 Apr 2018 17:51:39 +0000 (13:51 -0400)] 
Set error message on KCM get_princ failure

This matches the expected behavior from other ccache types.  Most
notably, the KEYRING equivalent was added in
c25fc42e8eac7350209df61e4a7b9960d17755ca

(cherry picked from commit 58f60f3df7a625ccdcce23dfadd52dc335fd8da7)

ticket: 8675
version_fixed: 1.16.1

7 years agoFix PKINIT rule matching against UPN SANs
Greg Hudson [Thu, 22 Mar 2018 23:46:22 +0000 (19:46 -0400)] 
Fix PKINIT rule matching against UPN SANs

Commit 46ff765e1fb8cbec2bb602b43311269e695dbedc (for ticket 8528)
broke rule-based matching of UPN SANs using the <SAN> rule type.  To
fix this regression, make crypto_retrieve_cert_sans() return UPN SANs
in their original string form, and only parse them into principal
names in pkinit_srv.c:verify_client_san().  In
pkinit_cert_matching_data, store UPN SANs as strings separately from
PKINIT SANs instead of concatenating them together, and match original
UPN strings against <SAN> rule regexps.  Add a test case.

(cherry picked from commit 0f26c1c7504777d6e7bfa1d3dee575c504ab6c05)

ticket: 8670
version_fixed: 1.16.1

7 years agoFix doubled "kadmind:" in kadmind fail_to_start()
Greg Hudson [Mon, 23 Apr 2018 18:54:17 +0000 (14:54 -0400)] 
Fix doubled "kadmind:" in kadmind fail_to_start()

Commit 779a335f4e2deb2d76caf7d0dd3de847a040c050 added the
fail_to_start() helper in ovsec_kadmd.c, accidentally sending the
program name to stderr twice.  Remove one of them.

(cherry picked from commit 047d6641bc74696b7cbba0daf56abe632a1b8940)

ticket: 8669
version_fixed: 1.16.1

7 years agoFix KDC null dereference on large TGS replies
Robbie Harwood [Fri, 20 Apr 2018 20:16:02 +0000 (16:16 -0400)] 
Fix KDC null dereference on large TGS replies

For TGS requests, dispatch() doesn't set state->active_realm, which
leads to a NULL dereference in finish_dispatch() if the reply is too
big for UDP.  Prior to commit 0a2f14f752c32a24200363cc6b6ae64a92f81379
the active realm was a global and was set when process_tgs_req()
called setup_server_realm().

Move TGS decoding out of process_tgs_req() so that we can set
state->active_realm before any errors requiring response.  Add a test
case.

[ghudson@mit.edu: edited commit message; added test case; reduced code
duplication; removed server handle from process_tgs_req() parameters]

(cherry picked from commit 6afa8b4abf8f7c5774d03e6b15ee7288ad68d725)

ticket: 8666
version_fixed: 1.16.1

7 years agoDocument comments in krb5.conf
Greg Hudson [Fri, 30 Mar 2018 20:54:44 +0000 (16:54 -0400)] 
Document comments in krb5.conf

(cherry picked from commit 80a4d553d54f09d7467f090a92964236a7a7d44b)

ticket: 8660
version_fixed: 1.16.1

7 years agoContinue after KRB5_CC_END in KCM cache iteration
Fabiano FidĂȘncio [Wed, 28 Mar 2018 16:27:06 +0000 (18:27 +0200)] 
Continue after KRB5_CC_END in KCM cache iteration

The KCM server returns KRB5_CC_END in response to a GET_CACHE_BY_UUID
request to indicate that the specified ccache uuid no longer exists.
In krb5_ptcursor_next(), ignore this error and continue the iteration,
as the Heimdal KCM client code does.

In addition to addressing the case where a third party deletes a cache
between the GET_CACHE_UUID_LIST request and when we reach that uuid in
the iteration, this change also fixes a bug in kdestroy -A where the
caller deletes the primary cache and we later request it by uuid when
iterating over the list.

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

(cherry picked from commit 49087f5e6309f298f8898c35af6f4ade418ced60)

ticket: 8658
version_fixed: 1.16.1

7 years agoAllow validation of PACs with enterprise names
Isaac Boukris [Tue, 13 Mar 2018 23:19:17 +0000 (01:19 +0200)] 
Allow validation of PACs with enterprise names

In k5_pac_validate_client(), if we are verifying against an enterprise
principal, parse the PAC_CLIENT_INFO field as an enterprise principal.
This scenario may arise in the response to an S4U2Self request for an
enterprise principal, as the KDC does not appear to canonicalize the
client principal requested in PA-FOR-USER.

[ghudson@mit.edu: rewrote commit message; adjusted style]

(cherry picked from commit f876aab80a69f9b934cd7f4e2339e3815aa8c4bf)

ticket: 8649
version_fixed: 1.16.1

7 years agoFix capaths "." values on client
Greg Hudson [Sat, 3 Mar 2018 18:44:00 +0000 (13:44 -0500)] 
Fix capaths "." values on client

Commit b72aef2c1cbcc76f7fba14ddc54a4e66e7a4e66c (ticket 6966)
introduced k5_client_realm_path() for use on the client in place of
krb5_walk_realm_tree(), but failed to handle the special case of a
capaths "." value as is done in the latter function.  Correct that
omission and add a test case.

(cherry picked from commit f8d0877f848563d07152a0ee191fe82846fdb8f1)

ticket: 8646
version_fixed: 1.16.1

7 years agoFix KDC encrypting key memory leak on some errors
Greg Hudson [Tue, 27 Feb 2018 16:56:58 +0000 (11:56 -0500)] 
Fix KDC encrypting key memory leak on some errors

Commit 0ba5ccd7bb3ea15e44a87f84ca6feed8890f657d separated the
allocation and destruction of encrypting_key, causing it to leak when
any of the intervening calls jump to the cleanup label.  Currently the
leak manifests on transited or authdata failures.  Move encrypting_key
destruction to the cleanup label so that it can't leak.  Reported by
anedvedicky@gmail.com.

(cherry picked from commit 1bcf2742d504a22b7354251bbc1e19c3dacd95f3)

ticket: 8645
version_fixed: 1.16.1

7 years agoFix memory leak in KDC PKINIT code
sashan [Tue, 20 Feb 2018 22:03:36 +0000 (23:03 +0100)] 
Fix memory leak in KDC PKINIT code

Commit e5c77a11341a79e6af1e5aef7c587a5b75a9e378 introduced a memory
leak of the client public key in server_process_dh().  Free
client_pubkey on success as well as failure.

(cherry picked from commit cefc250efd71515dd665b606bcb993e617068758)

ticket: 8644
version_fixed: 1.16.1

7 years agoFix flaws in LDAP DN checking
Greg Hudson [Fri, 12 Jan 2018 16:43:01 +0000 (11:43 -0500)] 
Fix flaws in LDAP DN checking

KDB_TL_USER_INFO tl-data is intended to be internal to the LDAP KDB
module, and not used in disk or wire principal entries.  Prevent
kadmin clients from sending KDB_TL_USER_INFO tl-data by giving it a
type number less than 256 and filtering out type numbers less than 256
in kadm5_create_principal_3().  (We already filter out low type
numbers in kadm5_modify_principal()).

In the LDAP KDB module, if containerdn and linkdn are both specified
in a put_principal operation, check both linkdn and the computed
standalone_principal_dn for container membership.  To that end, factor
out the checks into helper functions and call them on all applicable
client-influenced DNs.

CVE-2018-5729:

In MIT krb5 1.6 or later, an authenticated kadmin user with permission
to add principals to an LDAP Kerberos database can cause a null
dereference in kadmind, or circumvent a DN container check, by
supplying tagged data intended to be internal to the database module.
Thanks to Sharwan Ram and Pooja Anil for discovering the potential
null dereference.

CVE-2018-5730:

In MIT krb5 1.6 or later, an authenticated kadmin user with permission
to add principals to an LDAP Kerberos database can circumvent a DN
containership check by supplying both a "linkdn" and "containerdn"
database argument, or by supplying a DN string which is a left
extension of a container DN string but is not hierarchically within
the container DN.

(cherry picked from commit e1caf6fb74981da62039846931ebdffed71309d1)

ticket: 8643
version_fixed: 1.16.1

7 years agoFix Leash AddDisplayItem() declaration
Greg Hudson [Wed, 7 Feb 2018 15:45:31 +0000 (10:45 -0500)] 
Fix Leash AddDisplayItem() declaration

Commit a9cbbf0899f270fbb14f63ffbed1b6d542333641 changed three
parameters in AddDisplayItem() from long to time_t, but did not change
the corresponding declaration in LeashView.h.  Fix that now.

(cherry picked from commit b1367abb2e2ff14446371155cb7e23a29b76aa87)

ticket: 8640
version_fixed: 1.16.1

7 years agoAlways set appdefault_get() output argument
Nehal J Wani [Sun, 28 Jan 2018 08:02:57 +0000 (03:02 -0500)] 
Always set appdefault_get() output argument

gcc 7 cannot determine that appdefault_get() always sets *ret_value
when it returns zero, so issues a "may be used uninitialized" warning
in its caller.  Set *ret_value at the beginning of the function body
in accordance with current practices.

[ghudson@mit.edu: clarified commit message]

(cherry picked from commit 364c608911af2f227695bb527d4e42f091ee8bd3)

ticket: 8639
version_fixed: 1.16.1

7 years agoPoint to kerberos.org/dist
Greg Hudson [Tue, 28 Nov 2017 17:44:09 +0000 (12:44 -0500)] 
Point to kerberos.org/dist

In the build documentation, point to https://kerberos.org/dist instead
of web.mit.edu.

(cherry picked from commit 2beca1cb25cdcedfc2d8e1b4e97a559a5962ba9a)

ticket: 8622
version_fixed: 1.16.1

7 years agoMerge duplicate subsections in profile library
Robbie Harwood [Tue, 10 Apr 2018 19:55:41 +0000 (15:55 -0400)] 
Merge duplicate subsections in profile library

Modify profile_add_node() to return the existing node, rather than
making a new one, when adding subsection configuration.

This fixes an issue where the first instance of a subsection will hide
the second instance entirely.  In particular, it was previously
impossible to split realm-specific configuration across multiple
config files.

[ghudson@mit.edu: adjusted style, added test case]

(cherry picked from commit efab9fa5a6d23c486467264e20b58bf5a9c60f0c)

ticket: 7863
version_fixed: 1.16.1

7 years agoUpdate copyright years to 2018
Michael Mattioli [Mon, 1 Jan 2018 19:45:23 +0000 (14:45 -0500)] 
Update copyright years to 2018

(cherry picked from commit ef7fc96fe51b6d4b757b925259f8c3f36d305090)

7 years agoUpdate for krb5-1.16-postrelease
Greg Hudson [Tue, 5 Dec 2017 20:38:55 +0000 (15:38 -0500)] 
Update for krb5-1.16-postrelease

7 years agoUpdate for krb5-1.16 krb5-1.16-final
Greg Hudson [Tue, 5 Dec 2017 17:01:12 +0000 (12:01 -0500)] 
Update for krb5-1.16

7 years agoUpdate config.guess, config.sub
Greg Hudson [Tue, 5 Dec 2017 16:03:56 +0000 (11:03 -0500)] 
Update config.guess, config.sub

(cherry picked from commit 7fcce80d0f02b2f84a1920940100fc1f55fbeb03)

ticket: 8624
version_fixed: 1.16

7 years agoUpdate features list for 1.16
Greg Hudson [Wed, 29 Nov 2017 21:46:21 +0000 (16:46 -0500)] 
Update features list for 1.16

(cherry picked from commit de219d2bea7a099d038126d652422fc4068e48b1)

ticket: 8623
version_fixed: 1.16

7 years agoUpdate for krb5-1.16-beta2-postrelease
Greg Hudson [Mon, 27 Nov 2017 16:49:07 +0000 (11:49 -0500)] 
Update for krb5-1.16-beta2-postrelease

7 years agoUpdate for krb5-1.16-beta2 krb5-1.16-beta2
Greg Hudson [Mon, 27 Nov 2017 16:22:49 +0000 (11:22 -0500)] 
Update for krb5-1.16-beta2

7 years agomake update-po
Greg Hudson [Mon, 27 Nov 2017 16:08:48 +0000 (11:08 -0500)] 
make update-po

7 years agoUpdate man pages
Greg Hudson [Mon, 27 Nov 2017 16:08:16 +0000 (11:08 -0500)] 
Update man pages

7 years agoExpose context errors in pkinit_server_plugin_init
Robbie Harwood [Mon, 13 Nov 2017 18:32:37 +0000 (13:32 -0500)] 
Expose context errors in pkinit_server_plugin_init

Commit 3ff426b9048a8024e5c175256c63cd0ad0572320 attempted to display
an error when OCSP support was requested, but this error message was
suppressed in pkinit_server_plugin_init().  Add a trace log for each
realm initialization error, and pass through the realm initialization
error when the KDC serves only one realm.  Other error messages from
pkinit_init_kdc_profile(), such as missing pkinit_identity or
pkinit_anchors, are also now exposted.

[ghudson@mit.edu: clarified commit message]

(cherry picked from commit 225aab3540c13c6289b22022d5e110f6fc26151d)

ticket: 8621
version_fixed: 1.16

7 years agoLength check when parsing GSS token encapsulation
Greg Hudson [Sat, 11 Nov 2017 18:42:28 +0000 (13:42 -0500)] 
Length check when parsing GSS token encapsulation

gssint_get_mech_type_oid() is used by gss_accept_sec_context() to
determine the mechanism of the token.  Without length checking, it
might read a few bytes past the end of the input token buffer.  Add
length checking as well as test cases for truncated encapsulations.
Reported by Bar Katz.

(cherry picked from commit f949e990f930f48df1f108fe311c58ae3da18b24)

ticket: 8620
version_fixed: 1.16

7 years agoFix default enctype order in docs
Greg Hudson [Wed, 11 Oct 2017 17:19:03 +0000 (13:19 -0400)] 
Fix default enctype order in docs

Commit 4c234d8754c063177bc627c6298b85020d91c223 added the aes-sha2
enctypes to the documented default enctypes, but in the wrong order.
Reported by Weijun Wang.

(cherry picked from commit e4ffb911497ecd3348c89fb459cc8ccae40bfe42)

ticket: 8616
version_fixed: 1.16

7 years agoFix PKINIT cert matching data construction
Greg Hudson [Tue, 17 Oct 2017 22:50:15 +0000 (18:50 -0400)] 
Fix PKINIT cert matching data construction

Rewrite X509_NAME_oneline_ex() and its call sites to use dynamic
allocation and to perform proper error checking.

ticket: 8617
target_version: 1.16
target_version: 1.15-next
target_version: 1.14-next
tags: pullup
(cherry picked from commit fbb687db1088ddd894d975996e5f6a4252b9a2b4)

7 years agoUpdate for krb5-1.16-beta1-postrelease
Greg Hudson [Thu, 5 Oct 2017 19:15:25 +0000 (15:15 -0400)] 
Update for krb5-1.16-beta1-postrelease

7 years agoUpdate for krb5-1.16-beta1 krb5-1.16-beta1
Greg Hudson [Thu, 5 Oct 2017 16:55:58 +0000 (12:55 -0400)] 
Update for krb5-1.16-beta1

7 years agomake update-po
Greg Hudson [Thu, 5 Oct 2017 16:48:59 +0000 (12:48 -0400)] 
make update-po

7 years agoUpdate README for krb5-1.16
Greg Hudson [Wed, 4 Oct 2017 15:41:20 +0000 (11:41 -0400)] 
Update README for krb5-1.16

7 years agoAdd German translation 435/head
Chris Leick [Wed, 6 Apr 2016 22:14:40 +0000 (18:14 -0400)] 
Add German translation

ticket: 8515 (new)

7 years agoAbort client preauth on keyboard interrupt 704/head
Greg Hudson [Fri, 22 Sep 2017 20:51:15 +0000 (16:51 -0400)] 
Abort client preauth on keyboard interrupt

Continuing client preauth after a keyboard interrupt is unexpected and
can manifest bugs (such as the one in ticket 8596) by invoking preauth
mechs we wouldn't ordinarily reach.  Based on a patch by Marc Dionne.

ticket: 8615 (new)

7 years agomake depend, man, update-po
Greg Hudson [Mon, 25 Sep 2017 15:29:21 +0000 (11:29 -0400)] 
make depend, man, update-po

7 years agoAdd --pid-file option to kpropd 703/head
Greg Hudson [Mon, 18 Sep 2017 22:34:42 +0000 (18:34 -0400)] 
Add --pid-file option to kpropd

ticket: 8607

7 years agoConvert kprop and kpropd to use getopt()
Greg Hudson [Mon, 18 Sep 2017 21:35:34 +0000 (17:35 -0400)] 
Convert kprop and kpropd to use getopt()

7 years agoFix AIX build issues 693/head
Greg Hudson [Wed, 23 Aug 2017 21:45:02 +0000 (17:45 -0400)] 
Fix AIX build issues

In k5-platform.h, only test for SHARED and define the finalizer as
static if we don't expect linker options to be used for finalizers.
SHARED is not a robust test (it isn't defined when building objects
for shared libraries on AIX, OSF/1, or sometimes IRIX because they
don't use separate PIC objects), and as linker finalizer options are
only applied when shared libraries are created, we don't have to worry
about finalizers happening for static libraries.

In expand_path.c, remove the unnecessary structure tag from "struct
token" as it conflicts with <net/if_arp.h> on AIX.

In localaddr.c, initialize output parameters at the beginning of
get_ifreq_array().  Otherwise, gcc cannot be sure that they are always
set when get_ifreq_array() returns 0, because we use errno as a return
value in one case.  Also remove two unused variables.

Use socklen_t instead of int for socket lengths in sim_client.c and
sim_client.h.

Based on patches from Tony Reix.

ticket: 8608 (new)

7 years agoLimit ticket lifetime to 2^31-1 seconds 699/head
Greg Hudson [Thu, 24 Aug 2017 20:00:33 +0000 (16:00 -0400)] 
Limit ticket lifetime to 2^31-1 seconds

Although timestamps above 2^31-1 are now valid, intervals exceeding
2^31-1 seconds may be treated incorrectly by comparison operations.

The initially computed interval in kdc_get_ticket_endtime() could be
negative if the requested end time is far in the future, causing the
function to yield an incorrect result.  (With the new larger value of
kdc_infinity, this could specifically happen if a KDC-REQ contains a
zero till field.)  Cap the interval at the maximum valid value.
Reported by Weijun Wang.

Avoid delta comparisons in favor of timestamp comparions in
krb5int_validate_times(), ksu's krb5_check_exp(), and clockskew
checks.

Also use a y2038-safe timestamp comparison in set_request_times() when
comparing the requested renewable end time to the requested ticket end
time.

ticket: 8352

7 years agoAllow small errors in t_renew.py tests 700/head
Greg Hudson [Thu, 31 Aug 2017 18:11:43 +0000 (14:11 -0400)] 
Allow small errors in t_renew.py tests

ticket: 8609

7 years agoFix make-certs.sh for OpenSSL 1.1 702/head
Greg Hudson [Wed, 6 Sep 2017 16:56:37 +0000 (12:56 -0400)] 
Fix make-certs.sh for OpenSSL 1.1

The openssl req commands in make-certs.sh contain -subj options which
were ignored in favor of the config file prior to OpenSSL 1.1.  When
they are used, they remove elements of the subject which are now
required by t_pkinit.py.  Remove them.

7 years agoAdd hostname-based ccselect module 687/head
Robbie Harwood [Wed, 23 Aug 2017 21:25:17 +0000 (17:25 -0400)] 
Add hostname-based ccselect module

The hostname module selects the ccache whose realm is the longest
parent domain tail of the uppercase server hostname.

[ghudson@mit.edu: minor edits]

ticket: 8613 (new)