]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
10 years agoDo not link atl.lib into leash
Benjamin Kaduk [Wed, 22 Jan 2014 05:30:21 +0000 (00:30 -0500)] 
Do not link atl.lib into leash

We do not consume anything from the Active Template Library, and
the atl.lib form of it has been removed from Visual Studio 2013.

(cherry picked from commit 8cbe19a290f00de53da284588adc84aabf64092e)

ticket: 8190
version_fixed: 1.13.3
status: resolved

10 years agoXML Ribbon markup file
Benjamin Kaduk [Fri, 17 Jan 2014 21:02:13 +0000 (16:02 -0500)] 
XML Ribbon markup file

The standard windows library ribbon interface is either constructed
at runtime or specified in an XML file.  Since we have a static
set of functionality in our ribbon, it is simplest to just use the
XML file.

This should duplicate the interfaces currently provided by the
MFC ribbon, though the menu items in the file menu are slightly
taller than they used to be.

Use uicc.exe to compile the XML to the binary format and produce
a kfwribon.rc resource file and kfwribbon.h header.

(cherry picked from commit da60312f1352cbd82e39e31398f7ead2e817f119)

ticket: 8192
version_fixed: 1.13.3

10 years agoImport separate large ribbon bitmaps
Benjamin Kaduk [Mon, 27 Jan 2014 18:07:38 +0000 (13:07 -0500)] 
Import separate large ribbon bitmaps

This is the content from homelarge.bmp split up into the
separate component images, since the windows ribbon has the
(more sane) interface of using a separate resource for each
graphic, instead of expecting them all in a single bitmap which
is sliced up at runtime.

The bitmaps are required to have alpha channels, and it seems that
the easiest way to generate bitmaps with alpha channels is to use
Microsoft Paint, since the normal Unix open-source graphics tools
do not want to output this format.

(cherry picked from commit 8f89dc561c1e8464c423bde854b6fd4283497559)

ticket: 8192
version_fixed: 1.13.3

10 years agoRemove MBCS from leash's DEFINES
Benjamin Kaduk [Wed, 22 Jan 2014 05:05:57 +0000 (00:05 -0500)] 
Remove MBCS from leash's DEFINES

This is just enabling the use of multi-byte character set in the
MFC library, but we do not appear to make use of this feature.
Visual Studio 2013 gives ominous warnings that support for it may
be removed in future versions, so quiet the build and do not
enable the deprecated feature we are not using.

(cherry picked from commit 5d50bc2a62739e39ea0b90b0ced3b7489ba554b3)

ticket: 8190
version_fixed: 1.13.3

10 years agoFix leash crash found in some build environments
Ben Kaduk [Tue, 14 Apr 2015 19:33:20 +0000 (15:33 -0400)] 
Fix leash crash found in some build environments

When freeing a credentials cache name obtained from
krb5_cc_get_full_name(), the code was using plain free()
instead of the matching krb5_free_string().  If these routines
are picked from different modules at runtime, the mismatch
will cause a crash in free(), so change to using the matched
deallocation function.

In order to use it in leash, it must be declared in Lglobals.h and
the function pointer symbol defined in Leash.cpp.

(cherry picked from commit ebeb1e359fa10ea710d467ca3756ababd1276fa6)

ticket: 8189
version_fixed: 1.13.3
status: resolved

10 years agoAvoid unneeded GetMSTGT() calls in cc_mslsa.c
Ben Kaduk [Thu, 14 Aug 2014 17:57:48 +0000 (13:57 -0400)] 
Avoid unneeded GetMSTGT() calls in cc_mslsa.c

Both lcc_resolve() and lcc_get_principal() were using GetMSTGT()
to fetch a ticket from which to obtain the client principal name
of the credentials cache.  However, that name is contained in
the results of the the cache information query; there is no need
to retrieve a full ticket of any sort to get it.  Since there
may sometimes be difficulties obtaining a TGT when UAC is enabled,
avoid these unneeded calls.

(cherry picked from commit 76a16d2652da483dd7bc95f24257e0f195b833f0)

ticket: 7989
version_fixed: 1.13.3
status: resolved

10 years agoMove realm conversion into helper in cc_mslsa.c
Ben Kaduk [Thu, 14 Aug 2014 17:51:22 +0000 (13:51 -0400)] 
Move realm conversion into helper in cc_mslsa.c

All the callers of UnicodeStringToMITPrinc() were already converting
a UnicodeString into a wchar* just to pass it in as the realm.

Simplify everyone's life by making the helper do the conversion.

(cherry picked from commit e2d1a3aea7789b6acc5fa963da75ea666614764c)

ticket: 7989
version_fixed: 1.13.3

10 years agoRename cc_mslsa.c routines to avoid OS versions
Ben Kaduk [Wed, 13 Aug 2014 21:48:08 +0000 (17:48 -0400)] 
Rename cc_mslsa.c routines to avoid OS versions

We don't care about XP versus non-XP; just indicate which
revision of the data type is being used.

Standardize on the lowercase 'x' in "Ex", for both the "Ex" and
"Ex2" forms.

While here, adjust the function definition prototypes to match
current style.

(cherry picked from commit bbf946566b32dcf2f9a718b28acd948eeb53ade4)

ticket: 7989
version_fixed: 1.13.3

10 years agoRemove unused code from cc_mslsa.c
Ben Kaduk [Wed, 13 Aug 2014 20:28:57 +0000 (16:28 -0400)] 
Remove unused code from cc_mslsa.c

Remove PreserveInitialTicketIdentity() and IsKerberosLogon(), as well
as the preprocessor conditionals ENABLE_PURGING and PURGE_ALL, which
have not been used in a very long time, if ever.

There was one potential callsite of IsKerberosLogon(), in
lcc_resolve(), which was disabled.  It is perfectly reasonable to want
to use the MSLSA cache on a non-domain-joined workstation, as it is
now a read-write cache type, so we need not concern ourselves whether
the logon was performed or may have been performed using kerberos.

(cherry picked from commit 07aaaee56bf40bfef2847b6f09897ce1aa96773d)

ticket: 7989
version_fixed: 1.13.3

10 years agocomment some future cleanup for cc_mslsa.c
Ben Kaduk [Wed, 13 Aug 2014 20:31:49 +0000 (16:31 -0400)] 
comment some future cleanup for cc_mslsa.c

