]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
7 years agoTrace log on k5tls load failure 718/head
Greg Hudson [Wed, 17 Jan 2018 23:31:43 +0000 (18:31 -0500)] 
Trace log on k5tls load failure

If sendto_kdc fails to establish an MS-KKDCP connection because the
k5tls module cannot be loaded, output a trace log before closing the
connection.  Reported by Jochen Hein.

ticket: 8634 (new)

7 years agoBack off Travis build to default dist 719/head
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).

7 years agoSet klog com_err context for each KDC request 716/head
Greg Hudson [Fri, 5 Jan 2018 21:27:19 +0000 (16:27 -0500)] 
Set klog com_err context for each KDC request

In setup_server_realm(), set the error context for the klog com_err
hook so that com_err() can retrieve error messages using the per-realm
context.

ticket: 8630

7 years agoRemove logging default severity
Greg Hudson [Mon, 8 Jan 2018 16:14:06 +0000 (11:14 -0500)] 
Remove logging default severity

The default severity for syslog outputs was only used for com_err()
messages (which are rare so far), and doesn't really make sense;
severity is a property of an individual message, not of a device.
Remove the severity field in a backward-compatible manner.

ticket: 8630

7 years agoImprove klog com_err hook
Greg Hudson [Thu, 4 Jan 2018 16:01:28 +0000 (11:01 -0500)] 
Improve klog com_err hook

Remove the code to read a severity from the first byte of format, as
it is an unclear interface and likely unused.  Also stop using the
configured default severity for syslog devices.  Instead, log at error
severity if a code is given, and at informational severity if one is
not.

Pass the formatted message to krb5_klog_syslog() so that it uses the
same format in log files as regular logged messages.

Add krb5_klog_set_context() to allow the context for extended error
messages to be reset, so that KDC plugins can log using the context
object for the realm being served for each request.

Use k5buf for simpler memory management in the hook function.

ticket: 8630

7 years agoAdd k5_buf_add_vfmt to k5buf interface
Greg Hudson [Thu, 4 Jan 2018 19:35:12 +0000 (14:35 -0500)] 
Add k5_buf_add_vfmt to k5buf interface

7 years agoFix securid_sam2 preauth for non-default salt 715/head
Greg Hudson [Wed, 3 Jan 2018 17:06:08 +0000 (12:06 -0500)] 
Fix securid_sam2 preauth for non-default salt

When looking up the client long-term key, look for any salt type, not
just the default salt type.

ticket: 8629

7 years agoInclude etype-info in for hardware preauth hints
Greg Hudson [Wed, 3 Jan 2018 16:59:14 +0000 (11:59 -0500)] 
Include etype-info in for hardware preauth hints

If a principal has the requires_hwauth bit set, include PA-ETYPE-INFO
or PA-ETYPE-INFO2 padata in the PREAUTH_REQUIRED error, as preauth
mechs involving hardware tokens may also use the principal's Kerberos
password.

ticket: 8629

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

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

ticket: 8624 (new)
target_version: 1.16
tags: pullup

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

ticket: 8623 (new)
target_version: 1.16
tags: pullup

7 years agoPoint to kerberos.org/dist 711/head
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.

ticket: 8622 (new)
target_version: 1.16
tags: pullup

7 years agoExpose context errors in pkinit_server_plugin_init 708/head
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]

ticket: 8621 (new)
target_version: 1.16
tags: pullup

7 years agoLength check when parsing GSS token encapsulation 710/head
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.

ticket: 8620 (new)
target_version: 1.16
target_version: 1.15-next
target_version: 1.14-next
tags: pullup

7 years agoFix PKINIT cert matching data construction 707/head
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

7 years agoFix default enctype order in docs 706/head
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.

ticket: 8616 (new)
target_version: 1.15-next
target_version: 1.16
tags: pullup

7 years agoRemove unused SAM setup code in KDC 705/head
Robbie Harwood [Mon, 9 Oct 2017 18:59:56 +0000 (14:59 -0400)] 
Remove unused SAM setup code in KDC

SAM version 1 preauth support was removed in commit
97023f5f10fb091225ad131a0b35f1d91cd12b1e.  Remove some lingering KDC
code which generated a DES-MD5 key and didn't use it for anything.

[ghudson@mit.edu: edited commit message]

7 years agoUpdates for krb5-1.17-prelease
Greg Hudson [Wed, 4 Oct 2017 15:50:48 +0000 (11:50 -0400)] 
Updates for krb5-1.17-prelease

Also update contributors in README.

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)

7 years agoRemove indirection around ccselect choose method
Robbie Harwood [Wed, 23 Aug 2017 18:55:55 +0000 (14:55 -0400)] 
Remove indirection around ccselect choose method

7 years agoBump bundled libverto for 0.3.0 release 701/head
Robbie Harwood [Thu, 31 Aug 2017 20:49:17 +0000 (16:49 -0400)] 
Bump bundled libverto for 0.3.0 release

