]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
10 years agoUpdate for krb5-1.11.6-postrelease krb5-1.11
Tom Yu [Tue, 24 Feb 2015 22:56:33 +0000 (17:56 -0500)] 
Update for krb5-1.11.6-postrelease

10 years agoUpdates for krb5-1.11.6 krb5-1.11.6-final
Tom Yu [Mon, 23 Feb 2015 23:02:16 +0000 (18:02 -0500)] 
Updates for krb5-1.11.6

10 years agomake update-po
Tom Yu [Mon, 23 Feb 2015 19:19:32 +0000 (14:19 -0500)] 
make update-po

10 years agoUpdate manpages
Tom Yu [Mon, 23 Feb 2015 19:19:04 +0000 (14:19 -0500)] 
Update manpages

10 years agomake depend
Tom Yu [Mon, 23 Feb 2015 19:17:44 +0000 (14:17 -0500)] 
make depend

10 years agoUse calloc, not k5calloc in ldap back end
Tom Yu [Fri, 20 Feb 2015 16:43:33 +0000 (11:43 -0500)] 
Use calloc, not k5calloc in ldap back end

The changes cherry picked in 0149ee13d51b48d77fbbaa5c1109036332a5577c
rely on k5calloc(), which is not present in the 1.11 branch.
Compensate by using calloc() instead.

ticket: 8102
version_fixed: 1.11.6
status: resolved

10 years agoFix input race condition in t_skew.py
Greg Hudson [Wed, 5 Nov 2014 19:12:35 +0000 (14:12 -0500)] 
Fix input race condition in t_skew.py

In two of the kinit tests run by t_skew.py, we expect kinit to exit
before reading the password.  If we supply a password input for those
commands, we can fail with a broken pipe exception if the master
process tries to write the password after the slave process exits.

Also correctly check the output of the last kinit invocation.

(cherry picked from commit 2457bf66c466321dd36cd3c76bc36bb589d31587)

ticket: 8147 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix typo in doc for krb5_get_init_creds_keytab()
Tom Yu [Tue, 14 Oct 2014 18:40:34 +0000 (14:40 -0400)] 
Fix typo in doc for krb5_get_init_creds_keytab()

(cherry picked from commit 49f8ec5975df3cb5f204444df2a284b2e662df85)

ticket: 8146 (new)
version_fixed: 1.11.6
status: resolved

10 years agoParse "ktadd -norandkey" in remote kadmin client
Tom Yu [Thu, 16 Oct 2014 19:40:33 +0000 (15:40 -0400)] 
Parse "ktadd -norandkey" in remote kadmin client

The remote kadmin client would not parse the "-norandkey" option to
the ktadd subcommand, terminating option parsing and possibly causing
options to be interpreted as principal names.

(cherry picked from commit 13e9694b17945d43d0cfc203b2645204f2d87086)

ticket: 8148 (new)
version_fixed: 1.11.6
status: resolved

10 years agoReport output ccache errors getting initial creds
Greg Hudson [Mon, 20 Oct 2014 16:52:45 +0000 (12:52 -0400)] 
Report output ccache errors getting initial creds

In init_creds_step_reply, if we get an error storing output
credentials, do set ctx->complete (since retrieving creds or times
will work at this point) but don't suppress the error code.

(cherry picked from commit feeddfb78ca5de066a509b6be8551d036e0f2c8a)

ticket: 8145 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix cursor leak in krb5_verify_init_creds
Greg Hudson [Mon, 20 Oct 2014 17:19:26 +0000 (13:19 -0400)] 
Fix cursor leak in krb5_verify_init_creds

In copy_creds_except, call krb5_cc_end_seq_get so we don't leak the
ccache cursor.

(cherry picked from commit 62894f854daa8251554376b6b6810fd0e9fecb7f)

ticket: 8144 (new)
version_fixed: 1.11.6
status: resolved

10 years agoUpdate example enctypes in kdc_conf.rst
Tom Yu [Wed, 5 Nov 2014 20:57:51 +0000 (15:57 -0500)] 
Update example enctypes in kdc_conf.rst

Use modern enctypes for values of master_key_type and
supported_enctypes in the example kdc.conf in kdc_conf.rst.

(cherry picked from commit 3eeb1a7eaa6757502d73944b7694405cdd571e1c)

ticket: 8143 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix LDAP misused policy name crash [CVE-2014-5353]
Greg Hudson [Fri, 5 Dec 2014 19:01:39 +0000 (14:01 -0500)] 
Fix LDAP misused policy name crash [CVE-2014-5353]

In krb5_ldap_get_password_policy_from_dn, if LDAP_SEARCH returns
successfully with no results, return KRB5_KDB_NOENTRY instead of
returning success with a zeroed-out policy object.  This fixes a null
dereference when an admin attempts to use an LDAP ticket policy name
as a password policy name.

CVE-2014-5353:

In MIT krb5, when kadmind is configured to use LDAP for the KDC
database, an authenticated remote attacker can cause a NULL dereference
by attempting to use a named ticket policy object as a password policy
for a principal.  The attacker needs to be authenticated as a user who
has the elevated privilege for setting password policy by adding or
modifying principals.

Queries to LDAP scoped to the krbPwdPolicy object class will correctly
not return entries of other classes, such as ticket policy objects, but
may return success with no returned elements if an object with the
requested DN exists in a different object class.  In this case, the
routine to retrieve a password policy returned success with a password
policy object that consisted entirely of zeroed memory.  In particular,
accesses to the policy name will dereference a NULL pointer.  KDC
operation does not access the policy name field, but most kadmin
operations involving the principal with incorrect password policy
will trigger the crash.

Thanks to Patrik Kis for reporting this problem.

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

[kaduk@mit.edu: CVE description and CVSS score]

(cherry picked from commit d1f707024f1d0af6e54a18885322d70fa15ec4d3)
(cherry picked from commit 0a97ce4411b34e871ae503b78eedf61db27180ea)

ticket: 8142 (new)
version_fixed: 1.11.6
status: resolved

10 years agoCheck for null *iter_p in profile_iterator()
Greg Hudson [Wed, 14 Jan 2015 18:10:39 +0000 (13:10 -0500)] 
Check for null *iter_p in profile_iterator()

In profile_iterator(), return PROF_MAGIC_ITERATOR if *iter_p is NULL,
instead of dereferencing a null pointer, as we did prior to 1.10.
Correct calling code will not trigger this case, but incorrect code
has been reported in the field.

(cherry picked from commit 9a343200d305e7c8df6e556d63afaee42194175f)

ticket: 8141 (new)
version_fixed: 1.11.6
status: resolved

10 years agoExport function gss_add_cred_with_password
Robbie Harwood (frozencemetery) [Tue, 20 Jan 2015 20:43:40 +0000 (15:43 -0500)] 
Export function gss_add_cred_with_password

This function is already present in gssapi_ext.h, but without
exporting it, a link error will be produced every time it is used.

(cherry picked from commit 266cce14ee39f6d11b186ee988cffd0c2a119f3d)

ticket: 8140 (new)
version_fixed: 1.11.6
status: resolved

10 years agoAdd test for kinit -C WRONG_REALM response
Tom Yu [Sat, 7 Feb 2015 03:17:30 +0000 (22:17 -0500)] 
Add test for kinit -C WRONG_REALM response

(back ported from commit c0778ab2252ece4c3510788d9b72f7f5e3bb05dd)

ticket: 8122
version_fixed: 1.11.6
status: resolved