The function does_query_ticket_cache_ex2() will not be needed once
Windows Server 2003 drops out of support in approximately one year's
time.  Note the doom timer at its definition, to facilitate future
cleanup.

(cherry picked from commit 9d16f24e59e2a0f0809741236344394da49935e2)

ticket: 7989
version_fixed: 1.13.3

10 years agoRemove old Windows support from cc_mslsa.c
Ben Kaduk [Wed, 13 Aug 2014 16:54:37 +0000 (12:54 -0400)] 
Remove old Windows support from cc_mslsa.c

It is safe to remove is_windows_2000(), is_windows_xp(), and
is_windows_vista(), since the former two only check for very old
versions of windows which are no longer supported, and
is_windows_vista() was unused.  Note that the check being implemented
was whether the running OS was the named version or higher, not an
exact match.  The current Microsoft documentation recommends against
the sort of OS version checks that were employed here, in favor of
explicit feature tests.

Remove is_broken_wow64() as the problem it works around (Microsoft
Article ID 960077) is believed to have been fixed in subsequent
updates to Windows Server 2003 and XP.

Remove does_retrieve_ticket_cache_ticket() since support for the
KERB_RETRIEVE_TICKET_CACHE_TICKET flag in the
KERB_RETRIEVE_TKT_REQUEST structure was added in service packs for
Windows Server 2003 and XP.  Also remove buildtime fallbacks that
are no longer needed.

Remove the conditionals TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS,
HAVE_CACHE_INFO_EX2, and KERB_SUBMIT_TICKET as all current SDK
versions have the relevant functionality.

In all cases, de-indent chunks that are no longer conditional.
Where indentation levels changed, update the style of the reindented
code to current practices.

(cherry picked from commit 471b8474de8c5dfbbcc6a5a39201426bdca09f0d)

ticket: 7989
version_fixed: 1.13.3

10 years agoUpdate for krb5-1.13.2-postrelease
Tom Yu [Fri, 8 May 2015 23:48:48 +0000 (19:48 -0400)] 
Update for krb5-1.13.2-postrelease

10 years agoUpdates for krb5-1.13.2 krb5-1.13.2-final
Tom Yu [Wed, 6 May 2015 18:37:45 +0000 (14:37 -0400)] 
Updates for krb5-1.13.2

10 years agomake update-po
Tom Yu [Wed, 6 May 2015 18:57:21 +0000 (14:57 -0400)] 
make update-po

10 years agoUpdate manpages
Tom Yu [Wed, 6 May 2015 18:51:14 +0000 (14:51 -0400)] 
Update manpages

10 years agomake depend
Tom Yu [Wed, 6 May 2015 18:29:14 +0000 (14:29 -0400)] 
make depend

10 years agoFix minor documentation errors
Michael Mattioli [Thu, 23 Apr 2015 05:39:37 +0000 (01:39 -0400)] 
Fix minor documentation errors

Fix typos, remove excess header underlines, and remove trailing
whitespace.

[ghudson@mit.edu: squashed several commits, summarized commit
messages]

(cherry picked from commit 4ad099d28437b542b76053f44f18f763bdcd5152)

ticket: 8170
version_fixed: 1.13.2
status: resolved

10 years agoPrevent requires_preauth bypass [CVE-2015-2694]
Greg Hudson [Tue, 24 Mar 2015 16:02:37 +0000 (12:02 -0400)] 
Prevent requires_preauth bypass [CVE-2015-2694]

In the OTP kdcpreauth module, don't set the TKT_FLG_PRE_AUTH bit until
the request is successfully verified.  In the PKINIT kdcpreauth
module, don't respond with code 0 on empty input or an unconfigured
realm.  Together these bugs could cause the KDC preauth framework to
erroneously treat a request as pre-authenticated.

CVE-2015-2694:

In MIT krb5 1.12 and later, when the KDC is configured with PKINIT
support, an unauthenticated remote attacker can bypass the
requires_preauth flag on a client principal and obtain a ciphertext
encrypted in the principal's long-term key.  This ciphertext could be
used to conduct an off-line dictionary attack against the user's
password.

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

(cherry picked from commit e3b5a5e5267818c97750b266df50b6a3d4649604)

ticket: 8160
version_fixed: 1.13.2
status: resolved

10 years agoFix memory leak in DB2 iteration
Pavel Jindra [Wed, 15 Apr 2015 15:49:53 +0000 (11:49 -0400)] 
Fix memory leak in DB2 iteration

Use the correct function to free the decoded principal entry in
curs_run_cb().

[ghudson@mit.edu: commit message]

(cherry picked from commit 527edfaadb648a0dd2a42cd39a5a02a4ac37d7e3)

ticket: 8168
version_fixed: 1.13.2
status: resolved

10 years agoFix LDAP ticket policies on big-endian LP64
Greg Hudson [Mon, 13 Apr 2015 17:09:20 +0000 (13:09 -0400)] 
Fix LDAP ticket policies on big-endian LP64

krb5_ldap_get_value() takes a pointer to int, and should not be passed
a pointer to any integral type which might have a different width.
Use an intermediate variable for each call.

The erroneous calls in ldap_misc.c were passing pointers to int32_t,
which is harmless on all common platforms.  The calls in
ldap_tkt_policy.c were passing pointers to long; on big-endian LP64
platforms, the result would be written to the high 32 bits of the long
value.

(cherry picked from commit 7fbc092107298bded216fbce4cff6592275bff03)

ticket: 8166
version_fixed: 1.13.2
status: resolved

10 years agoDisable principal renames for LDAP
Greg Hudson [Thu, 26 Mar 2015 16:47:06 +0000 (12:47 -0400)] 
Disable principal renames for LDAP