Local changes:
  - Update upstream URL for fedorahosted deprecation.
  - Add verto_cleanup() to exports.

Upstream changes:
  - Strict c89 compliance.
  - Remove local asprintf() implementation.
  - Fix memleak when memory allocator is realloc().
  - Fix leaks of filenames during load.
  - Fix many unused variable warnings.
  - Factor out mutability check.
  - Properly handle _GNU_SOURCE checking.

ticket: 8612 (new)

7 years agoIssue trivially renewable tickets 695/head
Greg Hudson [Thu, 24 Aug 2017 19:58:07 +0000 (15:58 -0400)] 
Issue trivially renewable tickets

If the client specifically asks for renewable tickets but the
renewable end time (either requested or after restrictions) doesn't
exceed the ticket end time, issue a renewable ticket anyway.  Issuing
a non-renewable ticket (as we started doing in release 1.12, due to
the refactoring in commit 4f551a7ec126c52ee1f8fea4c3954015b70987bd)
can be unfriendly to scripts.

Also make sure never to issue a ticket with the renewable flag set but
no renew-till field, by clearing the renewable flag at the start of
kdc_get_ticket_renewtime().  The flag could have been previously set
by the assignment "enc_tkt_reply = *(header_ticket->enc_part2)" in
process_tgs_req() when processing a renewal request.

Modify t_renew.py to expect renewable tickets in some tests where it
previously did not, to check for specific lifetimes, and to check the
renewable flag as well as the renewable lifetime.

ticket: 8609

7 years agoAdd PKINIT test case for generic client cert 694/head
Greg Hudson [Fri, 25 Aug 2017 16:39:14 +0000 (12:39 -0400)] 
Add PKINIT test case for generic client cert

In t_pkinit.py, add a test case where a client cert with no extensions
is authorized via subject and issuer using a pkinit_cert_match string
attribute.

ticket: 8562

7 years agoAdd test cert with no extensions
Greg Hudson [Fri, 25 Aug 2017 16:33:33 +0000 (12:33 -0400)] 
Add test cert with no extensions

Add commands to make-certs.sh to generate a test client certificate
with no certificate extensions.  Re-run make-certs.sh.

ticket: 8562

7 years agoFix certauth built-in module returns
Greg Hudson [Thu, 24 Aug 2017 15:11:46 +0000 (11:11 -0400)] 
Fix certauth built-in module returns

The PKINIT certauth eku module should never authoritatively authorize
a certificate, because an extended key usage does not establish a
relationship between the certificate and any specific user; it only
establishes that the certificate was created for PKINIT client
authentication.  Therefore, pkinit_eku_authorize() should return
KRB5_PLUGIN_NO_HANDLE on success, not 0.

The certauth san module should pass if it does not find any SANs of
the types it can match against; the presence of other types of SANs
should not cause it to explicitly deny a certificate.  Check for an
empty result from crypto_retrieve_cert_sans() in verify_client_san(),
instead of returning ENOENT from crypto_retrieve_cert_sans() when
there are no SANs at all.

ticket: 8561

7 years agoFix kdcpolicy build issues 696/head
Greg Hudson [Mon, 28 Aug 2017 16:20:36 +0000 (12:20 -0400)] 
Fix kdcpolicy build issues

Fix mydir in plugins/kdcpolicy/test/Makefile.in so that the Makefile
can be rebuilt correctly.  Also change the name of the shared object
from "policy_test.so" to "kdcpolicy_test.so" for consistency.

ticket: 8606

7 years agoDon't set ctime in KDC error replies 697/head
Greg Hudson [Tue, 29 Aug 2017 15:19:36 +0000 (11:19 -0400)] 
Don't set ctime in KDC error replies

Setting the error ctime field to the client nonce assumes that the
client used its system time as the nonce, which is not recommended by
RFC 1510 and is prohibited by RFC 4120.  Omit the field instead, by
setting the structure field to 0.

ticket: 8610 (new)

7 years agoPreserve GSS context on init/accept failure 677/head
Greg Hudson [Fri, 14 Jul 2017 17:02:46 +0000 (13:02 -0400)] 
Preserve GSS context on init/accept failure

After gss_init_sec_context() or gss_accept_sec_context() has created a
context, don't delete the mechglue context on failures from subsequent
calls, even if the mechanism deletes the mech-specific context (which
is allowed by RFC 2744 but not preferred).  Check for union contexts
with no mechanism context in each GSS function which accepts a
gss_ctx_id_t.

CVE-2017-11462:

RFC 2744 permits a GSS-API implementation to delete an existing
security context on a second or subsequent call to
gss_init_sec_context() or gss_accept_sec_context() if the call results
in an error.  This API behavior has been found to be dangerous,
leading to the possibility of memory errors in some callers.  For
safety, GSS-API implementations should instead preserve existing
security contexts on error until the caller deletes them.

All versions of MIT krb5 prior to this change may delete acceptor
contexts on error.  Versions 1.13.4 through 1.13.7, 1.14.1 through
1.14.5, and 1.15 through 1.15.1 may also delete initiator contexts on
error.

