]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
9 years agoUpdates for kfw-4.1-beta3 kfw-4.1-beta3
Tom Yu [Mon, 11 Apr 2016 21:22:19 +0000 (17:22 -0400)] 
Updates for kfw-4.1-beta3

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

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

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

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

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

New behavior:

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

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

[tlyu@mit.edu: edit commit message]

(cherry picked from commit 33b862799efa65b16e2acd1510c84d9f1ded2cbb)

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

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

(cherry picked from commit e033a81c891030741952e4743a0b5503bdbcea17)

ticket: 8390

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

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

CVE-2016-3119:

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

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

(cherry picked from commit 08c642c09c38a9c6454ab43a9b53b2a89b9eef99)

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

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

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

(back ported from commit 194641a8ad7aecc6bc1d4848742c14569f14b900)

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

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

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

(cherry picked from commit a1faaa4d6a404e3103f45e639b8890c3b141dfe1)

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

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

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

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

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

Update lists of Consortium Sponsors and contributors.

[ci skip]

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

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

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

Update copyright years to 2016 where appropriate.

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

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

(cherry picked from commit 1868916dbb60a64b92da217257b4ed021262afd3)

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

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

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

CVE-2015-8631:

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

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

(cherry picked from commit 83ed75feba32e46f736fcce0d96a0445f29b96c2)

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

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

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

CVE-2015-8630:

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

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

(cherry picked from commit b863de7fbf080b15e347a736fdda0a82d42f4f6b)

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

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

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

CVE-2015-8629:

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

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

(cherry picked from commit df17a1224a3406f57477bcd372c61e04c0e5a5bb)

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

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

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

(cherry picked from commit d998b088adb875bc0a4e13c184075f91fb23336b)

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

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

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

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

(cherry picked from commit 8fd85a77789496b8d7f8092f6e8a2824bc09a6cf)

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

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

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

(cherry picked from commit 159dbbd5ff14fdc2fa71fb3a8804eb401c914399)

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

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

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

(cherry picked from commit 23a16fb5eac733880e34a770882ed17b93b5d66c)

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

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

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

(cherry picked from commit 09e8307da049cf90bb1f7b9b4b1608a0b9130fd9)

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

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

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

(cherry picked from commit 39802ad406c294306a407ea3d1199941d8b5d773)

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

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

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

(cherry picked from commit 0491c778064e80aaf2aaeb4475a0db333542fed9)

ticket: 8336

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

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

(cherry picked from commit 40b007c0d8e2a12c6f4205ac111dee731c9d970c)

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

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

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

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

(cherry picked from commit 3beb564cea3d219efcf71682b6576cad548c2d23)

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

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

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

(cherry picked from commit b6f29cbd2ab132e336b5435447348400e9a9e241)

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

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

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

[ghudson@mit.edu: edit commit message]

(cherry picked from commit c877f13c8985d820583b0d7ac1bb4c5dc36e677e)

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

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

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

(cherry picked from commit 5568d31f45fb78f505340a5b520b22d4dd3f6522)

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

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

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

(cherry picked from commit 08fafff29a11e61036021196aaae8c303d1a5662)

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

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

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

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

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

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

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

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

[ghudson@mit.edu: edit commit message]

(cherry picked from commit c9e035794caa784b6cdf416e2b3f1d641d011390)

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

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

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

[ghudson@mit.edu: edit commit message]

(cherry picked from commit 95736f7d51cce7551c3c20450ff56831a71043df)

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

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

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

[ghudson@mit.edu: edit commit message]

(cherry picked from commit 36732bf2084803eef52ad56576e5a50f37ccd115)

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

9 years agoDefine error status GSS_S_BAD_MIC
Tomas Kuthan [Wed, 30 Sep 2015 13:11:03 +0000 (15:11 +0200)] 
Define error status GSS_S_BAD_MIC

RFC 2743 adds GSS_S_BAD_MIC as an alias for GSS_S_BAD_SIG.

[ghudson@mit.edu: edit commit messsage]

(cherry picked from commit be87852a12737eed448032875fb74f23e9cbf26b)

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

9 years agoFix minor utf8-to-ucs2s read overrun bug
Greg Hudson [Fri, 25 Sep 2015 21:31:53 +0000 (17:31 -0400)] 
Fix minor utf8-to-ucs2s read overrun bug

k5_utf8s_to_ucs2s() reads and ignores one extra byte from the input
string before terminating its loop, possibly overrunning the input
buffer of its caller.  This overrun is typically without consequence,
but can show up in tools like asan or valgrind during RC4
string-to-key operations.  Fix the bug by swapping the order of the
loop conditions.

(cherry picked from commit eb52da21d72faa3d00b1205a5a0fdbabc45c9e6d)

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