10 years agoDo not loop on principal unknown errors
Simo Sorce [Tue, 20 Jan 2015 18:48:34 +0000 (13:48 -0500)] 
Do not loop on principal unknown errors

If the canonicalize flag is set, the MIT KDC always return the client
principal when KRB5_KDC_ERR_C_PRICIPAL_UNKNOWN is returned.

Check that this is really a referral by testing that the returned
client realm differs from the requested one.

[ghudson@mit.edu: simplified and narrowed is_referral() contract.
Note that a WRONG_REALM response with e-data or FAST error padata
could now be passed through k5_preauth_tryagain() if it has an empty
crealm or a crealm equal to the requested client realm.  Such a
response is unexpected in practice and there is nothing dangerous
about handling it this way.]

(cherry picked from commit d5755694b620570defeecee772def90a2733c6cc)

ticket: 8122 (new)
subject: kinit -C loops chasing realm referrals against MIT KDC
version_fixed: 1.11.6
status: resolved

10 years agoFix gssrpc data leakage [CVE-2014-9423]
Greg Hudson [Mon, 29 Dec 2014 18:17:56 +0000 (13:17 -0500)] 
Fix gssrpc data leakage [CVE-2014-9423]

[MITKRB5-SA-2015-001] In svcauth_gss_accept_sec_context(), do not copy
bytes from the union context into the handle field we send to the
client.  We do not use this handle field, so just supply a fixed
string of "xxxx".

In gss_union_ctx_id_struct, remove the unused "interposer" field which
was causing part of the union context to remain uninitialized.

(cherry picked from commit 5bb8a6b9c9eb8dd22bc9526751610aaa255ead9c)

ticket: 8076 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix kadmind server validation [CVE-2014-9422]
Greg Hudson [Mon, 29 Dec 2014 18:27:42 +0000 (13:27 -0500)] 
Fix kadmind server validation [CVE-2014-9422]

[MITKRB5-SA-2015-001] In kadmind's check_rpcsec_auth(), use
data_eq_string() instead of strncmp() to check components of the
server principal, so that we don't erroneously match left substrings
of "kadmin", "history", or the realm.

(cherry picked from commit 6609658db0799053fbef0d7d0aa2f1fd68ef32d8)

ticket: 8075 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix kadm5/gssrpc XDR double free [CVE-2014-9421]
Greg Hudson [Sat, 27 Dec 2014 19:16:13 +0000 (14:16 -0500)] 
Fix kadm5/gssrpc XDR double free [CVE-2014-9421]

[MITKRB5-SA-2015-001] In auth_gssapi_unwrap_data(), do not free
partial deserialization results upon failure to deserialize.  This
responsibility belongs to the callers, svctcp_getargs() and
svcudp_getargs(); doing it in the unwrap function results in freeing
the results twice.

In xdr_krb5_tl_data() and xdr_krb5_principal(), null out the pointers
we are freeing, as other XDR functions such as xdr_bytes() and
xdr_string().

(cherry picked from commit a197e92349a4aa2141b5dff12e9dd44c2a2166e3)

ticket: 8074 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix gss_process_context_token() [CVE-2014-5352]
Tom Yu [Fri, 6 Feb 2015 20:46:52 +0000 (15:46 -0500)] 
Fix gss_process_context_token() [CVE-2014-5352]

[MITKRB5-SA-2015-001] The krb5 gss_process_context_token() should not
actually delete the context; that leaves the caller with a dangling
pointer and no way to know that it is invalid.  Instead, mark the
context as terminated, and check for terminated contexts in the GSS
functions which expect established contexts.  Also add checks in
export_sec_context and pseudo_random, and adjust t_prf.c for the
pseudo_random check.

(back ported from commit 82dc33da50338ac84c7b4102dc6513d897d0506a)

ticket: 8073 (new)
version_fixed: 1.11.6
status: resolved

10 years agoUpdate copyright years
Tom Yu [Fri, 6 Feb 2015 20:36:52 +0000 (15:36 -0500)] 
Update copyright years

10 years agoMake tcl_kadm5.c work with Tcl 8.6
Greg Hudson [Wed, 28 May 2014 22:06:59 +0000 (18:06 -0400)] 
Make tcl_kadm5.c work with Tcl 8.6

Directly accessing the result field of Tcl_Interp has been deprecated
for a long time, requires a special define in Tcl 8.6, and will be
impossible in Tcl 9.  Use Tcl_SetResult instead.  The new error
messages are less helpful than the old ones, but this is just support
infrastructure for old tests, so it isn't important.

(cherry picked from commit b63496d7b44f090ea5d300dc09b4fc043138ae38)

ticket: 8121 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix LDAP key data segmentation [CVE-2014-4345]
Tomas Kuthan [Fri, 1 Aug 2014 13:25:50 +0000 (15:25 +0200)] 
Fix LDAP key data segmentation [CVE-2014-4345]

For principal entries having keys with multiple kvnos (due to use of
-keepold), the LDAP KDB module makes an attempt to store all the keys
having the same kvno into a single krbPrincipalKey attribute value.
There is a fencepost error in the loop, causing currkvno to be set to
the just-processed value instead of the next kvno.  As a result, the
second and all following groups of multiple keys by kvno are each
stored in two krbPrincipalKey attribute values.  Fix the loop to use
the correct kvno value.

CVE-2014-4345:

In MIT krb5, when kadmind is configured to use LDAP for the KDC
database, an authenticated remote attacker can cause it to perform an
out-of-bounds write (buffer overrun) by performing multiple cpw
-keepold operations.  An off-by-one error while copying key
information to the new database entry results in keys sharing a common
kvno being written to different array buckets, in an array whose size
is determined by the number of kvnos present.  After sufficient
iterations, the extra writes extend past the end of the
(NULL-terminated) array.  The NULL terminator is always written after
the end of the loop, so no out-of-bounds data is read, it is only
written.

Historically, it has been possible to convert an out-of-bounds write
into remote code execution in some cases, though the necessary
exploits must be tailored to the individual application and are
usually quite complicated.  Depending on the allocated length of the
array, an out-of-bounds write may also cause a segmentation fault
and/or application crash.

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

[ghudson@mit.edu: clarified commit message]
[kaduk@mit.edu: CVE summary, CVSSv2 vector]

(cherry picked from commit 81c332e29f10887c6b9deb065f81ba259f4c7e03)

ticket: 8120 (new)
version_fixed: 1.11.6
status: resolved

10 years agoUse zapfree in krb5_decrypt_tkt_part
Andreas Schneider [Wed, 6 Aug 2014 14:06:54 +0000 (16:06 +0200)] 
Use zapfree in krb5_decrypt_tkt_part

(cherry picked from commit 18333f731b8cb3b4610b1d623caef9347c785f7b)

ticket: 8119 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix creation/rename of top-level profile sections
Greg Hudson [Wed, 16 Jul 2014 20:30:26 +0000 (16:30 -0400)] 
Fix creation/rename of top-level profile sections

profile_rename_section should demand only one name.

profile_add_relation should demand only one name if it is creating a
new section.  It aso needs to reset state before calling
profile_find_node for the section, in case it didn't look up any
parent sections previously.

(cherry picked from commit 590df2f41f84e0f9492e08f7dbd26fbcd3118ea0)

ticket: 8118 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix deleted node handling in libprofile
Greg Hudson [Wed, 16 Jul 2014 20:02:21 +0000 (16:02 -0400)] 
Fix deleted node handling in libprofile

In profile_find_node, skip deleted nodes when finding the second
match.  Otherwise, profile_clear_nodes could return an error if a node
has some values to clear but the last one is deleted.