ticket: 8598 (new)
target_version: 1.15-next
target_version: 1.14-next
tags: pullup

7 years agoUse standard comment in certauth plugin header 689/head
Greg Hudson [Sat, 19 Aug 2017 18:26:15 +0000 (14:26 -0400)] 
Use standard comment in certauth plugin header

Each pluggable interface header needs to include some boilerplate text
to make it clear what a module implementor needs to provide.  Include
that text in certauth_plugin.h.

ticket: 8561

7 years agoFix bugs in kdcpolicy commit 690/head
Greg Hudson [Sat, 19 Aug 2017 23:09:24 +0000 (19:09 -0400)] 
Fix bugs in kdcpolicy commit

Commit d0969f6a8170344031ef58fd2a161190f1edfb96 added tests using
"klist ccachname -e", which does not work with a POSIX-conformant
getopt() implementation such as the one in Solaris.  Fix
t_kdcpolicy.py to use "klist -e ccachename" instead.

The tests could fail if the clock second rolled over between kinit and
kvno.  Divide service ticket maximum lifetimes by 2 in the test module
to correctly exercise TGS policy restrictions and ensure that service
tickets are not constrained by the TGT end time.

Also use the correct trace macro when a kdcpolicy module declines to
initialize (my mistake when revising the commit, noted by rharwood).

ticket: 8606

7 years agoFix bugs in kadm5_auth commit 688/head
Greg Hudson [Sat, 19 Aug 2017 18:21:31 +0000 (14:21 -0400)] 
Fix bugs in kadm5_auth commit

Commit 92a1a7efe2fc43337416098f2227038a72f1e35a uses line after it is
freed in load_acl_file().  Move the k5_setmsg() call earlier to fix
it.  The same commit also used the wrong header underline in
krb5_conf.rst for the kadm5_auth interface subsection.  Fix it.

ticket: 8595

7 years agoAvoid repeating typedef in certauth_plugin.h 686/head
Greg Hudson [Mon, 14 Aug 2017 15:47:44 +0000 (11:47 -0400)] 
Avoid repeating typedef in certauth_plugin.h

Repeating an identical typedef is allowed by C11, but not C99 or C89.
Use the underlying structure type in certauth_plugin.h so that it can
safely be included along with kdb.h.

Also constify the name field in the vtable.

ticket: 8561

7 years agoAdd KDC policy pluggable interface 682/head
Robbie Harwood [Tue, 27 Jun 2017 21:15:39 +0000 (17:15 -0400)] 
Add KDC policy pluggable interface

Add the header include/krb5/kdcpolicy_plugin.h, defining a pluggable
interface for modules to deny AS and TGS requests and set maximum
ticket lifetimes.  This interface replaces the policy.c stub functions.

Add check_kdcpolicy_as() and check_kdcpolicy_tgs() as entry functions.
Call them after auth indicators and ticket lifetimes have been
determined.

Add a test module and a test script with basic kdcpolicy tests.  Add
plugin interface documentation in doc/plugindev/policy.rst.

Also authored by Matt Rogers <mrogers@redhat.com>.

ticket: 8606 (new)

7 years agoAdd tests for kadm5_auth interface 675/head
Greg Hudson [Sun, 2 Jul 2017 05:32:13 +0000 (01:32 -0400)] 
Add tests for kadm5_auth interface

Add a test plugin module to exercise features of the kadm5_auth
interface, and a Python test script using the module.  Also test the
initial ticket requirement for self-service key changes in
t_kadmin_acl.py.

ticket: 8595

7 years agoUse kadm5_auth interface in kadmind
Greg Hudson [Fri, 30 Jun 2017 15:54:09 +0000 (11:54 -0400)] 
Use kadm5_auth interface in kadmind

Convert the ACL code to a kadm5_auth module, and create a new module
for self-service authorization.  Use the kadm5_auth consumer code
instead of directly using the ACL code to authorize requests.

Do not assume self-service authorization in the RPC stubs or in
schpw_util_wrapper().  For key change requests, enforce the initial
ticket requirement whenever a client changes its own keys, regardless
of how it is authorized or which protocol it uses.  The initial ticket
check for protocol version 1 in process_chpw_request() is redundant
after this change, so remove it.

The old kadmin-based password change client authenticates to
kadmin/changepw and performs self-service get_principal, get_policy,
and chpass requests.  Continue to allow these operations, enforcing
the self-service requirement in addition to checking through the
kadm5_auth interface.  For get_policy requests, always look up the
client principal's policy name, for this check and for the
authorization layer's use.

The error messages for rename authorization failures are now more
vague (because there is a specific rename operation check in the
kadm5_auth interface, and we do not find out whether it failed due to
missing add or delete privileges).  Adjust t_kadmin_acl.py
accordingly.

ticket: 8595

7 years agoAdd kadm5_auth pluggable interface
Greg Hudson [Fri, 30 Jun 2017 15:51:42 +0000 (11:51 -0400)] 
Add kadm5_auth pluggable interface