9 years agoFix error mappings for IOV MIC mechglue funcs
Tomas Kuthan [Wed, 16 Sep 2015 10:13:26 +0000 (12:13 +0200)] 
Fix error mappings for IOV MIC mechglue funcs

The mechglue functions gss_get_mic_iov(), gss_get_mic_iov_length(),
and gss_verify_mic_iov() don't call map_error() to map
mechanism-specific error codes.  As a result, a subsequent call to
gss_display_status() fails with GSS_S_BAD_MECH, because no translation
for the error code is found in the error table.

This patch adds the missing map_error call.

[ghudson@mit.edu: correct a whitespace issue, edit commit message]

(cherry picked from commit 969c976ff021db7e409ce9a38d28316d9acfa2cc)

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

9 years agoUntabify kerberos.schema and kerberos.ldif
Greg Hudson [Wed, 16 Sep 2015 16:06:08 +0000 (12:06 -0400)] 
Untabify kerberos.schema and kerberos.ldif

Tabs are not equivalent to spaces in LDIF.

(cherry picked from commit dd2baa849b00fa1f26d722450f22f13e34e71af4)

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

9 years agoFix compatibility with pre-1.11 iprop dump files
Greg Hudson [Fri, 17 Jul 2015 17:03:35 +0000 (13:03 -0400)] 
Fix compatibility with pre-1.11 iprop dump files

Ticket #7223 added new policy fields and a new dump format version to
marshal them, but did not add a new iprop dump format version.  As a
result, slave KDCs running 1.11 or later cannot receive full resyncs
from master KDCs running 1.10 or earlier.  (Reported by John
Devitofranceschi.)

Retroactively add support for pre-1.11 policy entries by making
process_r1_11_policy() read the first ten fields, check whether the
next whitespace character is a newline, and then read the rest if it
is not.

(back ported from commit 3c9ab5220bcc3f57641f6f4b6942b17aadb6613d)

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

9 years agoRemove ksu -D flag documentation
Remi Ferrand [Sat, 15 Nov 2014 10:40:11 +0000 (11:40 +0100)] 
Remove ksu -D flag documentation

ksu -D does not work in the default build, so we should not document
it.  Remove any mention of it from the usage message and from ksu.rst.

[ghudson@mit.edu: edited commit message; omit change to generated man
page]

(cherry picked from commit f4e3e096af73254f208d0fc0632db12fc559e1ad)

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

9 years agoFix SPNEGO context import
Greg Hudson [Mon, 2 Nov 2015 03:46:56 +0000 (22:46 -0500)] 
Fix SPNEGO context import

The patches for CVE-2015-2695 did not implement a SPNEGO
gss_import_sec_context() function, under the erroneous belief that an
exported SPNEGO context would be tagged with the underlying context
mechanism.  Implement it now to allow SPNEGO contexts to be
successfully exported and imported after establishment.

(cherry picked from commit 222b09f6e2f536354555f2a0dedfe29fc10c01d6)
(cherry picked from commit 8e10a780fd3bfefd1ba08ca1552e8d0677917454)

ticket: 8284
version_fixed: 1.13.3
status: resolved

9 years agoFix IAKERB context export/import [CVE-2015-2698]
Greg Hudson [Mon, 2 Nov 2015 03:45:21 +0000 (22:45 -0500)] 
Fix IAKERB context export/import [CVE-2015-2698]

The patches for CVE-2015-2696 contained a regression in the newly
added IAKERB iakerb_gss_export_sec_context() function, which could
cause it to corrupt memory.  Fix the regression by properly
dereferencing the context_handle pointer before casting it.

Also, the patches did not implement an IAKERB gss_import_sec_context()
function, under the erroneous belief that an exported IAKERB context
would be tagged as a krb5 context.  Implement it now to allow IAKERB
contexts to be successfully exported and imported after establishment.

CVE-2015-2698:

In any MIT krb5 release with the patches for CVE-2015-2696 applied, an
application which calls gss_export_sec_context() may experience memory
corruption if the context was established using the IAKERB mechanism.
Historically, some vulnerabilities of this nature can be translated
into remote code execution, though the necessary exploits must be
tailored to the individual application and are usually quite
complicated.

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

(cherry picked from commit 3db8dfec1ef50ddd78d6ba9503185995876a39fd)
(cherry picked from commit 54222de30a89bfac0247dfbc1759556dc9fd2983)

ticket: 8284 (new)
version_fixed: 1.13.3

9 years agoFix two IAKERB comments
Greg Hudson [Tue, 27 Oct 2015 04:44:24 +0000 (00:44 -0400)] 
Fix two IAKERB comments