In profile_node_iterator, skip deleted nodes when looking up the
section names.  Otherwise we could iterate over a deleted section
and/or ignore its replacement.

(cherry picked from commit e7f50a1c11845ba73ce4ffa4729d10113563a247)

ticket: 8117 (new)
version_fixed: 1.11.6
status: resolved

10 years agoUse system dictionary for db2 tests again
Greg Hudson [Tue, 18 Feb 2014 06:14:01 +0000 (01:14 -0500)] 
Use system dictionary for db2 tests again

The built-in word list is not long enough for all of the libdb2 tests
to run properly.  Revert d21a86e47a7cda29225013e08d060095b94b2ee7 and
go back to using the system dictionary if we find one.  However, omit
any lines from the chosen word list which contain non-alphabetical
characters.

(cherry picked from commit dba768e873d3ae34cfb2ff9d9c2d3644981f23a5)

ticket: 8116
version_fixed: 1.11.6
status: resolved

10 years agoUse TAILQ macros instead of CIRCLEQ in libdb2
Greg Hudson [Mon, 17 Feb 2014 05:18:41 +0000 (00:18 -0500)] 
Use TAILQ macros instead of CIRCLEQ in libdb2

The optimizer in gcc 4.8.1 (but not the current gcc head revision)
breaks the queue.h CIRCLEQ macros, apparently due to an overzealous
strict aliasing deduction.  Use TAILQ macros in the libdb2 mpool code
instead.

(cherry picked from commit 26d874412983c4c9979a9f5e7bec51834ad4cda5)

ticket: 8116 (new)
version_fixed: 1.11.6
status: resolved

10 years agoRemove indent workaround in man page RST sources
Greg Hudson [Thu, 12 Jun 2014 18:34:26 +0000 (14:34 -0400)] 
Remove indent workaround in man page RST sources

docutils 0.10 properly adds indentation to example blocks in man
pages, so we do not need to force an extra indentation level.  Get rid
of the workaround wherever we use it.

(back ported from 4bd50f73c80a86852ec0879abdf52202be40892b)
(back ported from commit 1ac533f132539513916aafccd0e159cb2687ad08)

ticket: 8115 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix null deref in SPNEGO acceptor [CVE-2014-4344]
Greg Hudson [Tue, 15 Jul 2014 16:56:01 +0000 (12:56 -0400)] 
Fix null deref in SPNEGO acceptor [CVE-2014-4344]

When processing a continuation token, acc_ctx_cont was dereferencing
the initial byte of the token without checking the length.  This could
result in a null dereference.

CVE-2014-4344:

In MIT krb5 1.5 and newer, an unauthenticated or partially
authenticated remote attacker can cause a NULL dereference and
application crash during a SPNEGO negotiation by sending an empty
token as the second or later context token from initiator to acceptor.
The attacker must provide at least one valid context token in the
security context negotiation before sending the empty token.  This can
be done by an unauthenticated attacker by forcing SPNEGO to
renegotiate the underlying mechanism, or by using IAKERB to wrap an
unauthenticated AS-REQ as the first token.

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

[kaduk@mit.edu: CVE summary, CVSSv2 vector]

(cherry picked from commit 524688ce87a15fc75f87efc8c039ba4c7d5c197b)

ticket: 8114 (new)
subject: NULL dereference in SPNEGO acceptor for continuation tokens [CVE-2014-4344]
version_fixed: 1.11.6
status: resolved

10 years agoFix double-free in SPNEGO [CVE-2014-4343]
David Woodhouse [Tue, 15 Jul 2014 16:54:15 +0000 (12:54 -0400)] 
Fix double-free in SPNEGO [CVE-2014-4343]

In commit cd7d6b08 ("Verify acceptor's mech in SPNEGO initiator") the
pointer sc->internal_mech became an alias into sc->mech_set->elements,
which should be considered constant for the duration of the SPNEGO
context.  So don't free it.

CVE-2014-4343:

In MIT krb5 releases 1.10 and newer, an unauthenticated remote
attacker with the ability to spoof packets appearing to be from a
GSSAPI acceptor can cause a double-free condition in GSSAPI initiators
(clients) which are using the SPNEGO mechanism, by returning a
different underlying mechanism than was proposed by the initiator.  At
this stage of the negotiation, the acceptor is unauthenticated, and
the acceptor's response could be spoofed by an attacker with the
ability to inject traffic to the initiator.

Historically, some double-free vulnerabilities can be translated into
remote code execution, though the necessary exploits must be tailored
to the individual application and are usually quite
complicated. Double-frees can also be exploited to cause an
application crash, for a denial of service.  However, most GSSAPI
client applications are not vulnerable, as the SPNEGO mechanism is not
used by default (when GSS_C_NO_OID is passed as the mech_type argument
to gss_init_sec_context()).  The most common use of SPNEGO is for
HTTP-Negotiate, used in web browsers and other web clients.  Most such
clients are believed to not offer HTTP-Negotiate by default, instead
requiring a whitelist of sites for which it may be used to be
configured.  If the whitelist is configured to only allow
HTTP-Negotiate over TLS connections ("https://"), a successful
attacker must also spoof the web server's SSL certificate, due to the
way the WWW-Authenticate header is sent in a 401 (Unauthorized)
response message.  Unfortunately, many instructions for enabling
HTTP-Negotiate in common web browsers do not include a TLS
requirement.

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

[kaduk@mit.edu: CVE summary and CVSSv2 vector]

(cherry picked from commit f18ddf5d82de0ab7591a36e465bc24225776940f)

ticket: 8113 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix calloc check in krb5_authdata_context_init
Greg Hudson [Fri, 18 Jul 2014 18:51:13 +0000 (14:51 -0400)] 
Fix calloc check in krb5_authdata_context_init

(cherry picked from commit 4abfd7bc3819a66f77a1cf121b7608af624ecb6e)

ticket: 8112 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix race in util/profile/Makefile.in
Greg Hudson [Thu, 17 Oct 2013 18:02:14 +0000 (14:02 -0400)] 
Fix race in util/profile/Makefile.in

$(BUILDTOP)/include/profile.h was being updated by two different
rules, which could collide with make -j.  Use a dependency from
includes instead of a redundant rule.

(cherry picked from commit 4d3827ac1b0e9e6447a132c57f3e2d74d3dfe8a9)

ticket: 8111 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix build on systems without RTM_OLD*
Ben Kaduk [Thu, 3 Jul 2014 14:42:21 +0000 (10:42 -0400)] 
Fix build on systems without RTM_OLD*

For example, FreeBSD has removed RTM_OLDADD and RTM_OLDDEL from its API
in March 2014, with the message:
Garbage collect long time obsoleted (or never used) stuff from routing API

Only attempt to define behavior for these cases if they are defined.

(cherry picked from commit fd352d41a79013114708e99510b6be3836200237)

ticket: 8110 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix KDC worker process argument parsing
Greg Hudson [Wed, 18 Jun 2014 16:58:39 +0000 (12:58 -0400)] 
Fix KDC worker process argument parsing

To create worker processes, the KDC shuts down realms, forks off the
worker processes, then reinitializes realms in each child.
Reinitializing realms requires making a second pass over the
command-line arguments.  To do this with getopt, optind must be
reinitialized to 1 for each pass; otherwise, no options will be seen
the second time around.

(cherry picked from commit 1776fd19120d230115527febbd22979eb64ee1ff)

ticket: 8109 (new)
version_fixed: 1.11.6
status: resolved