Add a pluggable interface for authorizing kadmin operations, and the
consumer interface code in kadmind.

ticket: 8595

7 years agoLog failure details for mutex errors 684/head
Robbie Harwood [Tue, 8 Aug 2017 22:24:32 +0000 (18:24 -0400)] 
Log failure details for mutex errors

Log only when assertions themselves are enabled in order to keep code
small.

7 years agoRemove incomplete PKINIT OCSP support 683/head
Robbie Harwood [Mon, 31 Jul 2017 20:03:41 +0000 (16:03 -0400)] 
Remove incomplete PKINIT OCSP support

pkinit_kdc_ocsp is non-functional in the PKINIT OpenSSL crypto
implementation, so remove most traces of it, including its man page
entry.  If it is present in kdc.conf, error out of PKINIT
initialization instead of silently ignoring the realm entirely.

ticket: 8603 (new)

8 years agoMake ccache name work for klist/kdestroy -A 681/head
Greg Hudson [Tue, 25 Jul 2017 17:16:05 +0000 (13:16 -0400)] 
Make ccache name work for klist/kdestroy -A

In klist and kdestroy, if a ccache name is specified, set it as the
default ccache name, simplifying the code and making klist -l, klist
-A, and kdestroy -A can work with a specified ccache name.  Reported
by Robbie Harwood.

ticket: 8602 (new)

8 years agoAllow WARN_CFLAGS override for Solaris 680/head
Will Fiveash [Tue, 18 Jul 2017 23:24:18 +0000 (18:24 -0500)] 
Allow WARN_CFLAGS override for Solaris

In aclocal.m4, do not set WARN_CFLAGS and WARN_CXXFLAGS for the
Solaris native compiler if those variables were already set by the
user.  (We already did the same for gcc warning flags.)

[ghudson@mit.edu: rewrote commit message]

8 years agoPrevent null dereference with keyboard master key 679/head
Greg Hudson [Tue, 18 Jul 2017 16:29:12 +0000 (12:29 -0400)] 
Prevent null dereference with keyboard master key

If krb5_db_fetch_mkey() prompts for a master key and needs to
determine the kvno, check that the master entry contains any key data
before dereferencing the first element.  Reported by Joshua Schaeffer.

ticket: 8600 (new)
target_version: 1.15-next
target_version: 1.14-next
tags: pullup

8 years agoSimplify KDC status assignment 678/head
Greg Hudson [Mon, 17 Jul 2017 17:11:54 +0000 (13:11 -0400)] 
Simplify KDC status assignment

Omit assigning status values for very unlikely error cases.  Remove
the "UNKNOWN_REASON" fallback for validate_as_request() and
validate_tgs_request() as that fallback is now applied globally.

8 years agoPrevent KDC unset status assertion failures
Greg Hudson [Thu, 13 Jul 2017 16:14:20 +0000 (12:14 -0400)] 
Prevent KDC unset status assertion failures

Assign status values if S4U2Self padata fails to decode, if an
S4U2Proxy request uses invalid KDC options, or if an S4U2Proxy request
uses an evidence ticket which does not match the canonicalized request
server principal name.  Reported by Samuel Cabrero.

If a status value is not assigned during KDC processing, default to
"UNKNOWN_REASON" rather than failing an assertion.  This change will
prevent future denial of service bugs due to similar mistakes, and
will allow us to omit assigning status values for unlikely errors such
as small memory allocation failures.

CVE-2017-11368:

In MIT krb5 1.7 and later, an authenticated attacker can cause an
assertion failure in krb5kdc by sending an invalid S4U2Self or
S4U2Proxy request.

  CVSSv3 Vector: AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H/E:H/RL:O/RC:C

ticket: 8599 (new)
target_version: 1.15-next
target_version: 1.14-next
tags: pullup

8 years agoUpdate autoconf archive macros 676/head
Greg Hudson [Thu, 6 Jul 2017 04:00:45 +0000 (00:00 -0400)] 
Update autoconf archive macros

Update the macros imported from autoconf-archive to current versions.
Fixes an issue where ACX_PTHREAD fails on Solaris with the native
compiler because it detects an uninitialized read and treats it as an
error.

ticket: 8597

8 years agoClarify "all privileges" in kadm5.acl docs 674/head
Greg Hudson [Wed, 28 Jun 2017 22:06:29 +0000 (18:06 -0400)] 
Clarify "all privileges" in kadm5.acl docs

In the kadm5.acl example, be more careful about saying "all
privileges", as the recently added extract privilege is not covered by
"*" or "x".

ticket: 8594 (new)
target_version: 1.15-next
tags: pullup

8 years agoBump cmocka version in Travis build
Greg Hudson [Mon, 17 Jul 2017 15:43:32 +0000 (11:43 -0400)] 
Bump cmocka version in Travis build

8 years agoParse all kadm5.acl fields at startup 671/head
Greg Hudson [Wed, 21 Jun 2017 04:54:32 +0000 (00:54 -0400)] 
Parse all kadm5.acl fields at startup