The comment explaining why there is no iakerb_gss_import_sec_context()
erroneously referenced SPNEGO instead of IAKERB (noticed by Ben
Kaduk).  The comment above iakerb_gss_delete_sec_context() is out of
date after the last commit.

(cherry picked from commit 92d6dd045dfc06cc03d20b327a6ee7a71e6bc24d)
(cherry picked from commit 1be18763f94dc519da9b9928e82566558c8748c2)

9 years agoFix build_principal memory bug [CVE-2015-2697]
Greg Hudson [Fri, 25 Sep 2015 16:51:47 +0000 (12:51 -0400)] 
Fix build_principal memory bug [CVE-2015-2697]

In build_principal_va(), use k5memdup0() instead of strdup() to make a
copy of the realm, to ensure that we allocate the correct number of
bytes and do not read past the end of the input string.  This bug
affects krb5_build_principal(), krb5_build_principal_va(), and
krb5_build_principal_alloc_va().  krb5_build_principal_ext() is not
affected.

CVE-2015-2697:

In MIT krb5 1.7 and later, an authenticated attacker may be able to
cause a KDC to crash using a TGS request with a large realm field
beginning with a null byte.  If the KDC attempts to find a referral to
answer the request, it constructs a principal name for lookup using
krb5_build_principal() with the requested realm.  Due to a bug in this
function, the null byte causes only one byte be allocated for the
realm field of the constructed principal, far less than its length.
Subsequent operations on the lookup principal may cause a read beyond
the end of the mapped memory region, causing the KDC process to crash.

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

(cherry picked from commit f0c094a1b745d91ef2f9a4eae2149aac026a5789)
(cherry picked from commit 67bdf8189b24efca8a244316e7d51bd52d0dbda9)

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

9 years agoFix IAKERB context aliasing bugs [CVE-2015-2696]
Nicolas Williams [Mon, 14 Sep 2015 16:28:36 +0000 (12:28 -0400)] 
Fix IAKERB context aliasing bugs [CVE-2015-2696]

The IAKERB mechanism currently replaces its context handle with the
krb5 mechanism handle upon establishment, under the assumption that
most GSS functions are only called after context establishment.  This
assumption is incorrect, and can lead to aliasing violations for some
programs.  Maintain the IAKERB context structure after context
establishment and add new IAKERB entry points to refer to it with that
type.  Add initiate and established flags to the IAKERB context
structure for use in gss_inquire_context() prior to context
establishment.

CVE-2015-2696:

In MIT krb5 1.9 and later, applications which call
gss_inquire_context() on a partially-established IAKERB context can
cause the GSS-API library to read from a pointer using the wrong type,
generally causing a process crash.  Java server applications using the
native JGSS provider are vulnerable to this bug.  A carefully crafted
IAKERB packet might allow the gss_inquire_context() call to succeed
with attacker-determined results, but applications should not make
access control decisions based on gss_inquire_context() results prior
to context establishment.

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

[ghudson@mit.edu: several bugfixes, style changes, and edge-case
behavior changes; commit message and CVE description]

(cherry picked from commit e04f0283516e80d2f93366e0d479d13c9b5c8c2a)
(cherry picked from commit 096cfaa18504d20889a3d8829decb1bf72dd0ac5)

ticket: 8282
version_fixed: 1.13.3

9 years agoFix mechglue gss_acquire_cred_impersonate_name
Simo Sorce [Fri, 13 Nov 2015 19:44:54 +0000 (14:44 -0500)] 
Fix mechglue gss_acquire_cred_impersonate_name

Checking for the generic gss_acquire_cred() function is no guarantee
that gss_acquire_cred_impersonate_name() is also implemented.

[ghudson@mit.edu: edit commit message]

(cherry picked from commit 46a4e225d2ecaa4077aa65f12f64273bf4911d3a)

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

9 years agoFix SPNEGO context aliasing bugs [CVE-2015-2695]
Nicolas Williams [Mon, 14 Sep 2015 16:27:52 +0000 (12:27 -0400)] 
Fix SPNEGO context aliasing bugs [CVE-2015-2695]

The SPNEGO mechanism currently replaces its context handle with the
mechanism context handle upon establishment, under the assumption that
most GSS functions are only called after context establishment.  This
assumption is incorrect, and can lead to aliasing violations for some
programs.  Maintain the SPNEGO context structure after context
establishment and refer to it in all GSS methods.  Add initiate and
opened flags to the SPNEGO context structure for use in
gss_inquire_context() prior to context establishment.

CVE-2015-2695:

In MIT krb5 1.5 and later, applications which call
gss_inquire_context() on a partially-established SPNEGO context can
cause the GSS-API library to read from a pointer using the wrong type,
generally causing a process crash.  This bug may go unnoticed, because
the most common SPNEGO authentication scenario establishes the context
after just one call to gss_accept_sec_context().  Java server
applications using the native JGSS provider are vulnerable to this
bug.  A carefully crafted SPNEGO packet might allow the
gss_inquire_context() call to succeed with attacker-determined
results, but applications should not make access control decisions
based on gss_inquire_context() results prior to context establishment.

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

[ghudson@mit.edu: several bugfixes, style changes, and edge-case
behavior changes; commit message and CVE description]

(cherry picked from commit b51b33f2bc5d1497ddf5bd107f791c101695000d)
(cherry picked from commit 31fb730f1ad708f230e4387e02ed2f89b93c3607)

ticket: 8282 (new)
subject: SPNEGO and IAKERB context aliasing bugs [CVE-2015-2695][CVE-2015-2696]
version_fixed: 1.13.3

9 years agoFix krb5_rd_req() memory leak
Nicolas Williams [Tue, 1 Sep 2015 15:58:30 +0000 (11:58 -0400)] 
Fix krb5_rd_req() memory leak

In release 1.13, commit eba8c4909ec7ba0d7054d5d1b1061319e9970cc7
(ticket #7232) introduced a memory leak when skipping keytab entries
which do not match the application-provided server specification.  Fix
it by freeing the keytab entry before continuing the loop on a failure
to match.

[ghudson@mit.edu: commit message]

(cherry picked from commit 3aa8506ee9e1f564e3f396eed5ac5616d7c54b34)

ticket: 8239
version_fixed: 1.13.3
status: resolved

9 years agoFix error handling in gss_export_sec_context()
Nicolas Williams [Tue, 1 Sep 2015 23:42:58 +0000 (19:42 -0400)] 
Fix error handling in gss_export_sec_context()

In the mechglue gss_export_sec_context(), make sure to delete the
union context if the underlying mech context has been deleted.  This
can happen if the mech's gss_export_sec_context() returns a failure
and deletes the context (not a behavior exhibited by any of our
in-tree mechanisms, but an allowed behavior for other mechs), or if we
fail to allocate space for the wrapped token.

[ghudson@mit.edu: commit message; rename exit label to "cleanup" and
make it valid for all exit cases]

(cherry picked from commit 4f35b27a9ee38ca0b557ce8e6d059924a63d4eff)

ticket: 8240
version_fixed: 1.13.3
status: resolved

9 years agoFix KDC client referrals
Greg Hudson [Thu, 3 Sep 2015 16:38:44 +0000 (12:38 -0400)] 
Fix KDC client referrals

Although our built-in KDB modules do not support client referrals for
AS requests, the KDC is supposed to return one if a third-party module
returns a DB entry containing a principal in a foreign realm.
Unfortunately, this code has never worked; in prepare_error_as(), we
erroneously compare the protocol code errcode against the com_err code
KRB5KDC_ERR_WRONG_REALM; as a result, we never supply the canonical
client principal.  Fix this by comparing errcode against the protocol
code KDC_ERR_WRONG_REALM instead.

Discovered by Alexander Bokovoy and Simo Sorce.

(cherry picked from commit 4e036ef4127a9b09d1a567472da1df24c55cdb89)

ticket: 8241
version_fixed: 1.13.3
status: resolved

9 years agoCheck for null name_type in gss_display_name_ext
Solly Ross [Thu, 27 Aug 2015 19:55:35 +0000 (15:55 -0400)] 
Check for null name_type in gss_display_name_ext

It is possible for the input name's name_type to be GSS_C_NO_OID.
g_OID_equal() does not account for GSS_C_NO_OID, so we have to
manually check before use to prevent null pointer dereferences.

(cherry picked from commit 3fdf09ac9a36581b47f40c9d177e463cc12687ff)

ticket: 8238
version_fixed: 1.13.3
status: resolved

9 years agoFix gss_inquire_name() name_is_MN result
Isaac Boukris [Wed, 12 Aug 2015 23:28:36 +0000 (02:28 +0300)] 
Fix gss_inquire_name() name_is_MN result

Currently name_is_MN is left uninitialized for non-mechanism names due
to a typo.

[ghudson@mit.edu: edited commit message]

(cherry picked from commit a3f3f4069858ea795b732ec1d96fae20d5fafe24)

ticket: 8232
version_fixed: 1.13.3
status: resolved

9 years agoDo not allow stream socket retries in libkrad
Nathaniel McCallum [Fri, 7 Aug 2015 19:35:58 +0000 (15:35 -0400)] 
Do not allow stream socket retries in libkrad

Before this patch, libkrad would follow the same exact logic for all
socket types when the retries parameter was non-zero.  This meant that
when connecting with SOCK_STREAM, multiple requests were sent in case
of packet drops, which, of course, cannot happen for SOCK_STREAM.

Instead, just disable retries for SOCK_STREAM sockets.

[ghudson@mit.edu: minor wording edits]

(cherry picked from commit 25e0656fdf9862faf9aa91288023776e9a47caad)

ticket: 8229
version_fixed: 1.13.3
status: resolved

9 years agoFix uncommon leak in krb5_init_creds_step()
Greg Hudson [Sun, 26 Jul 2015 17:21:47 +0000 (13:21 -0400)] 
Fix uncommon leak in krb5_init_creds_step()

Release any previous value of ctx->err_padata before setting it in
init_creds_step_reply().  It could have a prior value after a realm
referral or retriable error.

(cherry picked from commit 997eb174f5fd81747ad0ecb671f00c25951931b1)

ticket: 8223
version_fixed: 1.13.3
status: resolved

9 years agoDocument multi-component profile paths
Greg Hudson [Thu, 23 Oct 2014 19:06:13 +0000 (15:06 -0400)] 
Document multi-component profile paths

In env_variables.rst and krb5_conf.rst, document that KRB5_CONFIG can
contain multiple colon-separated pathnames.

(cherry picked from commit 28dc817d2a065f5e0ab73377350a0529b2f4aa48)

ticket: 8031
version_fixed: 1.13.3
status: resolved

9 years agoFix uncommon null dereference in PKINIT client
Greg Hudson [Fri, 3 Jul 2015 23:34:46 +0000 (19:34 -0400)] 
Fix uncommon null dereference in PKINIT client

crypto_retrieve_cert_sans() is allowed to set its princs output to
NULL, although the OpenSSL implementation rarely does.  Fix the
TRACE_PKINIT_CLIENT_SAN_KDCCERT_PRINC for loop to allow this like other
parts of the function do, and also get rid of the unnecessary princptr
variable by using an integer index like other parts of the function.

Based on a patch from Daniel Deptula.

(cherry picked from commit 47b37b9e13ca1456ba6710f31bc41012d050dd07)

ticket: 8214
version_fixed: 1.13.3
status: resolved

9 years agoFix leak in gss_acquire_cred_with_password
Greg Hudson [Fri, 19 Jun 2015 21:16:52 +0000 (17:16 -0400)] 
Fix leak in gss_acquire_cred_with_password

The target_mechs array needs to be freed on successful return.

(cherry picked from commit 02a85d73c4548d27dcbc1c1681b4bf1370b03632)

ticket: 8204
version_fixed: 1.13.3
status: resolved

10 years agoUpdate KfW copyright
Ben Kaduk [Thu, 25 Jun 2015 19:28:29 +0000 (15:28 -0400)] 
Update KfW copyright

This probably should not be a hardcoded string, but we can at
least make it correct for now.

(cherry picked from commit 27e6ab7e5b6a0538f529f440aeb967822eff8f57)

ticket: 8212
version_fixed: 1.13.3
status: resolved

10 years agoBack to krb5-1.3.2-postrelease
Ben Kaduk [Wed, 24 Jun 2015 21:27:54 +0000 (17:27 -0400)] 
Back to krb5-1.3.2-postrelease

10 years agoBump buildlevel for non-MIT KfW 4.1-beta2 kfw-4.1-beta2
Ben Kaduk [Wed, 24 Jun 2015 21:24:33 +0000 (17:24 -0400)] 
Bump buildlevel for non-MIT KfW 4.1-beta2

10 years agoReady for KfW 4.1 beta 2
Ben Kaduk [Wed, 24 Jun 2015 21:24:10 +0000 (17:24 -0400)] 
Ready for KfW 4.1 beta 2

Bump versions as needed.

10 years agoTolerate null oid pointer in gss_release_oid()
Greg Hudson [Wed, 10 Jun 2015 23:48:51 +0000 (19:48 -0400)] 
Tolerate null oid pointer in gss_release_oid()

Under some circumstances, gss_inquire_name() can call
gss_release_oid() with a null oid pointer, which currently causes a
null dereference.  The least invasive fix is for gss_release_oid() to
check for the invalid null pointer and return an error, like other
GSS-API functions do.

(cherry picked from commit 4676e823e6ee9a5731872b31c5588c1b5932e0a3)

ticket: 8201
version_fixed: 1.13.3
status: resolved

10 years agoFix bindresvport_sa port byte swap bug
Greg Hudson [Tue, 19 May 2015 14:38:51 +0000 (10:38 -0400)] 
Fix bindresvport_sa port byte swap bug

The sa_setport() helper handles conversion to network byte order, so
bindresvport_sa() should not itself call htons() on the port argument.

(This bug was introduced in commit
0d04b60d159ab83b943e43802b1449a3b074bc83 when adding
bindresvport_sa().  It was my fault, not Andreas Schneider's.)

(cherry picked from commit 5c6d218e385755766ff427b3e707510f0ce175c5)

ticket: 8197
version_fixed: 1.13.3
status: resolved

10 years agoMake the Principal column wider by default
Ben Kaduk [Wed, 24 Jun 2015 17:34:32 +0000 (13:34 -0400)] 
Make the Principal column wider by default

The current 100-pixel default is too small to fit most principal
names (particularly the realm).  There is no reason why all the
columns must be the same width, so promote this one as needing
more space.

(cherry picked from commit d376d5948d2af7dcf60368bc3b6fe6c23172a831)

ticket: 8211
version_fixed: 1.13.3
status: resolved

10 years agoMake registry hostrealm module highest precedence
Ben Kaduk [Tue, 23 Jun 2015 14:38:19 +0000 (10:38 -0400)] 
Make registry hostrealm module highest precedence

Testing reveals that there are a number of machines in the wild
which retain old krb5.ini files across domain configuration changes,
and it is difficult to determine which machines are potentially
affected by incorrect stale configuration data.

To enable domain administrators to easily ensure that the correct
default realm is set, allow the registry hostrealm module to take
precedence over the profile.

Note that the registry hostrealm module can still be disabled
in the hostrealm interface configuration statment in the
[plugins] section of the profile.

(cherry picked from commit 287b8eae295a3ab496b04b327840e92c235efd1a)

ticket: 8209
version_fixed: 1.13.3
status: resolved

10 years agoStop using the WiX src attribute
Ben Kaduk [Fri, 29 May 2015 18:46:58 +0000 (14:46 -0400)] 
Stop using the WiX src attribute

The src attribute has been deprecated for a while in favor of
different (more descriptive) attributes for the different XML
elements involved.

For the File element, use the Source attribute.
For the Directory element, use the FileSource attribute.
For the Merge, Binary, and Text elements, use the SourceFile attribute.

This makes the installer build much quieter, with the warnings from
the light.exe invocation all fitting into the default history buffer.

(cherry picked from commit 0e025dd9bd64169a2acf5c9bea7a17eec7b37a13)

ticket: 8208
version_fixed: 1.13.3
status: resolved

10 years agoStop using the WiX Registry element
Ben Kaduk [Wed, 27 May 2015 19:36:51 +0000 (15:36 -0400)] 
Stop using the WiX Registry element

It is deprecated in favor of more specific XML elements such
as RegistryKey, RegistryValue, and RemoveRegistryKey, so as to
stop overloading a single element for what are fundamentally
different types and operations.

RegistryValue elements can be children of RegistryKey elements,
allowing the Key attribute to be inherited, or bare within the
containing Component.  We do not take advantage of the inheritance
at this time, since that would be a more disruptive change.

WiX would prefer for us to not use the createAndRemoveOnUninstall
attribute of <RegistryKey>, in favor of ForceCreateOnInstall
and/or ForceRemoveOnUninstall, but that can wait for a follow-up
commit.

Some instances of <Registry> were commented-out and can simply be
removed.

Some of the <Registry> elements used to create keys were also
setting the KeyPath attribute, which is not permitted in the
<RegistryKey> element.  According to
http://sourceforge.net/p/wix/bugs/3197/ , this should never have
been allowed, and non-value registry keys should not be used as
MSI KeyPaths.  In all affected cases, there are child
RegistryValue elements that are suitable for use as KeyPath
elements instead.

Some of the <Registry> elements were present with a duplicate
element with different Id that added no new attributes; those
duplicate elements can safely be removed.

<RemoveRegistryKey> is used to replace <Registry> elements
with Action=removeKeyOnInstall.

(cherry picked from commit 280a4b1125743bae3bf05af266131e2a524c8adf)

ticket: 7392
version_fixed: 1.13.3
status: resolved

10 years agoPut focus on password field when principal is set
Ben Kaduk [Mon, 22 Jun 2015 23:11:28 +0000 (19:11 -0400)] 
Put focus on password field when principal is set

In the Leash "Get Ticket" window, under some user-customized
configurations, the principal field can be pre-populated.  In this case,
it makes sense for the default focus to be on the password field,
since most users will only be using a single principal and should
go directly to typing their password.

The focus was already set to the password field in the case when
the principal was not modifiable (such as when the "Get Ticket" dialog
was opened by an application requesting a specific ticket).

(cherry picked from commit 50b3bba748084c99a339bd526ad47ecfccc09472)

ticket: 8032
version_fixed: 1.13.3
status: resolved

10 years agoAdd leash column for the ccache name
Ben Kaduk [Fri, 22 May 2015 18:38:27 +0000 (14:38 -0400)] 
Add leash column for the ccache name

Previously, it was fairly easy to set the default cache to MSLSA:,
which is not collection-enabled (as opposed to the normal default
of API:, which is), and the non-collection behavior proved confusing
to many users.

Ideally there would be an option to choose the output ccache in
the "Get Ticket" window, but that is more complicated to implement
than just a display of what cache a given ticket is in.  This
extra display column should still help to alleviate user confusion.

(cherry picked from commit b26d25e97cf3c53ef896092c71948011ceac645d)

ticket: 8207
version_fixed: 1.13.3
status: resolved

10 years agoMake ribbon home tab more pretty
Ben Kaduk [Fri, 22 May 2015 18:42:02 +0000 (14:42 -0400)] 
Make ribbon home tab more pretty

In the absence of a label title for a given command group, the
text "MS Shell Dlg" was inserted, which is somewhat confusing to
the user.  Give the ticket-maniuplation group a title consisting
of a space, which removes the confusing text from the display.

(cherry picked from commit bfba2d235370a3902faeeaad8a54d8a2dcc3427b)

ticket: 8206
version_fixed: 1.13.3
status: resolved

10 years agoCorrect CSAIL KDC names
Ben Kaduk [Fri, 15 May 2015 16:09:35 +0000 (12:09 -0400)] 
Correct CSAIL KDC names

CSAIL and ATHENA are served from different KDCs.

(cherry picked from commit 1b07396924dc4c222ddb6adec415cb53827dbe25)

ticket: 8196
version_fixed: 1.13.3
status: resolved

10 years agoBack to krb5-1.13.2-postrelease
Tom Yu [Fri, 15 May 2015 19:54:26 +0000 (15:54 -0400)] 
Back to krb5-1.13.2-postrelease

10 years agoBump buildlevel for non-MIT KfW 4.1-beta1 kfw-4.1-beta1
Ben Kaduk [Tue, 12 May 2015 15:22:27 +0000 (11:22 -0400)] 
Bump buildlevel for non-MIT KfW 4.1-beta1

10 years agoReady for KfW 4.1 beta 1
Ben Kaduk [Tue, 5 May 2015 21:31:26 +0000 (17:31 -0400)] 
Ready for KfW 4.1 beta 1

Bump versions as needed.

10 years agoReboot after KfW installs to help the LSA cache
Ben Kaduk [Mon, 11 May 2015 17:08:42 +0000 (13:08 -0400)] 
Reboot after KfW installs to help the LSA cache

It seems that we need to restart in order to be able to query the
contents of the the LSA cache, even if the only contents of the LSA
cache are what we put there, and even if the Microsoft klist.exe
correctly reports the presence of tickets in the LSA cache.

(cherry picked from commit 50a3c3cbeab32577fba2b21deb72a64015c48ec7)

ticket: 8176
version_fixed: 1.13.3
status: resolved

10 years agoBump KRB5_MINOR_RELEASE for windows
Ben Kaduk [Tue, 5 May 2015 21:08:04 +0000 (17:08 -0400)] 
Bump KRB5_MINOR_RELEASE for windows

Future releases will come from the KfW 4.1.x. series.

(cherry picked from commit 770196087b12affc08591aa0ff7fa78658f467ab)

ticket: 8174
version_fixed: 1.13.3
status: resolved

10 years agoSupply a hostrealm module to query the registry
Ben Kaduk [Tue, 5 May 2015 20:55:41 +0000 (16:55 -0400)] 
Supply a hostrealm module to query the registry

Implement a default_realm function that checks the
{HKLM,HKCU}\Software\MIT\Kerberos5\default_realm registry values
on Windows, and just returns KRB5_PLUGIN_NO_HANDLE on Unix.

(cherry picked from commit 90ca670ac42a9aada3c310af491bbf8b924e6a00)

ticket: 8173
version_fixed: 1.13.3
status: resolved

10 years agoDo not set allow_weak_crypto for KfW
Ben Kaduk [Wed, 11 Mar 2015 20:38:10 +0000 (16:38 -0400)] 
Do not set allow_weak_crypto for KfW

The MIT-internal users no longer need this crutch.

(cherry picked from commit f0cd1a65e379dd21cdb565beed9e2d8917d1a701)

ticket: 8178
version_fixed: 1.13.3
status: resolved

10 years agoFix loop to determine MSLSA principal name
Ben Kaduk [Fri, 6 Mar 2015 20:42:10 +0000 (15:42 -0500)] 
Fix loop to determine MSLSA principal name

When looping over principals, check the i-th entry instead of
looking at the 0-th entry each time through the loop.  This would
only affect cases when multiple ticket entries were returned from
the LSA, the first one did not have a valid principal name, but
some other one did.  It is expected that all of the returned
ticket entries will always have a valid client principal name, so
this is unlikely to cause any functional difference.

(cherry picked from commit d7dc6c347e352324e374b3456f60e49aa4b8ba08)

ticket: 8177
version_fixed: 1.13.3
status: resolved

10 years agoKfW shortcuts for make default, change password
Ben Kaduk [Wed, 5 Dec 2012 17:15:07 +0000 (12:15 -0500)] 
KfW shortcuts for make default, change password

Shortcut keys such as these (in the ACCELERATORS entry in the resource
file) are what let users type, e.g., ctrl-t to get to the "get tickets"
dialog directly from the main frame.  We had shortcut keys for all the
other buttons already, so add these to complete the set.

The make default and change password functionality were already available
using keyboard-only interfaces via the ribbon access keys (tap alt,
then letters to walk through the tree of controls), but the two forms
of keyboard access are implemented differently.

(cherry picked from commit 3321375cf3830a4702fdea3781a07f9dde059edc)

ticket: 7442
version_fixed: 1.13.3
status: resolved

10 years agoRemove (old) consolidated ribbon bitmaps
Ben Kaduk [Thu, 16 Apr 2015 22:32:34 +0000 (18:32 -0400)] 
Remove (old) consolidated ribbon bitmaps

We are no longer using the MFC ribbon, so these resources
are now unused.  Garbage-collect them accordingly.

(cherry picked from commit 0fdbfb1891713b8ff91acba37dfb17b937929a71)

ticket: 8192
version_fixed: 1.13.3
status: resolved

10 years agoRemove another lingering Leash reference
Ben Kaduk [Thu, 16 Apr 2015 22:23:13 +0000 (18:23 -0400)] 
Remove another lingering Leash reference

Be consistent with the MIT Kerberos brand.

(cherry picked from commit 58122fec56a87ca7f88052f6b55f90b94ce1c386)

ticket: 8191
version_fixed: 1.13.3
status: resolved

10 years agoSwitch to Windows SDK Ribbon from MFC Ribbon
Ben Kaduk [Fri, 10 Apr 2015 21:33:40 +0000 (17:33 -0400)] 
Switch to Windows SDK Ribbon from MFC Ribbon

The MFC Ribbon implementation is not very accessible (e.g., to
screen reading software), whereas the windows ribbon provides
essentially the same functionality and good integration with
screen reading software, including the built-in Windows Narrator.

Remove the RT_RIBBON_XML resource from the resource file and
replace it with an inclusion of the generated kfwribbon.rc file.
Also remove the ribbon1.mfcribbon-ms ribbon description from the
res/ directory.  Add the appropriate dependency relation in the
Makefile.

LeashUIApplication implements the IUIUApplication interfaces.  It
appears to be difficult to cleanly tear down the underlying
IUIFramework and ribbon, since the WM_DESTROY event is handled by the
parent MFC window, which will not call IUIFramework::Destroy().
Manually inserting a call to IUIFramework::Destroy() in the shutdown
handling of the MFC classes is difficult, since the WM_DESTROY message
is handled by a different window than where the ribbon is initialized,
and the MFC framework will attempt to access window objects
corresponding to the UI Ribbon resources after they are destroyed,
which raises exceptions.  It seems best to just go without destroying
the IUIFramework, since its lifecycle matches that of the application
and there will be no leaks during the application lifecycle.

LeashUICommandHandler implements the IUICommandHandler interfaces,
passing messages through to the existing MFC handlers, though the
default values for the various checkbox controls must be duplicated.

The (MFC) CMainFrame creates and maintains a handle to the
LeashUIApplication associated with the ribbon it creates, so that
it can query the height of the ribbon and redraw when the
LeashUIApplication signals that the ribbon size has changed.

Record that the added object files depend on kfwribbon.h, so that
the XML markup is compiled sufficiently early in the build.

(cherry picked from commit fa5edf1e72b142f14d36b7eb304f55066c5af2f9)

ticket: 8192
version_fixed: 1.13.3

10 years agoMention Visual Studio 2010 SP1 in windows README
Ben Kaduk [Thu, 19 Mar 2015 18:14:02 +0000 (14:14 -0400)] 
Mention Visual Studio 2010 SP1 in windows README

The service pack is needed to avoid a linker error due to an
issue with the cvtres.exe utility, which manifests as
LINK: fatal error LNK1123: failure during conversion to COFF: file
invalid or corrupt.

(cherry picked from commit 025008dd215c20f804823dafa3bd9f45135be53e)

ticket: 8192
version_fixed: 1.13.3

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