10 years agoHandle invalid RFC 1964 tokens [CVE-2014-4341...]
Greg Hudson [Thu, 19 Jun 2014 17:49:16 +0000 (13:49 -0400)] 
Handle invalid RFC 1964 tokens [CVE-2014-4341...]

Detect the following cases which would otherwise cause invalid memory
accesses and/or integer underflow:

* An RFC 1964 token being processed by an RFC 4121-only context
  [CVE-2014-4342]

* A header with fewer than 22 bytes after the token ID or an
  incomplete checksum [CVE-2014-4341 CVE-2014-4342]

* A ciphertext shorter than the confounder [CVE-2014-4341]

* A declared padding length longer than the plaintext [CVE-2014-4341]

If we detect a bad pad byte, continue on to compute the checksum to
avoid creating a padding oracle, but treat the checksum as invalid
even if it compares equal.

CVE-2014-4341:

In MIT krb5, an unauthenticated remote attacker with the ability to
inject packets into a legitimately established GSSAPI application
session can cause a program crash due to invalid memory references
when attempting to read beyond the end of a buffer.

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

CVE-2014-4342:

In MIT krb5 releases krb5-1.7 and later, an unauthenticated remote
attacker with the ability to inject packets into a legitimately
established GSSAPI application session can cause a program crash due
to invalid memory references when reading beyond the end of a buffer
or by causing a null pointer dereference.

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

[tlyu@mit.edu: CVE summaries, CVSS]

(cherry picked from commit fb99962cbd063ac04c9a9d2cc7c75eab73f3533d)

ticket: 8108 (new)
subject: Handle invalid RFC 1964 tokens [CVE-2014-4341 CVE-2014-4342]
version_fixed: 1.11.6
status: resolved

10 years agoFix unlikely null dereference in mk_cred()
Nalin Dahyabhai [Wed, 25 Jun 2014 16:56:42 +0000 (12:56 -0400)] 
Fix unlikely null dereference in mk_cred()

If krb5_encrypt_keyhelper() returns an error, the ciphertext structure
may contain a non-zero length, but it will already have freed the
pointer to its data, making encrypt_credencpart()'s subsequent attempt
to clear and free the memory fail.  Remove that logic.

Based on a patch from Jatin Nansi.

(cherry picked from commit 476284de8dc9a52b5544445cb1b316a417ae88f0)

ticket: 8107 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix error checking in PKINIT authdata creation
Greg Hudson [Sat, 14 Jun 2014 15:23:08 +0000 (11:23 -0400)] 
Fix error checking in PKINIT authdata creation

In create_identifiers_from_stack: check for allocation errors from
PKCS7_ISSUER_AND_SERIAL_new and M_ASN1_INTEGER_dup.  Use
PKCS7_ISSUER_AND_SERIAL_free to more concisely clean up the OpenSSL
issuer variable, and make sure that any partially processed value is
cleaned up on error.  Use calloc to allocate krb5_cas so that all of
its pointers are initially nulled, so that
free_krb5_external_principal_identifier can operate on it safely in
case of error.  Eliminate the retval variable as it was not used
safely.  Rename the error label from "cleanup" to "oom" and separate
it from the successful return path (which has nothing to clean up).

(back ported from commit 09246e64e20f079bef6163e9e1d0ecda7917b8c2)
(cherry picked from commit 62c9e504261a07b8da297854c9fc9549acecc7d3)

ticket: 8106 (new)
version_fixed: 1.11.6
status: resolved

10 years agoImprove PKINIT certificate documentation
Greg Hudson [Fri, 6 Jun 2014 21:41:51 +0000 (17:41 -0400)] 
Improve PKINIT certificate documentation

Describe how to use a commercially-issued server certificate for
anonymous PKINIT.  Separate the KDC and client configuration
instructions so that the steps necessary for anonymous PKINIT are not
combined with the additional steps necessary for regular PKINIT.
Describe kpServerAuth as the EKU used in commercially issued server
certificates, not as the value used by Microsoft (which does not
appear to be true according to [MS-PKCA]).

(cherry picked from commit 677c7753923e5efa078074611d4474fbcc10f6a1)

ticket: 8105 (new)
version_fixed: 1.11.6
status: resolved

10 years agoDo not document pkinit_win2k
Greg Hudson [Fri, 6 Jun 2014 21:57:40 +0000 (17:57 -0400)] 
Do not document pkinit_win2k

This variable was never used in the PKINIT code as it was contributed;
there was only code to read its value.

(cherry picked from commit e161636590429aa78a3f04a8bbe0a36dda48a8ab)

ticket: 8104 (new)
version_fixed: 1.11.6
status: resolved

10 years agoAdd missing profile functions to libkrb5 exports
Greg Hudson [Wed, 4 Jun 2014 20:18:21 +0000 (16:18 -0400)] 
Add missing profile functions to libkrb5 exports

profile_flush_to_buffer, profile_flush_to_file, profile_free_buffer,
profile_init_flags, and profile_init_vtable are all public profile
functions, but are inaccessible to libkrb5 applications on some
platforms because they were never added to the export list.  Add them
now.

(libprofile functions have never been part of the Windows DLL export
list, so do not change krb5_32.def at this time.)

(cherry picked from commit dc1a76ccc5d3a6972d0f21d38389ff39e54f283a)

ticket: 8103 (new)
version_fixed: 1.11.6
status: resolved

10 years agoTreat LDAP KrbKey salt field as optional
Greg Hudson [Fri, 23 May 2014 23:58:41 +0000 (19:58 -0400)] 
Treat LDAP KrbKey salt field as optional

Per the ASN.1 definition, the KrbKey salt field is optional.  Since
1.7, we have been treating it as mandatory in the encoder; since 1.11,
we have been treating it as mandatory in the decoder.  Mostly by luck,
we have been encoding a salt type of 0 when key_data_ver is 1, but we
really should not be looking at key_data_type[1] or key_data_length[1]
in this situation.  Treat the salt field as optional in the encoder
and decoder.  Although the previous commit ensures that we continue to
always encode a salt (without any dangerous assumptions about
krb5_key_data constructors), this change will allow us to decode key
data encoded by 1.6 without salt fields.

This also fixes issue #7918, by properly setting key_data_ver to 2 if
a salt type but no salt value is present.  It is difficult to get the
decoder to actually assign 2 to key_data_ver just because the salt
field is there, so take care of that in asn1_decode_sequence_of_keys.

Adjust kdbtest.c to match the new behavior by setting key_data_ver to
2 in both test keys.

(back ported from commit fb5cd8df0dbd04dac4f610e68cba5b80a3cb8d48)

ticket: 8102
version_fixed: 1.11.6
status: resolved

10 years agoAlways include salt in LDAP KrbKey encoding
Greg Hudson [Sun, 25 May 2014 02:58:26 +0000 (22:58 -0400)] 
Always include salt in LDAP KrbKey encoding

In the LDAP KDB module, ensure that every krb5_key_data we pass to
asn1_encode_sequence_of_keys includes a salt type, for compatibility
with the decoder in unpatched krb5 1.11 and 1.12.

This is not a behavior change by itself; since 1.7 the encoder has
always included a KrbKey salt field because it erroneously treats that
field as non-optional.  (Luckily, the encoded salt always happens to
have salt type 0 because krb5_key_data constructors start with zeroed
memory.)  The next commit will fix the encoder and decoder to properly
treat the KrbKey salt field as optional, so we need this change to
ensure that our encodings remain compatible.

Also fix the ASN.1 tests to set key_data_ver correctly for the sample
test key data.

(cherry picked from commit 1825455ede7e61ab934b16262fb5b12b78a52f1a)