Parse the client principal name, target principal name, and
restrictions field of kadm5.acl entries when the file is loaded, not
later on when an attempt is made to match the entry.

This change affects the error-handling behavior of kadm5.acl files.
Previously, a syntax error in the line structure (such as having only
one field) would cause the whole file to be rejected, but an error
within a principal name or restrictions string would cause only that
entry to be discarded.  After this change, any parsing failure will
cause the whole file to be rejected.

ticket: 8592 (new)

8 years agoModernize auth_acl.c
Greg Hudson [Wed, 21 Jun 2017 14:38:41 +0000 (10:38 -0400)] 
Modernize auth_acl.c

Change auth_acl.c to match current coding conventions.  Use more
consistent identifier names, and drop the kadm5int_ prefix as the code
is now part of kadmind.  Remove the acl_inited, acl_debug_level, and
acl_catchall_entry variables.  Move global state into a structure, to
make it easier to migrate to a module handle later.  Move
parse_restrictions() above parse_line() so it can later be used from
parse_line() without a forward declaration.  Rewrite get_line() and
parse_line() to avoid the use of fixed-sized static buffers and
sscanf().  Add a parse_entry() helper to make memory management in
parse_line() easier.  Add a free_acl_entry() helper (split out from
free_acl_entries()) to make error handling in parse_entry() easier.
Add a match_princ() helper to simplify find_entry().

Remove the GSS name translation wrapper in auth_acl.c.  In the server
stubs, use handle->current_caller for the client principal.  In the
iprop RPCs(), add a wrapper to parse the client display name before
calling acl_check().

8 years agoMove kadm5.acl code into kadmind
Greg Hudson [Mon, 12 Jun 2017 16:55:13 +0000 (12:55 -0400)] 
Move kadm5.acl code into kadmind

Only kadmind uses the kadm5.acl code, so move it from libkadm5srv into
kadmind.

8 years agoFix kadm5 setkey operation with LDAP KDB 672/head
Greg Hudson [Mon, 26 Jun 2017 21:31:37 +0000 (17:31 -0400)] 
Fix kadm5 setkey operation with LDAP KDB

Add mask assignments to kadm5_setv4key_principal() and
kadm5_setkey_principal_4() so that their changes to the principal are
properly written to KDB modules which use the mask flag, such as the
LDAP KDB module.  Reported by Frank Lonigro.

ticket: 8589
target_version: 1.15-next
target_version: 1.14-next
tags: pullup

8 years agoRemove unused async binding code in LDAP 673/head
Greg Hudson [Mon, 26 Jun 2017 21:52:10 +0000 (17:52 -0400)] 
Remove unused async binding code in LDAP

The server_info_update_pending field of krb5_ldap_server_handle was
never set to true, and we never define ASYNC_BIND.  Noted by Will
Fiveash.

8 years agoAdd aes-sha2 to default enctypes in docs 669/head
Greg Hudson [Wed, 21 Jun 2017 17:10:51 +0000 (13:10 -0400)] 
Add aes-sha2 to default enctypes in docs

Commit d1ec317288278d10ae34fde9b2414e4fca5c52dd added aes-sha2 to the
default permitted enctype lists and the aes family, but didn't update
the documentation.  Commit 33a500ea14286b0d42c3ad63df8b88b3849b33a3
updated the documentation for the aes family, but not for the default
enctype lists.  Reported by Weijun Wang.

ticket: 8593 (new)
target_version: 1.15-next
tags: pullup

8 years agoFix kadm5.acl error reporting 667/head
Greg Hudson [Mon, 19 Jun 2017 15:30:38 +0000 (11:30 -0400)] 
Fix kadm5.acl error reporting

In kadm5int_acl_get_line(), increment *lnp after skipping a blank or
comment line, so that kadm5int_acl_load_acl_file() correctly reports
the line number if it fails to parse a line.

In acl_syn_err_msg, use %.10s to limit the amount of the line included
in the error message, not %10s to left-pad it with spaces if it is
shorter than ten characters.

ticket: 8588 (new)
target_version: 1.15-next
target_version: 1.14-next
tags: pullup

8 years agoSuppress y2038 GSS tests when time_t is 32-bit 666/head
Greg Hudson [Thu, 15 Jun 2017 15:59:18 +0000 (11:59 -0400)] 
Suppress y2038 GSS tests when time_t is 32-bit

The GSSAPI time_t tests do not run correctly on 32-bit Solaris because
time_t conversions are involved in the "kinit -l 8500d" step.
Suppress the GSS y2038 tests when time_t is 32-bit.

ticket: 8352

8 years agoTurn off -Wmaybe-uninitialized 665/head
Greg Hudson [Thu, 15 Jun 2017 00:45:15 +0000 (20:45 -0400)] 
Turn off -Wmaybe-uninitialized