The current principal rename procedure does not work with the LDAP KDB
module, instead having the effect of deleting the principal.  The fix
is not easy and requires amending the DAL (see issue #8065).  For now,
detect LDAP and error out when a rename operation is attempted.

(cherry picked from commit 8483243664a289fea142d8a9de61eba30d713871)

ticket: 8162
version_fixed: 1.13.2
status: resolved

10 years agoLog invalid restrictions strings
Greg Hudson [Fri, 13 Mar 2015 17:30:49 +0000 (13:30 -0400)] 
Log invalid restrictions strings

In kadm5int_acl_parse_restrictions(), output a log message if we break
out of the parsing loop with an error.  The current structure of the
loop makes it difficult to pinpoint the bad restrictions field, so
just output the whole string.

(cherry picked from commit e9eaafeab12b2b62595f4dff2fca3345b2d95b4a)

ticket: 8155
version_fixed: 1.13.2
status: resolved

10 years agoDocument correct flag names for kadm5.acl
Greg Hudson [Fri, 13 Mar 2015 16:45:27 +0000 (12:45 -0400)] 
Document correct flag names for kadm5.acl

kadm5.acl entries can include restrictions which can force flag values
on or off.  These flag values are parsed with krb5_string_to_flags(),
which means the flag names are the ones for default_principal_flags,
not the ones for kadmin addprinc/modprinc.

(cherry picked from commit ef21069070c1eb2ab1ade1d1406f5cd3920c83a9)

ticket: 8155
version_fixed: 1.13.2
status: resolved

10 years agoFix scope of kadmind ACL wildcard back-references
Greg Hudson [Thu, 12 Mar 2015 20:36:33 +0000 (16:36 -0400)] 
Fix scope of kadmind ACL wildcard back-references

In kadm5int_acl_find_entry(), clear the wildcard back-references list
for each acl entry.  Otherwise the wildcards we process can affect
back-references for later entries.

(cherry picked from commit d3d18b8d8d7a47766fd4e9667d045035f43d90ef)

ticket: 8154
version_fixed: 1.13.2
status: resolved

10 years agoImport names immediately with COMPOSITE_EXPORT
Solly Ross [Thu, 5 Mar 2015 18:22:58 +0000 (13:22 -0500)] 
Import names immediately with COMPOSITE_EXPORT

RFC 6680 specifies that GSS_Export_name_composite() "outputs a token that
"can be imported with GSS_Import_name(), using GSS_C_NT_COMPOSITE_EXPORT
as the name type...".  Therefore, in the gss_import_name mechglue, we
should perform the import process imediately when either
GSS_C_NT_COMPOSITE_EXPORT or GSS_C_NT_EXPORT_NAME are used (not just
for the later, as is the current functionality).

The naming extension test was also updated to display the result
of importing with GSS_C_NT_COMPOSITE_EXPORT in addition to
GSS_C_NT_EXPORT_NAME.

[ghudson@mit.edu: minor style changes]

(cherry picked from commit 29dec110c43ae9cebdcd935906a3131ca9ac0c99)

ticket: 8153
version_fixed: 1.13.2
status: resolved

10 years agoAdd formats section to documentation
Greg Hudson [Fri, 20 Feb 2015 17:56:17 +0000 (12:56 -0500)] 
Add formats section to documentation

Add a new "formats" section to the RST documentation and populate it
with documentation of the credential cache and keytab file formats.

(cherry picked from commit 68ac7ac1f1a1d2939a2c99fa49cecd734614d16d)

ticket: 8149
version_fixed: 1.13.2
status: resolved

10 years agoFix krb5_read_message handling [CVE-2014-5355]
Greg Hudson [Tue, 9 Dec 2014 17:37:44 +0000 (12:37 -0500)] 
Fix krb5_read_message handling [CVE-2014-5355]

In recvauth_common, do not use strcmp against the data fields of
krb5_data objects populated by krb5_read_message(), as there is no
guarantee that they are C strings.  Instead, create an expected
krb5_data value and use data_eq().

In the sample user-to-user server application, check that the received
client principal name is null-terminated before using it with printf
and krb5_parse_name.

CVE-2014-5355:

In MIT krb5, when a server process uses the krb5_recvauth function, an
unauthenticated remote attacker can cause a NULL dereference by
sending a zero-byte version string, or a read beyond the end of
allocated storage by sending a non-null-terminated version string.
The example user-to-user server application (uuserver) is similarly
vulnerable to a zero-length or non-null-terminated principal name
string.

The krb5_recvauth function reads two version strings from the client
using krb5_read_message(), which produces a krb5_data structure
containing a length and a pointer to an octet sequence.  krb5_recvauth
assumes that the data pointer is a valid C string and passes it to
strcmp() to verify the versions.  If the client sends an empty octet
sequence, the data pointer will be NULL and strcmp() will dereference
a NULL pointer, causing the process to crash.  If the client sends a
non-null-terminated octet sequence, strcmp() will read beyond the end
of the allocated storage, possibly causing the process to crash.

uuserver similarly uses krb5_read_message() to read a client principal
name, and then passes it to printf() and krb5_parse_name() without
verifying that it is a valid C string.

The krb5_recvauth function is used by kpropd and the Kerberized
versions of the BSD rlogin and rsh daemons.  These daemons are usually
run out of inetd or in a mode which forks before processing incoming
connections, so a process crash will generally not result in a
complete denial of service.

Thanks to Tim Uglow for discovering this issue.

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

[tlyu@mit.edu: CVSS score]

(cherry picked from commit 102bb6ebf20f9174130c85c3b052ae104e5073ec)

ticket: 8050
version_fixed: 1.13.2
status: resolved

10 years agoUpdate for krb5-1.13.1-postrelease
Tom Yu [Thu, 12 Feb 2015 03:54:37 +0000 (22:54 -0500)] 
Update for krb5-1.13.1-postrelease

10 years agoUpdates for krb5-1.13.1 krb5-1.13.1-final
Tom Yu [Wed, 11 Feb 2015 18:32:31 +0000 (13:32 -0500)] 
Updates for krb5-1.13.1

10 years agoUpdate manpages
Tom Yu [Tue, 10 Feb 2015 20:28:04 +0000 (15:28 -0500)] 
Update manpages

10 years agomake update-po
Tom Yu [Tue, 10 Feb 2015 20:27:17 +0000 (15:27 -0500)] 
make update-po

10 years agoAvoid uninitialized data in t_prf.c
Tom Yu [Wed, 4 Feb 2015 22:01:14 +0000 (17:01 -0500)] 
Avoid uninitialized data in t_prf.c

In t_prf.c, make sure that the partially initialized, faked-up
structures gss_union_ctx_id_desc and krb5_gss_ctx_id_rec are zeroed.
This avoids uninitialized reads in gss_pseudo_random(), which can
cause intermittent test failures on some platforms.

(cherry picked from commit b5143bdc766ad4819355ac2cd52f685ec5dafa16)

ticket: 8072
version_fixed: 1.13.1
status: resolved

10 years agoBump DAL major version for iterate change
Greg Hudson [Wed, 4 Feb 2015 18:03:20 +0000 (13:03 -0500)] 
Bump DAL major version for iterate change

Commit ab009b8568d9b64b7e992ecdb98114e895b4a7ff for issue #7977
changed the signature of krb5_db_iterate() and properly bumped
KRB5_KDB_API_VERSION from 7 to 8.  It also changed the signature of
the DAL iterate() function, but did not bump
KRB5_KDB_DAL_MAJOR_VERSION.  Bump that version from 4 to 5 now.

(cherry picked from commit 58f6636ba3af96f7b94ba6d4b2c91b61fc85e58a)

ticket: 8066
version_fixed: 1.13.1
status: resolved

10 years agoAdd test program for gss_process_context_token
Greg Hudson [Wed, 5 Nov 2014 16:58:52 +0000 (11:58 -0500)] 
Add test program for gss_process_context_token

Add a new test program t_pcontok to exercise
gss_process_context_token, and run it from t_gssapi.py.

(cherry picked from commit bfb472ff67c00da2f2b0d0ada1af57a2c4493a11)

ticket: 8055
version_fixed: 1.13.1
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: 8058
version_fixed: 1.13.1
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: 8057
version_fixed: 1.13.1
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: 8056
version_fixed: 1.13.1
status: resolved

10 years agoFix gss_process_context_token() [CVE-2014-5352]
Greg Hudson [Wed, 5 Nov 2014 16:58:04 +0000 (11:58 -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.

(cherry picked from commit 82dc33da50338ac84c7b4102dc6513d897d0506a)

ticket: 8055
version_fixed: 1.13.1
status: resolved

10 years agoUpdate copyright years
Tom Yu [Tue, 3 Feb 2015 19:25:09 +0000 (14:25 -0500)] 
Update copyright years

10 years agoAdd test for kinit -C WRONG_REALM response
Greg Hudson [Fri, 23 Jan 2015 17:52:31 +0000 (12:52 -0500)] 
Add test for kinit -C WRONG_REALM response

(cherry picked from commit c0778ab2252ece4c3510788d9b72f7f5e3bb05dd)

ticket: 8060
version_fixed: 1.13.1
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: 8060
version_fixed: 1.13.1

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: 8061
version_fixed: 1.13.1
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: 8059
version_fixed: 1.13.1
status: resolved

10 years agoFix OTP tests with pyrad 2.x
Greg Hudson [Mon, 22 Dec 2014 23:37:36 +0000 (18:37 -0500)] 
Fix OTP tests with pyrad 2.x

Declare User-Password as having type "octets" instead of "string" or
pyrad 2.x will throw a decoding error when retrieving it.

(cherry picked from commit 57dc24093015d292189ef23313ef8ff2a81431e4)

ticket: 8053
version_fixed: 1.13.1
status: resolved

10 years agoSupport keyless principals in LDAP [CVE-2014-5354]
Ben Kaduk [Wed, 19 Nov 2014 17:04:46 +0000 (12:04 -0500)] 
Support keyless principals in LDAP [CVE-2014-5354]

Operations like "kadmin -q 'addprinc -nokey foo'" or
"kadmin -q 'purgekeys -all foo'" result in principal entries with
no keys present, so krb5_encode_krbsecretkey() would just return
NULL, which then got unconditionally dereferenced in
krb5_add_ber_mem_ldap_mod().

Apply some fixes to krb5_encode_krbsecretkey() to handle zero-key
principals better, correct the test for an allocation failure, and
slightly restructure the cleanup handler to be shorter and more
appropriate for the usage.  Once it no longer short-circuits when
n_key_data is zero, it will produce an array of length two with both
entries NULL, which is treated as an empty list by the LDAP library,
the correct behavior for a keyless principal.

However, attributes with empty values are only handled by the LDAP
library for Modify operations, not Add operations (which only get
a sequence of Attribute, with no operation field).  Therefore, only
add an empty krbprincipalkey to the modlist when we will be performing a
Modify, and not when we will be performing an Add, which is conditional
on the (misspelled) create_standalone_prinicipal boolean.

CVE-2014-5354:

In MIT krb5, when kadmind is configured to use LDAP for the KDC
database, an authenticated remote attacker can cause a NULL
dereference by inserting into the database a principal entry which
contains no long-term keys.

In order for the LDAP KDC backend to translate a principal entry
from the database abstraction layer into the form expected by the
LDAP schema, the principal's keys are encoded into a
NULL-terminated array of length-value entries to be stored in the
LDAP database.  However, the subroutine which produced this array
did not correctly handle the case where no keys were present,
returning NULL instead of an empty array, and the array was
unconditionally dereferenced while adding to the list of LDAP
operations to perform.

Versions of MIT krb5 prior to 1.12 did not expose a way for
principal entries to have no long-term key material, and
therefore are not vulnerable.

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

(cherry picked from commit 04038bf3633c4b909b5ded3072dc88c8c419bf16)

ticket: 8041
version_fixed: 1.13.1
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)

ticket: 8051
version_fixed: 1.13.1
status: resolved

10 years agoFix LDAP tests when sasl.h not found
Greg Hudson [Mon, 8 Dec 2014 20:30:25 +0000 (15:30 -0500)] 
Fix LDAP tests when sasl.h not found

Do not try to run the SASL EXTERNAL auth test if we could not define a
useful interact function.  With current libraries the interact
function is asked for an authorization name, and the bind fails if it
gets an unsuccessful result or if no interaction function is defined.

(cherry picked from commit 8466003864b294cdb9e5547c2f8e574d2c156b13)

ticket: 8049
version_fixed: 1.13.1
status: resolved

10 years agoAvoid infinite loop on duplicate keysalts
Ben Kaduk [Thu, 20 Nov 2014 20:44:04 +0000 (15:44 -0500)] 
Avoid infinite loop on duplicate keysalts

When duplicate suppression was requested, we would enter an
infinite loop upon encountering a duplicate entry, a bug
introduced in commit 0918990bf1d8560d74473fc0e41d08d433da1a15
and thus present in release 1.13.

Rework the conditional to avoid the loop, at the expense of
additional indentation for some of the code.

(cherry picked from commit c828e7cb137de3559f026dcc552a52162d9ca5cd)

ticket: 8038
version_fixed: 1.13.1
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: 8035
version_fixed: 1.13.1
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: 8034
version_fixed: 1.13.1
status: resolved

10 years agoRemove length limit on PKINIT PKCS#12 prompt
Greg Hudson [Wed, 29 Oct 2014 16:16:40 +0000 (12:16 -0400)] 
Remove length limit on PKINIT PKCS#12 prompt

Long pathnames can trigger the 128-byte prompt length limit in
pkinit_get_certs_pkcs12.  Use asprintf instead of snprintf.  Also
check the result of the prompter invocation.

(cherry picked from commit 3c330ea5846ca02da36a0cb5a5c879364d28a267)

ticket: 8011
version_fixed: 1.13.1
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: 8029
version_fixed: 1.13.1
status: resolved

10 years agoAdd test for kinit output ccache error
Tom Yu [Tue, 16 Dec 2014 17:38:47 +0000 (12:38 -0500)] 
Add test for kinit output ccache error

(back ported from commit e47d8204843ce87fcc1342c7970dded8536fcbde)

ticket: 8028
version_fixed: 1.13.1
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: 8028
version_fixed: 1.13.1
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: 7962
version_fixed: 1.13.1
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: 7880
version_fixed: 1.13.1
status: resolved

10 years agoUse gssalloc_malloc for GSS error tokens
Greg Hudson [Wed, 8 Oct 2014 00:22:52 +0000 (20:22 -0400)] 
Use gssalloc_malloc for GSS error tokens

In kg_accept_krb5, use gssalloc_malloc when allocating space for the
error token, since it will be freed with gssalloc_free.  Using malloc
can cause heap corruption on Windows.  This bug was masked by #1445
before 1.12.

(cherry picked from commit 68cfc8b4e6338b78dce5a960ce47974a73906fac)

ticket: 8024
version_fixed: 1.13.1
status: resolved

10 years agoUpdate for krb5-1.13-postrelease
Tom Yu [Thu, 16 Oct 2014 00:50:25 +0000 (20:50 -0400)] 
Update for krb5-1.13-postrelease

10 years agoUpdates for krb5-1.13 krb5-1.13-final
Tom Yu [Wed, 15 Oct 2014 22:44:48 +0000 (18:44 -0400)] 
Updates for krb5-1.13

10 years agoUpdate mitK5features.rst for 1.13
Tom Yu [Wed, 15 Oct 2014 21:16:12 +0000 (17:16 -0400)] 
Update mitK5features.rst for 1.13

10 years agoBetter document how to verify PGP signature
Tom Yu [Tue, 14 Oct 2014 18:31:09 +0000 (14:31 -0400)] 
Better document how to verify PGP signature

Add text clarifying our unusual packaging of the PGP signature inside
a tar file.

(cherry picked from commit fa4138c7853487105ab3c54e6d176c45eaf8b065)

ticket: 7927
version_fixed: 1.13
status: resolved

10 years agoDocument that newer AFS supports stronger crypto
Tom Yu [Mon, 6 Oct 2014 18:32:21 +0000 (14:32 -0400)] 
Document that newer AFS supports stronger crypto

Modern OpenAFS releases support using encryption stronger than single
DES with Kerberos.  Update the documentation accordingly.

(cherry picked from commit 9b51ffb0c55a6c4c44501d86eb207acc79403c5c)

ticket: 7761
version_fixed: 1.13
status: resolved

10 years agoUpdate for krb5-1.13-beta1-postrelease
Tom Yu [Fri, 26 Sep 2014 18:16:22 +0000 (14:16 -0400)] 
Update for krb5-1.13-beta1-postrelease

10 years agoUpdates for krb5-1.13-beta1 krb5-1.13-beta1
Tom Yu [Wed, 24 Sep 2014 23:30:54 +0000 (19:30 -0400)] 
Updates for krb5-1.13-beta1

10 years agomake update-po
Tom Yu [Wed, 24 Sep 2014 23:14:06 +0000 (19:14 -0400)] 
make update-po

10 years agoUpdate manpages
Tom Yu [Wed, 24 Sep 2014 18:43:56 +0000 (14:43 -0400)] 
Update manpages

10 years agomake depend
Tom Yu [Wed, 24 Sep 2014 18:43:19 +0000 (14:43 -0400)] 
make depend

10 years agoReturn only new keys in randkey [CVE-2014-5351]
Greg Hudson [Thu, 21 Aug 2014 17:52:07 +0000 (13:52 -0400)] 
Return only new keys in randkey [CVE-2014-5351]

In kadmind's randkey operation, if a client specifies the keepold
flag, do not include the preserved old keys in the response.

CVE-2014-5351:

An authenticated remote attacker can retrieve the current keys for a
service principal when generating a new set of keys for that
principal.  The attacker needs to be authenticated as a user who has
the elevated privilege for randomizing the keys of other principals.

Normally, when a Kerberos administrator randomizes the keys of a
service principal, kadmind returns only the new keys.  This prevents
an administrator who lacks legitimate privileged access to a service
from forging tickets to authenticate to that service.  If the
"keepold" flag to the kadmin randkey RPC operation is true, kadmind
retains the old keys in the KDC database as intended, but also
unexpectedly returns the old keys to the client, which exposes the
service to ticket forgery attacks from the administrator.

A mitigating factor is that legitimate clients of the affected service
will start failing to authenticate to the service once they begin to
receive service tickets encrypted in the new keys.  The affected
service will be unable to decrypt the newly issued tickets, possibly
alerting the legitimate administrator of the affected service.

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

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

(cherry picked from commit af0ed4df4dfae762ab5fb605f5a0c8f59cb4f6ca)

ticket: 8018
version_fixed: 1.13
status: resolved

10 years agoFix krb5 gss_acquire_cred_impersonate_name crash
Greg Hudson [Fri, 19 Sep 2014 15:35:10 +0000 (11:35 -0400)] 
Fix krb5 gss_acquire_cred_impersonate_name crash

If gss_acquire_cred_impersonate_name is called using an
impersonator_cred_handle acquired with GSS_C_ACCEPT, we could
dereference null fields of the cred handle and crash.  Fix this by
checking the impersonator_cred_handle usage and returning
GSS_S_NO_CRED if it isn't what we expect, just as we do in
init_sec_context.

Based on a patch from Solly Ross <sross@redhat.com>.

(cherry picked from commit 17689700b27c6fb6d26156330d11b57ef79385d3)

ticket: 8017
version_fixed: 1.13
status: resolved

10 years agoWork around replay cache creation race
Greg Hudson [Wed, 17 Sep 2014 14:45:28 +0000 (10:45 -0400)] 
Work around replay cache creation race

If two processes try to initialize the same replay cache at the same
time, krb5_rc_io_creat can race between unlink and open, leading to a
KRB5_RC_IO_PERM error.  When this happens, make the losing process
retry so that it can continue.

This does not solve the replay cache creation race, nor is that the
only replay cache race issue.  It simply prevents the race from
causing a spurious failure.

(cherry picked from commit c61e8c0c6ad5fda8d23dd896c4aed0ac5b470020)

ticket: 3498
version_fixed: 1.13
status: resolved

10 years agoRestore providing password TGTs for the ksu target
Nalin Dahyabhai [Thu, 18 Sep 2014 12:37:29 +0000 (08:37 -0400)] 
Restore providing password TGTs for the ksu target

The use of "stored" was originally for marking whether or not creds
had been found in the source cache and copied to the target. If it was
false, the obtain-a-TGT-using-a-password path would be triggered and
it would populate the target ccache directly.

When the intermediate cache was introduced (in commit dccc80a), the
variable started marking whether or not creds had been copied to the
intermediate cache, and this was then used to decide whether or not to
copy creds to the target cache.

The obtain-a-TGT-using-a-password path began storing its creds in the
temporary cache as well, but neglected to set the flag so that the
creds would be copied to the target cache later, so the target ccache
would never be created and populated with the newly-obtained TGT.

(cherry picked from commit 005f4eb3ccc1092f4a43afc4d6a4fabfa20b2b41)

ticket: 8016
version_fixed: 1.13
status: resolved

10 years agoFix ksu crash in cases where it obtains the TGT
Nalin Dahyabhai [Tue, 16 Sep 2014 17:50:05 +0000 (13:50 -0400)] 
Fix ksu crash in cases where it obtains the TGT

In order to allow ksu to use any locally-present service key for
verifying creds, the previous change to ksu switched from using a
retrieved or obtained TGT to fetch creds for the local "host" service,
and then passing those creds to krb5_verify_init_creds(), to passing the
retrieved TGT directly to krb5_verify_init_creds().

It did not take care to retrieve the TGT from the temporary ccache if it
had obtained them, and in those cases it would attempt to verify NULL
creds.

Modify the krb5_get_tkt_via_passwd() function to call
krb5_get_init_creds_password(), to pass back the freshly-obtained creds,
to take a "krb5_get_init_creds_opt" pointer instead of a locally-defined
options structure, and rename it to ksu_get_tgt_via_passwd().

(cherry picked from commit 5fd5a67c5a93514e7d0a64425baa007ad91f57de)

ticket: 8015
version_fixed: 1.13
status: resolved

10 years agoDocument KDC TCP listener change
Tom Yu [Tue, 16 Sep 2014 18:18:17 +0000 (14:18 -0400)] 
Document KDC TCP listener change

Update documentation to reflect the change in the default KDC TCP
listener behavior, new in 1.13.

(cherry picked from commit 59cbb7662282f6f882b5d108cf45bdd042857c6a)

ticket: 6731
version_fixed: 1.13
status: resolved

10 years agoEnable KDC TCP listener by default
Tom Yu [Tue, 16 Sep 2014 18:15:47 +0000 (14:15 -0400)] 
Enable KDC TCP listener by default

Make the KDC default to listening on TCP.

(cherry picked from commit 8d88e2ab00be126237569dc72827ced2ce6b7d04)

ticket: 6731

10 years agoLet libgssapi see TGTs in the MSLSA cache
Ben Kaduk [Thu, 21 Aug 2014 22:56:24 +0000 (18:56 -0400)] 
Let libgssapi see TGTs in the MSLSA cache

When the current user is a local administrator of a windows machine
where User Account Control (UAC) is enabled, the Windows LSA will
return a block of zeros as the session key for any TGT entry in the
MSLSA: cache.  The lcc_retrieve() implementation checks for such
"null" session keys and prevents them from escaping to callers (as
attempts to use them would encounger strange errors).  However,
when the TGT is the only entry in the cache, this filtering prevents
scan_ccache() from detecting that the cache contains non-expired
credentials (and that there is a TGT present).

Since scan_ccache() is only looking at metadata in the cache entries,
and does not need to actually use any tickets or session keys, set
the KRB5_TC_NOTICKET flag on the ccache before scanning it.  This
will allow the MSLSA implementation to return a cred for the TGT
entry and cause the GSSAPI credential selection algorithm to function
properly.

(cherry picked from commit 0794746f8d8e6b8ce3748d442d2bc1faecf960ce)

ticket: 8000
version_fixed: 1.13
status: resolved

10 years agoAdd some KDC entries to the registry via WiX
Ben Kaduk [Thu, 21 Aug 2014 21:33:11 +0000 (17:33 -0400)] 
Add some KDC entries to the registry via WiX

Though our library happily uses DNS, I can't get Windows to
successfully contact KDCs found through the SRV records.
So, we do need to stay in the business of shipping around
KDC entries, after all.

(cherry picked from commit d2b76e1ba0f4bb0ec7e560a9a681d938f45f950c)

ticket: 7999

10 years agoTry to scan_ccache() after leash picks a cache
Ben Kaduk [Thu, 21 Aug 2014 16:48:39 +0000 (12:48 -0400)] 
Try to scan_ccache() after leash picks a cache

We need to call scan_ccache() in order to notice that there
are credentials and read their expire time.

The call to scan_ccache() in the Leash case was inadvertently
removed as part of commit 8651f3339ccc5a623172a8edfb9cf522883acacd.

(cherry picked from commit 674f7d7abe2d4f8bc3fe791e4347a332e3ccfd41)

ticket: 7998
version_fixed: 1.13
status: resolved

10 years agoDocument clock skew tolerance for ticket times
Brett Randall [Fri, 5 Sep 2014 01:21:35 +0000 (11:21 +1000)] 
Document clock skew tolerance for ticket times

KDC and application server checks on ticket start and expiration times
are subject to clock skew tolerance.  Document this grace period.

[tlyu@mit.edu: edit commit message, adjust wording to conform to
existing style, document start time clock skew]

(cherry picked from commit e56f3d43a746c198b1fd1889dc1211b9feedbfc3)

ticket: 8008
version_fixed: 1.13
status: resolved

10 years agoIn ksu, handle typeless default_ccache_name values
Nalin Dahyabhai [Mon, 8 Sep 2014 17:15:40 +0000 (13:15 -0400)] 
In ksu, handle typeless default_ccache_name values

When a configured or compiled-in default ccache name doesn't contain a
cache type and ':' as a prefix, add one to the writeable value that we
construct when we go to look it up.  This lets the rest of the
application always assume that it'll be there.

[ghudson@mit.edu: minor style changes]

(cherry picked from commit bda574576a5a2d0613fecf12d820e0adcbedf95c)

ticket: 8007
version_fixed: 1.13
status: resolved

10 years agoRe-encrypt preserved key data in new master key
Greg Hudson [Mon, 25 Aug 2014 16:48:14 +0000 (12:48 -0400)] 
Re-encrypt preserved key data in new master key

When we are preserving old key data in kdb_cpw.c, ensure that it is
encrypted with the same master key as the new key data.  This ensures
that the KRB5_TL_MKVNO tl-data on the principal entry applies to all
of the key data, not just some of it.

(cherry picked from commit 32c9b8f1aa1b348388ed227394cc609e68ed833b)

ticket: 7995
version_fixed: 1.13
status: resolved

10 years agoAdd test case for -keepold mkey re-encryption
Greg Hudson [Mon, 25 Aug 2014 17:02:03 +0000 (13:02 -0400)] 
Add test case for -keepold mkey re-encryption

(cherry picked from commit 8ee40f56e6c789a87dc403bf70d524d2b3b21dbf)

ticket: 7995
version_fixed: 1.13
status: resolved

10 years agoUpdate NOTICE with new changes for 1.13
Benjamin Kaduk [Wed, 3 Sep 2014 02:16:51 +0000 (22:16 -0400)] 
Update NOTICE with new changes for 1.13

The KCM RPC definitions are copyright KTH/Apple, since it is present
for interoperability with OS X.

Add MS-KKDCP client copyright; alas, it does not match the existing
Red Hat copyrights, since the new code is a 2-clause BSD license, and
there was only a 3-clause Red Hat copyright block present already.

The actual Sphinx output for NOTICE would adjust the wrapping and
indentation of some existing content, but those changes were removed
by hand, so this commit only reflects new added content.

(cherry picked from commit 2cb54d39316f9a0cc8e75b791b2faf6f051c9495)

ticket: 8006
version_fixed: 1.13
status: resolved

10 years agoAllow logger.c to work with redirected stderr
Tom Yu [Tue, 26 Aug 2014 22:18:02 +0000 (18:18 -0400)] 
Allow logger.c to work with redirected stderr

In lib/kadm5/logger.c:krb5_klog_init(), if the configuration requests
STDERR logging, call fdopen() using mode "w" instead of "a+", to avoid
errors when stderr happens to be opened for write only.

(cherry picked from commit a85923073ad2d1f5d0314ab330fd6c5f07749be8)

ticket: 8001
version_fixed: 1.13
status: resolved

10 years agoInitialize iterflags in update_princ_encryption
Ben Kaduk [Fri, 29 Aug 2014 17:14:07 +0000 (13:14 -0400)] 
Initialize iterflags in update_princ_encryption

It is only assigned to in the non-dry-run case, which clang detects
and aborts the build (when maintainer mode is enabled).

(cherry picked from commit bf040d0c4072742efab854ab01af162569f0a8f7)

ticket: 8005
version_fixed: 1.13
status: resolved

10 years agoMap .hin files to the C language for doxygen
Ben Kaduk [Thu, 28 Aug 2014 21:54:39 +0000 (17:54 -0400)] 
Map .hin files to the C language for doxygen

In Debian unstable, the current version of doxygen is unhappy with
our generated Doxyfile, and does not handle krb5.hin in the expected
fashion (as a C header).  Work around this issue by explicitly
specifying that files with the .hin extension are to be treated
as C language files.

(cherry picked from commit b7a4d695263f1a5b7fe72b1eadce4acdc3f0490b)

ticket: 8004
version_fixed: 1.13
status: resolved

10 years agoExport gssrpc_bindresvport_sa
Ben Kaduk [Fri, 29 Aug 2014 02:58:49 +0000 (22:58 -0400)] 
Export gssrpc_bindresvport_sa

It was added in commit 0d04b60d159ab83b943e43802b1449a3b074bc83, but
was not added to the library export symbol list, and thus was unusable
on systems that enforced library export lists.

(cherry picked from commit f749c07bb18878f34f63aa3997bb0ef1360a9a0a)

ticket: 8003
version_fixed: 1.13
status: resolved

10 years agoAdd test case for randkey mkvno update
Greg Hudson [Mon, 18 Aug 2014 19:10:00 +0000 (15:10 -0400)] 
Add test case for randkey mkvno update

(cherry picked from commit b96f562888e3e7733e449a922920158e84e0a933)

ticket: 7994
version_fixed: 1.13
status: resolved

10 years agoMake randkey update principal mkvno
Greg Hudson [Mon, 18 Aug 2014 19:09:41 +0000 (15:09 -0400)] 
Make randkey update principal mkvno

In kadm5_randkey_principal_3, after updating the principal's keys,
update its mkvno tl-data to indicate the master key version we
encrypted the new keys with.

(cherry picked from commit 05a3b205c5d7ee491a64e24581cb4def3814c05b)

ticket: 7994

10 years agokadm5_randkey_principal interop with Solaris KDC
Tomas Kuthan [Wed, 28 May 2014 13:24:20 +0000 (15:24 +0200)] 
kadm5_randkey_principal interop with Solaris KDC

When kadm5_randkey_principal is called on Solaris kadmind (as opposed
to kadm5_randkey_principal_3), the KDC assumes the peer is a Solaris 9
system, and only creates DES keys.

For better interoperability, always call kadm5_randkey_principal_3
first.  If this procedure is not present on the remote server, fall
back to calling kadm5_randkey_principal if possible.

[ghudson@mit.edu: adjusted comments, argument wrapping, commit
message]

(cherry picked from commit e86e3baaa684a7e891ffe852d74095c1a8b630ba)

ticket: 7997
version_fixed: 1.13
status: resolved

10 years agoSimplify and improve ksu cred verification
Nalin Dahyabhai [Tue, 19 Aug 2014 18:07:26 +0000 (14:07 -0400)] 
Simplify and improve ksu cred verification

When verifying the user's initial credentials, don't compute a server
name and preemptively obtain creds for it.  This change allows
krb5_verify_init_creds to use any host key in the keytab, and not just
the one for the canonicalized local hostname.

[ghudson@mit.edu: rewrote commit message]

(cherry picked from commit bbfe19f03bdeca7b05b542dbae4c1692c9800c70)

ticket: 7996
version_fixed: 1.13
status: resolved

10 years agoAutodetect OpenSSL CMS for LibreSSL compatibility
maurerpe [Thu, 14 Aug 2014 21:43:55 +0000 (17:43 -0400)] 
Autodetect OpenSSL CMS for LibreSSL compatibility

LibreSSL currently does not support CMS, so checking for CMS via
OPENSSL_VERSION_NUMBER isn't reliable.  Detect CMS support via
autoconf instead.

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

(cherry picked from commit a7a8e3186a21c15132cd8fb6c141afcf25a1fb74)

ticket: 7993
version_fixed: 1.13
status: resolved

10 years agoFix test syntax in configure.in
Michael Osipov [Fri, 15 Aug 2014 12:20:10 +0000 (14:20 +0200)] 
Fix test syntax in configure.in

Commits 1e4bdcfe and 8df1965d used the wrong test equality operator.
Some versions of test allow == for equality, but others (such as the
HP-UX version) do not.  Use a single = for correctness.

[ghudson@mit.edu: clarified commit message]

(cherry picked from commit fefd465614f11f374f5ff183e6eb6cbc1b550de5)

ticket: 7992
version_fixed: 1.13
status: resolved

10 years agoFix HP-UX build support
Michael Osipov [Thu, 14 Aug 2014 13:48:11 +0000 (15:48 +0200)] 
Fix HP-UX build support

Rename hpux10.exports to hpux.exports.  In the HP-UX section of
shlib.conf, remove '+s' because it just specifies a default, add a
MAKE_SHLIB_COMMAND, and set SHLIBEXT based on the host CPU.

[ghudson@mit.edu: squashed commits, condensed commit message]

(cherry picked from commit fdd1c69471bbe5fec0da9f9bcaa9d0a7739db77f)

ticket: 7990
version_fixed: 1.13
status: resolved

10 years agokrb5-1.13-alpha1-postrelease
Tom Yu [Thu, 21 Aug 2014 21:57:14 +0000 (17:57 -0400)] 
krb5-1.13-alpha1-postrelease

10 years agoUpdates for krb5-1.13-alpha1 krb5-1.13-alpha1
Tom Yu [Wed, 20 Aug 2014 19:24:46 +0000 (15:24 -0400)] 
Updates for krb5-1.13-alpha1

11 years agoAllow SPNEGO fallback to NTLM without mechlistMIC
Greg Hudson [Fri, 8 Aug 2014 17:32:51 +0000 (13:32 -0400)] 
Allow SPNEGO fallback to NTLM without mechlistMIC

For interoperability with Windows Server 2003 and earlier, loosen the
initiator's enforcement of RFC 4178's mechlistMIC requirement when
falling back to NTLMSSP.

[ghudson@mit.edu: rewrote commit message, added comment to NTLMSSP
OID]

(cherry picked from commit 7208dace8bfbdf5b930e26a19c8ff31c13ea1ef3)

ticket: 7975
version_fixed: 1.13
status: resolved

11 years agoMake krb5_cc_new_unique create DIR: directories
Nalin Dahyabhai [Fri, 8 Aug 2014 20:58:03 +0000 (16:58 -0400)] 
Make krb5_cc_new_unique create DIR: directories

When we use krb5_cc_new_unique to create a new cache in a directory
cache collection, we will fail if the directory doesn't exist yet.

Go ahead and preemptively create it, as we do during krb5_cc_resolve,
before attempting to create a new file under it.

(cherry picked from commit bca1191210eb582fe09e94486e2631d72b8a5ca5)

ticket: 7988
version_fixed: 1.13
status: resolved

11 years agoFix GSS krb5 GSS_C_DELEG_FLAG ret_flags result
Greg Hudson [Fri, 8 Aug 2014 20:50:38 +0000 (16:50 -0400)] 
Fix GSS krb5 GSS_C_DELEG_FLAG ret_flags result

The krb5 gss_accept_sec_context could erroneously return
GSS_C_DELEG_FLAG in ret_flags if either:

* The token included the GSS_C_DELEG_FLAG but did not include at least
  28 bytes in the authenticator checksum.
* The initial token included the GSS_C_DELEG_FLAG but a DCE-style
  exchange was performed.

Fix both of these cases.

(cherry picked from commit d899084e24555dc8fd091eb08187ca2a45a08324)

ticket: 7987
version_fixed: 1.13
status: resolved

11 years agoUse more randomness for ksu secondary cache names
Nalin Dahyabhai [Thu, 24 Jul 2014 20:43:21 +0000 (16:43 -0400)] 
Use more randomness for ksu secondary cache names

When generating a suffix to append to a ccache name that will hold the
credentials for a ksu-invoked process, instead of using integers
counting up from 1, use the result of base64-encoding six randomly-
generated octets.  Tweak the output alphabet just a bit to avoid using
'+' or '/' in the generated names, the latter of which could really
confuse things.

11 years agoCopy config entries to the ksu target ccache
Nalin Dahyabhai [Tue, 29 Oct 2013 20:27:20 +0000 (16:27 -0400)] 
Copy config entries to the ksu target ccache

When we try to screen out expired creds while reading them from one
ccache to eventually store in another, also keep configuration entries.

ticket: 7986 (new)