ticket: 8102 (new)
version_fixed: 1.11.6
status: resolved

10 years agoDo not document pkinit_mapping_file
Greg Hudson [Sun, 1 Jun 2014 14:41:27 +0000 (10:41 -0400)] 
Do not document pkinit_mapping_file

This feature was never implemented in the PKINIT code as it was
contributed; there was only stub support for reading the filename.

(cherry picked from commit 8da21b0ec18cf9306a8c1b3410d5c6ab36acdd21)

ticket: 8101 (new)
version_fixed: 1.11.6
status: resolved

10 years agoDon't blindly use PKCS11 slot IDs in PKINIT
Greg Hudson [Thu, 22 May 2014 23:18:34 +0000 (19:18 -0400)] 
Don't blindly use PKCS11 slot IDs in PKINIT

Passing invalid slot IDs to C_OpenSession can cause some PKCS #11
implementations (such as the Solaris one) to crash.  If a PKINIT
identity specifies a slotid, use it to filter the result of
C_GetSlotList, but don't try it if it does not appear in the list.

(cherry picked from commit ac406bac3d73a7e4efcc74adbb90c722457da969)

ticket: 8100 (new)
version_fixed: 1.11.6
status: resolved

10 years agoAdd tests for krb5int_c_combine_keys
Greg Hudson [Tue, 20 May 2014 18:52:44 +0000 (14:52 -0400)] 
Add tests for krb5int_c_combine_keys

krb5int_c_combine_keys is used only by SAM-2 preauth with neither the
send-encrypted-sad nor use-sad-as-key flags, so it isn't covered by
any automated function tests.  Add some unit tests to make sure that
it works and returns the expected results for two randomly generated
test vectors.

(back ported from commit 6e8b2fba84df2ef74ce071330b4c3f843f4b7541)

ticket: 8099 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix krb5int_c_combine_keys
Ken Hornstein [Tue, 20 May 2014 18:50:22 +0000 (14:50 -0400)] 
Fix krb5int_c_combine_keys

When krb5int_c_combine_keys was updated to use the new crypto
interface, a small bug was introduced.  It turns out the temporary
keyblock created needs to have its enctype set; otherwise, when
krb5int_derive_keyblock() is called later, it will fail with
KRB5_BAD_ENCTYPE.

(cherry picked from commit 89803a5a781107365d5a4534eebf48dbaf010f96)

ticket: 8098 (new)
version_fixed: 1.11.6
status: resolved

10 years agoCheck for asprintf failure in kdb5_util create
Tomas Kuthan [Thu, 10 Apr 2014 13:16:06 +0000 (15:16 +0200)] 
Check for asprintf failure in kdb5_util create

In add_admin_princ, remove build_name_with_realm and call asprintf
directly instead.  Check for asprintf failure to avoid passing an
undefined pointer to krb5_parse_name.

[ghudson@mit.edu: rewrite commit message]

(cherry picked from commit f5645d30cf83398640c386a612eb6f07c543286f)

ticket: 8097 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix leak in kadm5_flush with LDAP KDB
Tomas Kuthan [Wed, 2 Apr 2014 15:48:04 +0000 (17:48 +0200)] 
Fix leak in kadm5_flush with LDAP KDB

Due to an inverted test in adb_policy_init, kadm5_flush calls
krb5_db_open twice.  With the DB2 KDB module, the second open is a
no-op, but with the LDAP module, a new DB handle is allocated and the
old one is leaked.

[ghudson@mit.edu: rewrote commit message]

(cherry picked from commit 372e4cb6f5d4a603e6e3157c7b5d354953836136)

ticket: 8096 (new)
version_fixed: 1.11.6
status: resolved

10 years agoGet getopt from unistd.h (not getopt.h) in tests
Greg Hudson [Fri, 28 Mar 2014 16:33:43 +0000 (12:33 -0400)] 
Get getopt from unistd.h (not getopt.h) in tests

POSIX defines getopt to be declared in unistd.h, and HP-UX (as of
version 11.31) does not appear to have getopt.h.  In test programs
which currently include getopt.h and aren't currently built on
Windows, include unistd.h or just assume we will get it via k5-int.h.

(back ported from commit 613c62d689c31a325d51be88657dedd17af3cf81)

ticket: 8095 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix GSS krb5 initial sequence number gap handling
Tomas Kuthan [Thu, 6 Mar 2014 12:05:24 +0000 (13:05 +0100)] 
Fix GSS krb5 initial sequence number gap handling

Since #2040, the dummy queue element inserted by g_order_init no
longer compares less than the initial sequence number, so we fail when
the first few sequence numbers are received out of order.  Properly
detect when a sequence number fits between the dummy element and the
first real queue element.

[ghudson@mit.edu: rewrote commit message]

(cherry picked from commit 13a9cb721194c8aa4ccf6ed6ef23e3ac8dd24037)

ticket: 8094 (new)
version_fixed: 1.11.6
status: resolved

10 years agoUpdate example kadmin getprinc enctype display
Greg Hudson [Wed, 26 Mar 2014 19:57:08 +0000 (15:57 -0400)] 
Update example kadmin getprinc enctype display

In kadmin_local.rst, update the example to reflect the new way we
display enctypes after #5014.

(cherry picked from commit 3890d1dff87a839efec38a77dcc88574ed65f4a9)

ticket: 8093 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix returning KDB_NOENTRY in find_alternate_tgs()
Nalin Dahyabhai [Thu, 20 Feb 2014 21:01:49 +0000 (16:01 -0500)] 
Fix returning KDB_NOENTRY in find_alternate_tgs()

After searching for a cross-realm TGS entry to provide to a client as a
referral, if we're all set to return a success code but aren't actually
returning an entry, we should be returning an error.  We might not do so
because we don't compare the right value against NULL.

This corrects an error in a redundant check in the patch for
CVE-2013-1417.  The error in the check cannot occur in practice
because the other part of the patch for CVE-2013-1417 prevents it, but
static analyzers can flag the erroneous check.

[tlyu@mit.edu: edit commit message]

(cherry picked from commit 90cbf4eb60d8ec3c083195ba4a050a31ea36be0b)

ticket: 8092 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix unlikely double free in PKINIT client code
Greg Hudson [Thu, 13 Mar 2014 22:34:22 +0000 (18:34 -0400)] 
Fix unlikely double free in PKINIT client code

In pa_pkinit_gen_req, if the cleanup handler is reached with non-zero
retval and non-null out_data, out_data is freed, then dereferenced,
then freed again.  This can only happen if one of the small fixed-size
malloc requests fails after pkinit_as_req_create succeeds, so it is
unlikely to occur in practice.

(cherry picked from commit cc002d6c1ccfc08356d01ba83e72a46855d0302c)

ticket: 8091 (new)
version_fixed: 1.11.6
status: resolved

10 years agoMention k5login_authoritative in k5login docs
Ben Kaduk [Thu, 13 Mar 2014 19:11:49 +0000 (15:11 -0400)] 
Mention k5login_authoritative in k5login docs

In particular, it is set by default.  This can lead to confusing
behavior wherein adding a k5login file removes a user's remote
access.

Make an example more concrete to account for this case.

(cherry picked from commit 8cdc21ef051f43ea8dcabf42540d5cff13b5adeb)

ticket: 8090 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix memory leak in krb5_verify_init_creds
Nalin Dahyabhai [Mon, 17 Feb 2014 22:14:20 +0000 (17:14 -0500)] 
Fix memory leak in krb5_verify_init_creds