In gcc, maybe-uninitialized gives different warnings depending on the
optimization level, and in our experience usually gives false
positives.  We don't ask for it (except implicitly through -Wall), but
gcc bundles it into the error behavior of -Werror=uninitialized.
Explicitly turn it off so that builds with -Og and -Os don't error
out.

8 years agoAdd ktutil add_entry option to specify salt 662/head
Mubashir Kazia [Sun, 11 Jun 2017 13:30:34 +0000 (13:30 +0000)] 
Add ktutil add_entry option to specify salt

[ghudson@mit.edu: also fix minor leak in ktutil_add()]

ticket: 7647

8 years agoAllow unspecified kvno in keytab entries 664/head
Luke Howard [Mon, 12 Jun 2017 22:51:05 +0000 (18:51 -0400)] 
Allow unspecified kvno in keytab entries

In ktutil, make "-k 0" work when creating a keytab entry.  In the
keytab implementations, treat entries with unspecified kvnos as
low-priority matches.

[ghudson@mit.edu: adjusted to current file keytab code; added logic
for other keytab types; wrote commit message]

ticket: 3349

8 years agoAdd t_sha2 test program to .gitignore 661/head
Alexander Scheel [Tue, 6 Jun 2017 12:35:44 +0000 (08:35 -0400)] 
Add t_sha2 test program to .gitignore

[ghudson@mit.edu: also remove t_sha256, which was removed in commit
c438227afd763997c131339c1476f61d1628a20d when t_sha2 was added]

8 years agoPass local address to DAL audit_as_req 656/head
Andreas Schneider [Fri, 19 May 2017 09:00:52 +0000 (11:00 +0200)] 
Pass local address to DAL audit_as_req

In the KDC, pass the local address from dispatch() to
process_as_req(), then to log_as_req(), then to
krb5_db_audit_as_req(), and finally to the KDB modules.

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

ticket: 8583

8 years agoPass full local address to dispatch functions
Andreas Schneider [Fri, 19 May 2017 08:51:34 +0000 (10:51 +0200)] 
Pass full local address to dispatch functions

In net-server.c, pass a krb5_fulladdr representation of the local
address to dispatch.  This representation is more convenient for
kadmind, and will make it more convenient for the KDC to pass the
local address to the DAL audit_as_req.

[ghudson@mit.edu: rewrote commit message]

8 years agoConsistently name and constify address variables
Andreas Schneider [Fri, 19 May 2017 08:31:25 +0000 (10:31 +0200)] 
Consistently name and constify address variables

In libkdb5, libapputils, the KDC, kadmind, and both KDB modules, use
the name "remote_addr" for the variable containing the remote address.
In schpw.c:process_chpw_request(), use the name "local_addr" for the
parameter containing the local address.  Make the remote_addr
parameter const in libkdb5 and the DAL.

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

8 years agoKill TCP connections if getsockname fails
Andreas Schneider [Tue, 30 May 2017 07:50:10 +0000 (09:50 +0200)] 
Kill TCP connections if getsockname fails

In net-server.c:process_tcp_connection_read(), we don't expect
getsockname() to fail under ordinary circumstances, so instead of
passing a null local address to dispatch(), just error out.  Simplify
schpw.c:dispatch() by assuming a non-null local_saddr.

[ghudson@mit.edu: simplified schpw.c:dispatch(); rewrote commit
message]

8 years agoFix gmt_mktime for y2038 660/head
Greg Hudson [Fri, 26 May 2017 20:20:11 +0000 (16:20 -0400)] 
Fix gmt_mktime for y2038

gmt_mktime() is used as a fallback when the platform does not have
timegm().  Make it work for dates in the unsigned 32-bit range, not
the signed 32-bit range.

ticket: 8352

8 years agoUpdate man pages
Greg Hudson [Wed, 24 May 2017 19:55:37 +0000 (15:55 -0400)] 
Update man pages

8 years agoAdd aes-sha2 enctypes to aes family documentation 659/head
Robbie Harwood [Wed, 24 May 2017 15:55:25 +0000 (11:55 -0400)] 
Add aes-sha2 enctypes to aes family documentation

The functional portion of this change was made in commit
d1ec317288278d10ae34fde9b2414e4fca5c52dd.

ticket: 8585 (new)
target_version: 1.15-next
tags: pullup

8 years agoFree GSS checksum data deterministically 658/head
Tomas Kuthan [Tue, 16 May 2017 09:24:40 +0000 (11:24 +0200)] 
Free GSS checksum data deterministically

In the normal course of execution, md5.contents allocated by
kg_checksum_channel_bindings() in make_ap_req_v1() is freed in
make_gss_checksum().  But when there is a failure in
krb5_mk_req_extended() or in make_gss_checksum() before free is
called, the memory leaks.

This patch frees the memory unconditionally in make_ap_req_v1().

ticket: 8584 (new)
target_version: 1.15-next
target_version: 1.14-next
tags: pullup

8 years agoModernize coding style of most client programs 651/head
Michael Mattioli [Thu, 27 Apr 2017 01:34:57 +0000 (21:34 -0400)] 
Modernize coding style of most client programs