When copying most of the credentials from one cache to another in
copy_creds_except (called from get_vfy_cred, from
krb5_verify_init_creds), we need to free all of the credentials that
we read, not just the ones we copied.

[ghudson@mit.edu: edited commit message]

(cherry picked from commit 27b136d2e3181e787b2d4a03ee712d5d5137f5cd)

ticket: 8089 (new)
version_fixed: 1.11.6
status: resolved

10 years agoInitialize err variable in krb5_sendto_kdc
Nalin Dahyabhai [Tue, 11 Mar 2014 17:26:32 +0000 (13:26 -0400)] 
Initialize err variable in krb5_sendto_kdc

When we get an KRB5_KDC_UNREACH error back from k5_sendto, we check if
the err variable we passed for use by our message handler has been set
to KDC_ERR_SVC_UNAVAILABLE.  If k5_sendto doesn't receive any
response, though, the handler isn't called, so we're reading an
uninitialized variable.  Initialize it to a value other than
KDC_ERR_SVC_UNAVAILABLE to be sure.

[ghudson@mit.edu: initialize err just before calling k5_sendto; edit
commit message]

(cherry picked from commit 1ed3f68c2394fbb48731bba4e4e9a60c8b925ca5)

ticket: 8088 (new)
version_fixed: 1.11.6
status: resolved

10 years agoUpdate iprop_master_ulogsize documentation
Greg Hudson [Fri, 7 Mar 2014 15:37:48 +0000 (10:37 -0500)] 
Update iprop_master_ulogsize documentation

When we removed the maximum number of ulog entries (#7368), we did not
update the documentation for that parameter in kdc.conf.  Reported by
Richard Basch.

(cherry picked from commit 5fa7e666bd81a2222b155bdf3f0c3fc1bc3fabf5)

ticket: 8087 (new)
version_fixed: 1.11.6
status: resolved

10 years agoCheck for malloc failure in process_chpw_request
Greg Hudson [Sun, 2 Mar 2014 23:12:54 +0000 (18:12 -0500)] 
Check for malloc failure in process_chpw_request

(cherry picked from commit 4356deefa2d2fe0bc7b52f3b62a387c7ec1eb369)

ticket: 8086 (new)
version_fixed: 1.11.6
status: resolved

10 years agoCorrect docs for "kdb5_util load" switches
Jeff D'Angelo [Fri, 28 Feb 2014 14:47:30 +0000 (09:47 -0500)] 
Correct docs for "kdb5_util load" switches

Remove obsolete parenthetical statement in the description of the
"-update" switch to "kdb5_util load".  Using the "-update" flag to
load a second dump made using the "-ov" switch is no longer necessary
now that the "-r13" format is the default.  Add statement that the
"-b7" dump format was the default for versions prior to 1.2.2 (to
match the statement from "dump" section).

[tlyu@mit.edu: commit message]

(cherry picked from commit 2d0f2fa48df1ea81363de5c78ab7e8cf1ab6d214)

ticket: 8085 (new)
version_fixed: 1.11.6
status: resolved

10 years agoAvoid duplicate "/etc/krb5.conf" in profile path
Tom Yu [Tue, 25 Feb 2014 22:35:35 +0000 (17:35 -0500)] 
Avoid duplicate "/etc/krb5.conf" in profile path

If configure gets run with --sysconfdir=/etc, "/etc/krb5.conf" shows
up twice in the profile path, which causes its contents to be read
twice.  This can cause some confusing and possibly problematic
behavior.

Add some logic to configure.in to avoid adding the duplicate entry for
"/etc/krb5.conf".

Reported independently by Denis Vlasenko and Fredrik Tolf.

(back ported from commit 8df1965d1ccdbcb8d74a3e68ad35d7579db9ac44)
(cherry picked from commit 51ef4b50e46d21374319b7070ad63ba7bb672ee2)

ticket: 8084 (new)
version_fixed: 1.11.6
status: resolved

10 years agoSupport referrals from Windows Server 2003
Nate Rosenblum [Mon, 23 Dec 2013 21:21:44 +0000 (13:21 -0800)] 
Support referrals from Windows Server 2003

Although RFC 6806 Section 7 requires servers to indicate a client
referral in a WRONG_REALM message, Microsoft Windows Server 2003
returns this information in a message with error code
PRINCIPAL_UNKNOWN.  Failure to follow the referral in these messages
prevents referral chasing in Windows Server 2003 forests.  Detect
referral messages of this type by checking for a non-empty
client.realm field in the response, and activate the referral logic in
these cases.

[tlyu@mit.edu: style, comments, and commit message]

(back ported from 3093b92734adfe2deb9ad6bad5a221acc967fd8b)

ticket: 8083 (new)
version_fixed: 1.11.6
status: resolved

10 years agoUpdate doc build instructions
Tom Yu [Fri, 14 Feb 2014 20:59:51 +0000 (15:59 -0500)] 
Update doc build instructions

Documentation build instructions in doc/README were out of date.
Update them.

(cherry picked from commit bfc8f194ae431fc4fadaa431a2a636b4e9b025dd)

ticket: 8082 (new)
version_fixed: 1.11.6
status: resolved

10 years agoProperly reflect MS krb5 mech in SPNEGO acceptor
Greg Hudson [Tue, 4 Feb 2014 02:11:34 +0000 (21:11 -0500)] 
Properly reflect MS krb5 mech in SPNEGO acceptor

r25590 changed negotiate_mech() to return an alias into the acceptor's
mech set, with the unfortunate side effect of transforming the
erroneous Microsoft krb5 mech OID into the correct krb5 mech OID,
meaning that we answer with a different OID than the requested one.
Return an alias into the initiator's mech set instead, and store that
in mech_set field the SPNEGO context.  The acceptor code only uses
mech_set to hold the allocated storage pointed into by internal_mech,
so this change is safe.

(cherry picked from commit 8255613476d4c1583a5e810b50444f188fde871f)

ticket: 8081 (new)
version_fixed: 1.11.6
status: resolved

10 years agoFix kpropd -x
Greg Hudson [Sun, 26 Jan 2014 23:38:11 +0000 (18:38 -0500)] 
Fix kpropd -x

A missing break in the switch statement caused kpropd -x to error out
with a usage message.

(cherry picked from commit 75b2ec88c4d75e7215322d2f0019307310cc9701)

ticket: 8080 (new)
version_fixed: 1.11.6
status: resolved

10 years agoAllow empty store in gss_acquire_cred_from
Greg Hudson [Thu, 16 Jan 2014 16:49:04 +0000 (11:49 -0500)] 
Allow empty store in gss_acquire_cred_from

There is no reason to deny a zero-length cred store, so don't check
for it in val_acq_cred_args or val_add_cred_args.

(cherry picked from commit 970304b558a360e08d8421ef92245d2df0ac5e49)

ticket: 8079 (new)
version_fixed: 1.11.6
status: resolved

10 years agoAvoid assertion failure in error_message
Greg Hudson [Thu, 16 Jan 2014 16:32:10 +0000 (11:32 -0500)] 
Avoid assertion failure in error_message

r17942 added a call to get_thread_buffer in the first part of
error_message, prior to the call to com_err_initialize.  This can
cause an assertion failure from k5_getspecific if error_message is
called on a system error before any other com_err functions are
called.  Move the initialization call earlier to prevent this.

(back ported from 6bdaa746fec1cf29adcbe5b8e65c4b8993770b84)

ticket: 8078 (new)
version_fixed: 1.11.6
status: resolved

10 years agoClean up rcache if GSS krb5 acquire_cred fails
Greg Hudson [Wed, 15 Jan 2014 19:41:54 +0000 (14:41 -0500)] 
Clean up rcache if GSS krb5 acquire_cred fails

The error handler in acquire_cred_context didn't release the rcache,
which would cause it to leak if we failed after acquire_accept_cred.

(cherry picked from commit 9df0c4bdce6b88a01af51e4bbb9a365db00256d5)

ticket: 8077 (new)
version_fixed: 1.11.6
status: resolved

11 years agoFix memory leak in patch for #7831
Tom Yu [Fri, 21 Feb 2014 20:04:10 +0000 (15:04 -0500)] 
Fix memory leak in patch for #7831

The patch for #7831 included a change to do_as_req.c that was only
needed in krb5-1.12; applying it to krb5-1.11 duplicated a block of
code and led to a memory leak.

ticket: 7867 (new)
version_fixed: 1.11.6
status: resolved

11 years agoUpdate for krb5-1.11.5-postrelease
Tom Yu [Tue, 21 Jan 2014 22:49:26 +0000 (17:49 -0500)] 
Update for krb5-1.11.5-postrelease

11 years agoUpdates for krb5-1.11.5 krb5-1.11.5-final
Tom Yu [Tue, 21 Jan 2014 21:28:45 +0000 (16:28 -0500)] 
Updates for krb5-1.11.5

11 years agoUpdate copyright years and acknowledgments
Tom Yu [Thu, 16 Jan 2014 21:41:53 +0000 (16:41 -0500)] 
Update copyright years and acknowledgments

11 years agomake update-po
Tom Yu [Thu, 16 Jan 2014 20:53:51 +0000 (15:53 -0500)] 
make update-po

11 years agoUpdate manpages
Tom Yu [Thu, 16 Jan 2014 20:53:26 +0000 (15:53 -0500)] 
Update manpages

11 years agomake depend
Tom Yu [Thu, 16 Jan 2014 20:52:33 +0000 (15:52 -0500)] 
make depend

11 years agoSort file list for msgfmt
Tom Yu [Wed, 15 Jan 2014 23:40:57 +0000 (18:40 -0500)] 
Sort file list for msgfmt

The list of input files for msgfmt was unsorted find output, resulting
in excessively large changes when running "make update-po".

(cherry picked from commit f131c5a4e266d07753a1f219d35c1bf82d98c0fb)

ticket: 7835 (new)
version_fixed: 1.11.5
status: resolved

11 years agoRemove mentions of krb5-send-pr
Tom Yu [Tue, 14 Jan 2014 20:43:35 +0000 (15:43 -0500)] 
Remove mentions of krb5-send-pr

Start the process of deprecating krb5-send-pr.  In practice, it causes
frustration for some users, and free-form email is good enough for
most bug reports.

Continue to install krb5-send-pr for now, but plan to remove it from
the tree in the future, probably replaced by a script that instructs
the user to send email manually.

(cherry picked from commit e972ce069dd45aad74e4f4853570ab27cfea05c2)

ticket: 7834 (new)
version_fixed: 1.11.5
status: resolved

11 years agoFix typo in sphinx manpage output
Tom Yu [Tue, 14 Jan 2014 21:13:44 +0000 (16:13 -0500)] 
Fix typo in sphinx manpage output

Some versions of the sphinx manpage writer have a typo in the name
'reStructuredText' written into the comments.  Add a sed command to
fix this.

(cherry picked from commit 4d30cc5d0838f6b5b3873046b0dfe72df2bdad11)

ticket: 7833 (new)
version_fixed: 1.11.5
status: resolved

11 years agoTest bogus KDC-REQs
Tom Yu [Thu, 16 Jan 2014 20:18:46 +0000 (15:18 -0500)] 
Test bogus KDC-REQs

Send encodings that are invalid KDC-REQs, but pass krb5_is_as_req()
and krb5_is_tgs_req(), to make sure that the KDC recovers correctly
from failures in decode_krb5_as_req() and decode_krb5_tgs_req().  Also
send an encoding that isn't a valid KDC-REQ.

(back ported from commit dae7693f8bf970d89d4c697f3d66a7d458281b93)

ticket: 7832 (new)
version_fixed: 1.11.5
status: resolved

11 years agoFix possible null deref in previous
Tom Yu [Wed, 1 Jan 2014 00:41:12 +0000 (19:41 -0500)] 
Fix possible null deref in previous

My rework of the do_tgs_req.c patch introduced a null deref if
decode_krb5_tgs_req() failed.

(cherry picked from commit 30589b2a1636de9f9b68591f0e546cb0fa21989f)

ticket: 7831
version_fixed: 1.11.5
status: resolved

11 years agoLog service princ in KDC more reliably
rbasch [Mon, 16 Dec 2013 15:54:41 +0000 (10:54 -0500)] 
Log service princ in KDC more reliably

Under some error conditions, the KDC would log "<unknown server>" for
the service principal because service principal information is not yet
available to the logging functions.  Set the appropriate variables
earlier.

do_as_req.c: After unparsing the client, immediately unparse the
server before searching for the client principal in the KDB.

do_tgs_req.c: Save a pointer to the client-requested service
principal, to make sure it gets logged if an error happens before
search_sprinc() successfully completes.

[tlyu@mit.edu: commit message; fix TGS to catch more error cases]

ticket: 7831 (new)

11 years agoFix typo that broke 'make clean'
Tom Yu [Thu, 16 Jan 2014 20:05:23 +0000 (15:05 -0500)] 
Fix typo that broke 'make clean'

Missing $

(cherry picked from commit 28633f186a943721b6948875ca85a4a34bc87da4)

ticket: 7826
version_fixed: 1.11.5
status: resolved

11 years agoAdd a test program for krb5_copy_context
Tom Yu [Thu, 16 Jan 2014 19:39:53 +0000 (14:39 -0500)] 
Add a test program for krb5_copy_context

This test program isn't completely proof against the kind of mistakes
we've made with krb5_copy_context in the past, but it at least
exercises krb5_copy_context and can detect some kinds of bugs.

(back ported from commit b78c3c8c5025aec870d20472f80d4a652062f921)

ticket: 7826

11 years agoFix krb5_copy_context
Tom Yu [Thu, 16 Jan 2014 19:34:54 +0000 (14:34 -0500)] 
Fix krb5_copy_context

krb5_copy_context has been broken since 1.8 (it broke in r22456)
because k5_copy_etypes crashes on null enctype lists.  Subsequent
additions to the context structure were not reflected in
krb5_copy_context, creating double-free bugs.  Make k5_copy_etypes
handle null input and account for all new fields in krb5_copy_context.
Reported by Arran Cudbard-Bell.

(back ported from commit c452644d91d57d8b05ef396a029e34d0c7a48920)

ticket: 7826 (new)

11 years agoClarify klist -s documentation
Greg Hudson [Tue, 17 Dec 2013 21:56:41 +0000 (16:56 -0500)] 
Clarify klist -s documentation

The documentation for klist -s erroneously suggests that it doesn't
affect the exit status behavior and that it merely checks for the
existence of the ccache (only mentioning the expired ticket check at
the end).  Make it clearer and simpler, but avoid going into a lot of
detail about the nature of the expiration check.

(cherry picked from commit bf1d3c7b0b060be4b3e9e793b633c07e489ac76f)

ticket: 7830 (new)
version_fixed: 1.11.5
status: resolved

11 years agoFix GSS krb5 acceptor acquire_cred error handling
Greg Hudson [Mon, 16 Dec 2013 20:37:56 +0000 (15:37 -0500)] 
Fix GSS krb5 acceptor acquire_cred error handling

When acquiring acceptor creds with a specified name, if we fail to
open a replay cache, we leak the keytab handle.  If there is no
specified name and we discover that there is no content in the keytab,
we leak the keytab handle and return the wrong major code.  Memory
leak reported by Andrea Campi.

(cherry picked from commit decccbcb5075f8fbc28a535a9b337afc84a15dee)

ticket: 7829 (new)
version_fixed: 1.11.5
status: resolved

11 years agoFix memory leak in SPNEGO initiator
Simo Sorce [Fri, 13 Dec 2013 17:00:41 +0000 (12:00 -0500)] 
Fix memory leak in SPNEGO initiator

If we eliminate a mechanism from the initiator list because
gss_init_sec_context fails, free the memory for that mech OID before
removing it from the list.

[ghudson@mit.edu: clarified commit message]

(cherry picked from commit 1cda48a7ed4069cfc052f974ec3d76a9137c8c5a)

ticket: 7828 (new)
version_fixed: 1.11.5
status: resolved

11 years agoFix SPNEGO one-hop interop against old IIS
Greg Hudson [Tue, 10 Dec 2013 17:04:18 +0000 (12:04 -0500)] 
Fix SPNEGO one-hop interop against old IIS

IIS 6.0 and similar return a zero length reponse buffer in the last
SPNEGO packet when context initiation is performed without mutual
authentication.  In this case the underlying Kerberos mechanism has
already completed successfully on the first invocation, and SPNEGO
does not expect a mech response token in the answer.  If we get an
empty mech response token when the mech is complete during
negotiation, ignore it.

[ghudson@mit.edu: small code style and commit message changes]

(cherry picked from commit 37af638b742dbd642eb70092e4f7781c3f69d86d)

ticket: 7827 (new)
version_fixed: 1.11.5
status: resolved

11 years agoAvoid malloc(0) in SPNEGO get_input_token
Greg Hudson [Fri, 6 Dec 2013 23:56:56 +0000 (18:56 -0500)] 
Avoid malloc(0) in SPNEGO get_input_token

If we read a zero-length token in spnego_mech.c's get_input_token(),
set the value pointer to NULL instead of calling malloc(0).

(cherry picked from commit 13fd26e1863c79f616653f6a10a58c01f65fceff)

ticket: 7825 (new)
version_fixed: 1.11.5
status: resolved

11 years agoFix S4U2Self against non-FAST KDCs
Greg Hudson [Fri, 6 Dec 2013 01:32:05 +0000 (20:32 -0500)] 
Fix S4U2Self against non-FAST KDCs

When we added FAST TGS support in 1.11, we broke S4U2Self against KDCs
which don't support FAST, because the S4U2Self padata is only present
within the FAST request.  For now, duplicate that padata in the outer
request so that both FAST and non-FAST KDCs can see it.

(cherry picked from commit 55c3a5f69919c2b5435bac0cb48ab09b11be869c)

ticket: 7824 (new)
version_fixed: 1.11.5
status: resolved

11 years agoTest SPNEGO error message in t_s4u.py
Tom Yu [Thu, 16 Jan 2014 19:31:55 +0000 (14:31 -0500)] 
Test SPNEGO error message in t_s4u.py

Now that #7045 is fixed, we can check for the correct error message
from t_s4u2proxy_krb5 with --spnego.

(back ported from commit 4faca53e3a8ee213d43da8998f6889e7bfd36248)

ticket: 7823
version_fixed: 1.11.5
status: resolved

11 years agoLet SPNEGO display mechanism errors
Simo Sorce [Tue, 17 Dec 2013 21:15:14 +0000 (16:15 -0500)] 
Let SPNEGO display mechanism errors

To avoid potential recursion we use a thread local variable that tells
us whether the ancestor was called via spnego_gss_display_name().  If
we detect recursion, we assume that we returned a com_err code like
ENOMEM and call error_message(); in the worst case that will result in
an "Unknown error" message.

[ghudson@mit.edu: Edited comments and commit message; removed an
unneeded line of code.]

(cherry picked from commit d160bc733a3dbeb6d84f4e175234ff18738d9f66)

ticket: 7823 (new)

11 years agoBetter keysalt docs
Tom Yu [Mon, 9 Dec 2013 20:48:02 +0000 (15:48 -0500)] 
Better keysalt docs

Add a new section to kdc_conf.rst to describe keysalt lists, and
update other documentation to better distinguish enctype lists from
keysalt lists.

(cherry picked from commit 23a75649277afc24a9dfea199689e18129fa390c)

ticket: 7799 (new)
version_fixed: 1.11.5
status: resolved

11 years agoFix error message quotations in install_kdc.rst
Tom Yu [Tue, 3 Dec 2013 19:47:51 +0000 (14:47 -0500)] 
Fix error message quotations in install_kdc.rst

Some error messages that kprop could print were quoted incorrectly in
install_kdc.rst.

Also fix minor typos.

(cherry picked from commit 68d7fcf11553c29a2e0c28a57896fbce4a3ef611)

ticket: 7798 (new)
version_fixed: 1.11.5
status: resolved

11 years agoUpdate doc for current kdb5_util dump version
Tom Yu [Fri, 22 Nov 2013 23:23:52 +0000 (18:23 -0500)] 
Update doc for current kdb5_util dump version

kdb5_util.rst incorrectly describes the current default dump format
version as 6 when it should be 7.  Reported by Jeff D'Angelo.

(cherry picked from commit f0d7309a20665ac16a22856e0c8cffdb156f2d24)

ticket: 7783 (new)
version_fixed: 1.11.5
status: resolved

11 years agoEdit ccache_def.rst
Greg Hudson [Fri, 22 Nov 2013 21:53:35 +0000 (16:53 -0500)] 
Edit ccache_def.rst

Re-fill to 70 columns.  Replace non-ascii apostrophes with ASCII ones.
Edit wording slightly.

(cherry picked from commit 482869d393807d02668cf49ce74666d682cf77a6)

ticket: 7782
version_fixed: 1.11.5
status: resolved

11 years agoAdded a new ccache doc to "Kerberos V5 concepts"
Zhanna Tsitkov [Fri, 22 Nov 2013 19:02:57 +0000 (14:02 -0500)] 
Added a new ccache doc to "Kerberos V5 concepts"

This is to add a short introductory document on credential
caches to the Concepts section of Kerberos documentation.

(cherry picked from commit 251f94621328277044e3ae1a10ecd3ddfdda1dbb)

ticket: 7782 (new)

11 years agoImprove default ccache name API documentation
Tom Yu [Tue, 26 Nov 2013 22:57:51 +0000 (17:57 -0500)] 
Improve default ccache name API documentation

Document the lifetime and caching behavior of the
krb5_cc_default_name() return value.  Document that
krb5_cc_set_default_name() may be called with NULL to purge the cached
value.  Correct a typo in the krb5_cc_default() summary and explicitly
reference krb5_cc_default_name().

(back ported from commit 3e5fe754b9f9742d1c9b1564633d4172277166db)

ticket: 7781 (new)
version_fixed: 1.11.5
status: resolved

11 years agoCorrect kadm5.acl back-reference documentation
Greg Hudson [Thu, 21 Nov 2013 21:22:48 +0000 (16:22 -0500)] 
Correct kadm5.acl back-reference documentation

In kadm5.acl, *N in the target principal name refers to the Nth
wildcard in the acting principal pattern, not the Nth component.

(cherry picked from commit 39bac22ed7f5ff583e92d082b34f0c5a2a3cad4c)

ticket: 7780 (new)
version_fixed: 1.11.5
status: resolved