Adjust the style of kcpytkt, kdeltkt, kdestroy, kinit, klist, kpasswd,
and kvno to conform to current coding practices.

[ghudson@mit.edu: made additional style and naming changes; edited
commit message]

8 years agoRemove ksetpwd 657/head
Greg Hudson [Mon, 22 May 2017 19:12:58 +0000 (15:12 -0400)] 
Remove ksetpwd

ksetpwd was added in commit ec50322c3076ab4517fb4fb5cc3a931f6adb4f20
but is not installed as it was "not of release quality yet."  It has
not materially improved since then, and under current policy we do not
include unfinished code in the tree, so remove it.

8 years agoPass client address to DAL audit_as_req 654/head
Andreas Schneider [Thu, 18 May 2017 13:32:45 +0000 (15:32 +0200)] 
Pass client address to DAL audit_as_req

As this is an incompatible change to the API, also increment the DAL
and KDB versions.

ticket: 8583 (new)

8 years agoRemove vestigial svr_principal.c code 655/head
Greg Hudson [Wed, 17 May 2017 19:21:34 +0000 (15:21 -0400)] 
Remove vestigial svr_principal.c code

In kadm5_chpass_principal_3(), kadm5_randkey_principal_3(), and
kadm5_setv4key_principal(), remove the disabled code to enforce
pw_min_life (which is enforced in kadmind as noted in the comments),
as well as the unnecessary last_pwd lookups beforehand.

8 years agoUse krb5_timestamp where appropriate
Greg Hudson [Wed, 17 May 2017 19:14:15 +0000 (15:14 -0400)] 
Use krb5_timestamp where appropriate

Where krb5_int32 is used to hold the number of seconds since the
epoch, use krb5_timestamp instead.

8 years agoFix more time manipulations for y2038
Greg Hudson [Wed, 17 May 2017 18:52:09 +0000 (14:52 -0400)] 
Fix more time manipulations for y2038

Use timestamp helper functions to ensure that more operations are safe
after y2038, and display the current timestamp as unsigned in
krb5int_trace().

ticket: 8352

8 years agoAdd y2038 documentation 653/head
Greg Hudson [Thu, 4 May 2017 21:03:35 +0000 (17:03 -0400)] 
Add y2038 documentation

ticket: 8352

8 years agoAdd timestamp tests
Greg Hudson [Sat, 29 Apr 2017 21:30:36 +0000 (17:30 -0400)] 
Add timestamp tests

Add a test program for krb5int_validate_times() covering cases before
and across the y2038 boundary.  Add a GSSAPI test program to exercise
lifetime queries, and tests using it in t_gssapi.py for ticket end
times after y2038.  Add a new test script t_y2038.py which only runs
on platforms with 64-bit time_t to exercise end-user operations across
and after y2038.  Add an LDAP test case to test storage of post-y2038
timestamps.

ticket: 8352

8 years agoMake timestamp manipulations y2038-safe
Greg Hudson [Sat, 22 Apr 2017 16:52:17 +0000 (12:52 -0400)] 
Make timestamp manipulations y2038-safe

Wherever we manipulate krb5_timestamp values using arithmetic,
comparison operations, or conversion to time_t, use the new helper
functions in k5-int.h to ensure that the operations work after y2038
and do not exhibit undefined behavior.  (Relying on
implementation-defined conversion to signed values is okay as we test
that in configure.in.)

In printf format strings, use %u instead of signed types.  When
exporting creds with k5_json_array_fmt(), use a long long so that
timestamps after y2038 aren't marshalled as negative numbers.  When
parsing timestamps in test programs, use atoll() instead of atol() so
that positive timestamps after y2038 can be used as input.

In ksu and klist, make printtime() take a krb5_timestamp parameter to
avoid an unnecessary conversion to time_t and back.

As Leash does not use k5-int.h, use time_t values internally and
safely convert from libkrb5 timestamp values.

ticket: 8352

8 years agoAdd timestamp helper functions
Greg Hudson [Sat, 22 Apr 2017 13:49:12 +0000 (09:49 -0400)] 
Add timestamp helper functions

Add k5-int.h helper functions to manipulate krb5_timestamp values,
avoiding undefined behavior and treating negative timestamp values as
times between 2038 and 2106.  Add a doxygen comment for krb5_timestamp
indicating how third-party code should use it safely.

ticket: 8352

8 years agoRemove stray exit in t_referral.py 652/head
Greg Hudson [Thu, 4 May 2017 18:11:11 +0000 (14:11 -0400)] 
Remove stray exit in t_referral.py

Commit 1dc619624421002b1e64d3b8c7e270508381b3e6 included a stray
"exit(0)" for debugging.  Remove it.

ticket: 8579

8 years agoUse a random nonce in TGS requests 650/head
Greg Hudson [Tue, 25 Apr 2017 17:31:36 +0000 (13:31 -0400)] 
Use a random nonce in TGS requests

Commit ae0fee058ad883b2e82fa2b34f4e5f059e827a1b (ticket #5425) changed
the AS client code to use a random nonce, but left the TGS client code
using the current timestamp.  Use a random nonce for TGS requests as
well.

ticket: 8582 (new)

8 years agoDon't cache referral and alternate TGT replies 649/head
Greg Hudson [Tue, 25 Apr 2017 21:05:23 +0000 (17:05 -0400)] 
Don't cache referral and alternate TGT replies

During a TGS request, if we get a TGT response that we didn't directly
ask for (a referral TGT or an alternate TGT), don't cache it.  It
would have limited value in the cache as similar operations won't look
for that TGT.  If the overall TGS operation fails and is repeated, we
could wind up caching the same entry multiple times, which doesn't
work well with our current ccache implementations.

ticket: 8579

8 years agoFix uninitialized flags in MSLSA ccache type 646/head
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

8 years agoFix in_clock_skew() and use it in AS client code 645/head
Greg Hudson [Mon, 24 Apr 2017 06:02:36 +0000 (02:02 -0400)] 
Fix in_clock_skew() and use it in AS client code

Add a context parameter to the in_clock_skew() macro so that it isn't
implicitly relying on a local variable.  Use it in
get_in_tkt.c:verify_as_reply().

8 years agoUse krb5_check_clockskew() in KDC preauth mechs
Greg Hudson [Mon, 24 Apr 2017 05:45:11 +0000 (01:45 -0400)] 
Use krb5_check_clockskew() in KDC preauth mechs

8 years agoAllow clock skew in krb5 gss_context_time() 644/head
Greg Hudson [Sat, 22 Apr 2017 20:51:23 +0000 (16:51 -0400)] 
Allow clock skew in krb5 gss_context_time()

Commit b496ce4095133536e0ace36b74130e4b9ecb5e11 (ticket #8268) adds
the clock skew to krb5 acceptor context lifetimes for
gss_accept_sec_context() and gss_inquire_context(), but not for
gss_context_time().  Add the clock skew in gss_context_time() as well.

ticket: 8581 (new)
target_version: 1.14-next
target_version: 1.15-next
tags: pullup

8 years agoApply TCP timeouts to HTTPS (KKDCP) transport 643/head
Greg Hudson [Thu, 20 Apr 2017 19:33:10 +0000 (15:33 -0400)] 
Apply TCP timeouts to HTTPS (KKDCP) transport

We apply (as of ticket #7604) a ten-second minimum delay after a TCP
connection is accepted before creating new connections or sending UDP
packets.  Apply this timeout to HTTPS connections as well, by removing
the transport check in get_endtime().  As the endtime field is only
set by service_tcp_connect(), it will always have the value 0 for UDP
connection state objects, so there is no need to check the transport
type.

ticket: 8580
target_version: 1.15-next
target_version: 1.14-next
tags: pullup

8 years agoReplace UCS-2 conversions with UTF-16 641/head
Greg Hudson [Tue, 18 Apr 2017 18:01:06 +0000 (14:01 -0400)] 
Replace UCS-2 conversions with UTF-16

Where we convert between UTF-8 and UCS-2 (RC4 string-to-key and PAC
client info), use UTF-16 instead of UCS-2.  Add a test program for
the conversion functions.

ticket: 8577 (new)

8 years agoAdd various bound checks 626/head
Martin Kittel [Thu, 6 Apr 2017 19:03:23 +0000 (21:03 +0200)] 
Add various bound checks

Add bounds checks where Coverity otherwise reports a defect.  Most of
these checks are unlikely to be triggered in practice (Unicode regexps
are unused, and the caller of gss_krb5int_make_seal_token_v3 won't
have a plaintext object larger than half of the address space).  The
checks in dump.c could prevent memory access errors resulting from a
malformed dump file.

[ghudson@mit.edu: rewrote commit message]

ticket: 8578 (new)

8 years agoInitialize some magic fields
Martin Kittel [Thu, 16 Mar 2017 14:20:11 +0000 (15:20 +0100)] 
Initialize some magic fields

Initialize magic fields where Coverity otherwise detects that the
magic value would be used uninitialized.  (The "uses" are always
harmless copying.)

8 years agoReplace references to OS X 638/head
Michael Mattioli [Tue, 18 Apr 2017 02:16:37 +0000 (22:16 -0400)] 
Replace references to OS X

Replace references to Apple OS X with the updated OS name "macOS"
where applicable.

8 years agoUpdate Travis CI distribution to Xenial 640/head
Michael Mattioli [Wed, 19 Apr 2017 01:46:59 +0000 (21:46 -0400)] 
Update Travis CI distribution to Xenial

8 years agoFix realm_config.rst typo 642/head
Matt Rogers [Thu, 20 Apr 2017 15:18:50 +0000 (11:18 -0400)] 
Fix realm_config.rst typo

8 years agomake depend 639/head
Greg Hudson [Tue, 18 Apr 2017 16:40:00 +0000 (12:40 -0400)] 
make depend