]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
9 years agoHarmonize struct packing for gic_opt.c 407/head
Tom Yu [Wed, 17 Feb 2016 20:58:24 +0000 (15:58 -0500)] 
Harmonize struct packing for gic_opt.c

struct extended_options in gic_opt.c extends krb5_get_init_creds_opt.
On Mac OS X, for historical reasons, we define krb5_get_init_creds_opt
with an alignment/packing of 2, conflicting with the compiler default.
This results in alignment change warnings from clang on Mac OS X.
Ensure that extended_options has the same packing.

9 years agoAdd support for IP_SENDSRCADDR for UDP pktinfo
Sarah Day [Thu, 11 Feb 2016 20:39:04 +0000 (15:39 -0500)] 
Add support for IP_SENDSRCADDR for UDP pktinfo

FreeBSD uses IP_RECVDSTADDR and IP_SENDSRCADDR instead of IP_PKTINFO
for IPv4 pktinfo functionality.  Add support for using this when
IP_PKTINFO is not available.

9 years agoRefactor pktinfo code
Sarah Day [Wed, 10 Feb 2016 19:48:44 +0000 (14:48 -0500)] 
Refactor pktinfo code

Move preprocessor conditionals outside of functions and simplify
preprocessor statements in udppktinfo.c.

9 years agoMove pktinfo functions into a new file
Sarah Day [Wed, 10 Feb 2016 17:42:47 +0000 (12:42 -0500)] 
Move pktinfo functions into a new file

Move the functions set_pktinfo(), recv_from_to(), and send_to_from()
out of net_server.c into a new file udppktinfo.c.  The function
setup_udp_pktinfo_ports() will now always try to set the pktinfo
option for the socket on UDP wildcard sockets, and will fallback to
binding to the individual addresses at runtime when pktinfo isn't
supported.

9 years agoUse public OID for interposing several functions
Robbie Harwood [Tue, 12 Jan 2016 20:59:49 +0000 (15:59 -0500)] 
Use public OID for interposing several functions

This resolves an issue where an interposer would receive the private
OID, and be unable to call back into krb5 in the expected manner in
gss_inquire_names_for_mech(), gss_inquire_cred_by_mech(),
gss_localname(), gss_store_cred(), and gss_store_cred_into().

Also change the return code of gss_localname() to GSS_S_BAD_MECH
instead of GSS_S_UNAVAILABLE on mech lookup failure, for consistency
with other functions.

ticket: 8360 (new)

9 years agoEnable interposing gss_inquire_saslname_for_mech
Robbie Harwood [Tue, 12 Jan 2016 16:13:09 +0000 (11:13 -0500)] 
Enable interposing gss_inquire_saslname_for_mech

The behavior of gss_inquire_saslname_for_mech() changes slightly, to
report GSS_S_BAD_MECH when an unsupported mech oid is given.  Also
call map_error() on the minor code resulting from the mech.

Note that gss_inquire_mech_for_saslname() cannot be interposed, as
mech_type is specified as output-only in RFC 5801.

ticket: 8359 (new)

9 years agoReport inquire_attrs_for_mech mech failures
Robbie Harwood [Wed, 27 Jan 2016 23:48:04 +0000 (18:48 -0500)] 
Report inquire_attrs_for_mech mech failures

Previously, gss_inquire_attrs_for_mech() would return a list of mech
attributes that it knew about when given a bad mech oid or a mechanism
which did not provide a gss_inquire_attrs_for_mech() method.  It seems
more useful to just report the failure to the application rather than
allowing it to continue with a faulty mechanism.

ticket: 8358 (new)

9 years agoEnable interposing gss_inquire_attrs_for_mech()
Robbie Harwood [Mon, 11 Jan 2016 22:50:39 +0000 (17:50 -0500)] 
Enable interposing gss_inquire_attrs_for_mech()

Use gssint_select_mech_type() to locate an interposer mechanism, and
pass the public mech OID to the mech.  Also call map_error() on the
resulting minor code.

ticket: 8330 (new)

9 years agoRemove form feed characters 405/head
Greg Hudson [Fri, 12 Feb 2016 16:19:44 +0000 (11:19 -0500)] 
Remove form feed characters

Some older code in the tree uses form feed characters.  kdevelop does
not appear to preserve them, and it is not our current practice to use
them, so get rid of them in almost all files under src.  Leave alone
lib/gssapi/krb5/3des.txt, which is a formatted internet draft.

9 years agoFix populate_krb5_db_entry() princ_ent init 401/head
Greg Hudson [Thu, 4 Feb 2016 22:36:16 +0000 (17:36 -0500)] 
Fix populate_krb5_db_entry() princ_ent init

The most recent commit introduced a new variable princ_ent in
populate_krb5_db_entry().  princ_ent is cleaned up by the function's
cleanup label, so it must be initialized before any "goto cleanup"
statements.

ticket: 5889

9 years agoImplement password history in LDAP KDB module
Sarah Day [Tue, 26 Jan 2016 17:22:41 +0000 (12:22 -0500)] 
Implement password history in LDAP KDB module

The password history is stored in the kerberos LDAP schema attribute
'krbPwdHistory', with one history entry per attribute.  When the
history is decoded, the history entries are sorted by kvno with the
next replacement key set to the end of the list.  Based on a patch
from Tomas Kuthan.

ticket: 5889

9 years agoOnly store latest keys in key history entry
Sarah Day [Thu, 21 Jan 2016 16:17:12 +0000 (11:17 -0500)] 
Only store latest keys in key history entry

If a password is changed with the -keepold option, then changed again,
the history entry contains both the latest password and the one that
was kept.  Fix create_history_entry to only store the latest kvno in
the history entry.  Also add a test to ensure that the bug is fixed.

ticket: 8354

9 years agoSort principal key_data retrieved from KDB module
Sarah Day [Thu, 21 Jan 2016 16:16:21 +0000 (11:16 -0500)] 
Sort principal key_data retrieved from KDB module

Some krb5 code expects principal keys to be sorted by kvno in
descending order.  To make sure this is followed in all KDB
implementations, sort the keys in libkdb5 after principals are
retrieved.

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

ticket: 8343 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

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

ticket: 8342 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

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

ticket: 8341 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

9 years agoReplace MD5 use in rcache with SHA-256
Tomas Kuthan [Wed, 30 Dec 2015 13:10:32 +0000 (14:10 +0100)] 
Replace MD5 use in rcache with SHA-256

The rcache implementation uses an unkeyed MD5 hash of the
authenticator to distinguish between different requests with equal
client principal, server principal, and microsecond time.  When the
OpenSSL crypto provider is used and the underlying OpenSSL library is
run in FIPS mode, the MD5 algorithm is disabled and
gss_accept_sec_context() results in an abort in rcache processing.

This change effectively implements a different rcache extension.
The new extension identifier is 'SHA256:' (instead of 'HASH:')
and the new has algorithm is SHA-256.

ticket: 8353 (new)

9 years agoAdd internal SHA-256 interface 392/head
Greg Hudson [Tue, 12 Jan 2016 17:46:03 +0000 (12:46 -0500)] 
Add internal SHA-256 interface

Add a simple private libk5crypto interface for computing SHA-256
hashes.

9 years agoRemove nss libk5crypto implementation 390/head
Greg Hudson [Tue, 12 Jan 2016 17:08:58 +0000 (12:08 -0500)] 
Remove nss libk5crypto implementation

Delete the nss libk5crypto implementation because: (1) the original
contributor no longer requires it; (2) as far as we know it is rarely
or never used; (3) NSS has significant impedance mismatch with MIT
krb5's requirements, such as the inability to preserve crypto state
across fork(); (4) NSS cannot do PBKDF2 with SHA-256 or SHA-384, as
will be required for the aes-sha2 enctypes.

ticket: 8345 (new)

9 years agoFix ksetpwd password reading loop 397/head
Greg Hudson [Thu, 14 Jan 2016 23:03:40 +0000 (18:03 -0500)] 
Fix ksetpwd password reading loop

In ksetpwd (which we do not install), fix the loop which reads the new
password twice until they match.  Previously it would stop with a
dangling pointer to freed memory in new_password if they don't match
on the first try.  Reported by Will Fiveash.

9 years agoFix iprop server stub error management 396/head
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.

ticket: 8347 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

9 years agoWork around uninitialized warning in logger.c 395/head
Greg Hudson [Thu, 14 Jan 2016 17:24:31 +0000 (12:24 -0500)] 
Work around uninitialized warning in logger.c

gcc 4.6.3 erroneously detects uninitialized use of the variable f
after commit 9914b93516bbce9b1123ed5f9f796b7028944892.  Initialize it
to work around this warning.

ticket: 8344

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]

ticket: 8346 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

9 years agoCreate KDC and kadmind log files with mode 0640
Robbie Harwood [Thu, 17 Dec 2015 18:31:39 +0000 (13:31 -0500)] 
Create KDC and kadmind log files with mode 0640

In krb5_klog_init(), use open() and fdopen() to open log files so that
we can specify a mode.  Specify a mode which doesn't include the
group-write, other-read, or other-write bits even if the process umask
allows them.

[ghudson@mit.edu: wrote commit message, de-indented post-open setup
code]

ticket: 8344 (new)

9 years agoImprove type safety of SPNEGO helper functions 351/head
Greg Hudson [Wed, 6 Jan 2016 16:31:07 +0000 (11:31 -0500)] 
Improve type safety of SPNEGO helper functions

Modify init_ctx_new(), init_ctx_cont(), acc_ctx_hints(),
acc_ctx_new(), and acc_ctx_cont() to operate on SPNEGO context handles
rather than generic GSS context handles.  For the functions which
create a new context, move the context parameter to the end and follow
the usual practices for output parameters.  Adjust stage 1 flow
control in spnego_gss_accept_sec_context() to allow acc_ctx_new() to
always be a context constructor.

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.

ticket: 8281 (new)
target_version: 1.14.1
tags: pullup

9 years agoMake ksu work with prompting clpreauth modules 389/head
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.

ticket: 8340
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

9 years agoAdd .travis.yml 388/head
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.

9 years agoFix interposed gss_accept_sec_context()
Robbie Harwood [Thu, 17 Dec 2015 00:31:22 +0000 (19:31 -0500)] 
Fix interposed gss_accept_sec_context()

If gss_accept_sec_context() is interposed, selected_mech will be an
interposer OID.  In this situation, pass the corresponding public OID
to gss_inquire_attrs_for_mech() to determine whether the mech is
allowed by default.

[ghudson@mit.edu: pared down from larger commit; rewrote commit message]

ticket: 8338 (new)
target_version: 1.14-next
tags: pullup

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]

ticket: 8337 (new)
target_version: 1.14-next
target_version: 1.13-next
tags: pullup

9 years agoIncrease hostname length in ipropd_svc.c 387/head
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.

ticket: 8336

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.

ticket: 8336 (new)
subject: MAXHOSTNAMELEN is too short for some FQDNs

9 years agoWork around uninitialized warning in cc_kcm.c 386/head
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.

ticket: 8335 (new)

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 agomake update-po
Tom Yu [Mon, 4 Jan 2016 20:12:13 +0000 (15:12 -0500)] 
make update-po

9 years agoUpdate man pages
Tom Yu [Mon, 4 Jan 2016 20:10:15 +0000 (15:10 -0500)] 
Update man pages

9 years agomake depend
Tom Yu [Mon, 4 Jan 2016 20:09:20 +0000 (15:09 -0500)] 
make depend

9 years agoAdd tests for UTF-8 conversions 379/head
Tom Yu [Wed, 23 Dec 2015 21:49:24 +0000 (16:49 -0500)] 
Add tests for UTF-8 conversions

9 years agoModernize UTF-8 conversions
Tom Yu [Tue, 22 Dec 2015 21:55:07 +0000 (16:55 -0500)] 
Modernize UTF-8 conversions

Unicode and ISO/IEC 10646 now agree that the maximum valid code point
is U+10FFFF.  (Unicode 8.0 Appendix C.2 implies that ISO/IEC
10646:2011 aligned the extent of the code space.)

Adjust src/util/support/utf8.c accordingly, mostly by
deleting code.

Also delete the unused macro KRB5_UCS_UTF8LEN().

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.

ticket: 8334 (new)
target_version: 1.14-next
target_version: 1.13-next
target_version: 1.12-next
tags: pullup

9 years agoAdd Github provided OS and IDE files to .gitignore 377/head
Sarah Day [Mon, 21 Dec 2015 19:29:18 +0000 (14:29 -0500)] 
Add Github provided OS and IDE files to .gitignore

It is a good idea to have a fairly complete .gitignore file.  It is
helpful for devs to know just what shouldn't end up in the repo, as
well as preventing accidental commits and even random trash ending up
in master.

Many of the files here added from the Github gitignore project
found here:

https://github.com/github/gitignore

9 years agoSearch for LDAP core schema in t_kdb.py
Sarah Day [Fri, 4 Dec 2015 17:36:33 +0000 (12:36 -0500)] 
Search for LDAP core schema in t_kdb.py

The t_kdb.py python test was hardcoded to search for the LDAP
core.schema file in a single place.  OpenLDAP can be installed in more
than one place.  Add a check which looks in several of these common
installation locations to find the core schema file.

9 years agoFix a typo that causes the jsonwalker test to fail
Sarah Day [Fri, 4 Dec 2015 15:54:50 +0000 (10:54 -0500)] 
Fix a typo that causes the jsonwalker test to fail

In the au_dict.json file that is used for testing jsonwalker, there is
a comma missing that causes cjson 1.1 to throw an exception.  This
causes the python tests to fail.  Adding the comma fixes the crash and
allows the test to finish successfully.

ticket: 8297

9 years agoSet kdc_tcp_ports in kadmin test configuration
Sarah Day [Tue, 22 Dec 2015 21:33:24 +0000 (16:33 -0500)] 
Set kdc_tcp_ports in kadmin test configuration

The kadmin tests were starting the KDC without setting the TCP port
number.  After commit 8d88e2ab00be126237569dc72827ced2ce6b7d04, the
TCP port defaults to 88, causing the socket to fail setup if the test
is not run as root.

[ghudson@mit.edu: edited commit message]

9 years agoOnly run export-check.pl in maintainer mode 373/head
Tom Yu [Thu, 17 Dec 2015 21:13:33 +0000 (16:13 -0500)] 
Only run export-check.pl in maintainer mode

Cross compilation environments might not be using the default nm
command.  Rather than try to communicate the correct value to
util/export-check.pl, only run export-check.pl in maintainer mode.

ticket: 8329 (new)

9 years agoRemove util/reconf 374/head
Tom Yu [Thu, 17 Dec 2015 22:42:05 +0000 (17:42 -0500)] 
Remove util/reconf

The bulk of the util/reconf script is to detect old versions of
autoconf and possibly work around bugs in them.  Require
autoconf>=2.63, and remove the util/reconf script.  Adjust
documentation and other scripts accordingly.

Also remove Makefile rules that remove autom4te.cache.  Such rules
were supposedly necessary when mixing of different versions of
autoconf was common; this seems to be less of an issue now.

ticket: 8299
subject: Remove util/reconf

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.

ticket: 8326
target_version: 1.14-next
tags: pullup

9 years agoAdd IPv6 address logging support to audit plugin
Sarah Day [Mon, 7 Dec 2015 18:48:22 +0000 (13:48 -0500)] 
Add IPv6 address logging support to audit plugin

The jsonwalker.py test was failing due to the audit plugin only
logging the IP for IPv4.  The audit plugin should log the IP address
for both IPv4 and IPv6.  Rename the JSON "ipv4" field in the
"fromaddr" JSON object to "ip" and set the field if either an IPv4 or
an IPv6 address is present.  Any parsers of the audit log can tell
which address is stored in the "ip" field by checking the "type" field
in "fromaddr".  Also update the jsonwalker.py reference JSON file,
au_dict.json, to handle this new field name.

old audit:

{"fromaddr":{"type":<int>,"length":<int>,"ipv4":[<4 int>]}

where "ipv4" only occurs when type is ADDRTYPE_INET

new audit:

{"fromaddr":{"type":<int>,"length":<int>,"ip":[<<length> int>]}

where "ip" only occurs when type is ADDRTYPE_INET or ADDRTYPE_INET6

[tlyu@mit.edu: minor commit message edits]

ticket: 8298

9 years agoUpdate mitK5features.rst for krb5-1.14
Tom Yu [Mon, 14 Dec 2015 22:31:20 +0000 (17:31 -0500)] 
Update mitK5features.rst for krb5-1.14

9 years agomake depend
Greg Hudson [Sat, 12 Dec 2015 00:32:47 +0000 (19:32 -0500)] 
make depend

9 years agoCast away constness when assigning to krb5_data 368/head
Tom Yu [Fri, 11 Dec 2015 21:01:08 +0000 (16:01 -0500)] 
Cast away constness when assigning to krb5_data

Some password-changing library functions take a const char * parameter
but try to assign it to krb5_data.data, which isn't const.  PR #364
causes some compilers to produce errors in such situations, so cast
away the constness.  This is almost certainly safe because of the
nature of the code that consumes these krb5_data values.

9 years agoMake krb5_ucs2 and krb5_ucs4 unsigned 367/head
Greg Hudson [Fri, 11 Dec 2015 19:48:41 +0000 (14:48 -0500)] 
Make krb5_ucs2 and krb5_ucs4 unsigned

krb5 contains some Unicode code adapted from OpenLDAP.  OpenLDAP uses
unsigned types for UCS-2 and UCS-4 code points, but the adapted code
uses signed types, which creates pointer-sign warnings when we call
uccompatdecomp() and similar functions.  To match the OpenLDAP code,
use unsigned types.

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]

ticket: 8327 (new)
target_version: 1.14-next
tags: pullup

9 years agoError on incompatible argument types if possible 364/head
Greg Hudson [Wed, 9 Dec 2015 19:56:34 +0000 (14:56 -0500)] 
Error on incompatible argument types if possible

gcc 4.x has no option short of -Werror to error on "makes pointer from
integer without a cast" or "incompatible pointer type" warnings, but
clang and (I think) gcc 5.x do.  Use -Werror=int-conversion and
-Werror=incompatible-pointer-types when the compiler supports them.

At least in clang, -Werror=incompatible-pointer-types also throws an
error when passing an argument discards a const qualifier, which is a
less serious type violation.  But cleaning those up is relatively easy.

9 years agoClean up const qualifier warnings
Greg Hudson [Wed, 9 Dec 2015 21:44:11 +0000 (16:44 -0500)] 
Clean up const qualifier warnings

In server_acl.c, add const qualifiers to the kadm5int_acl_find_entry()
principal parameters, and to the kadm5int_acl_match_data() parameters,
to avoid discarding const qualifiers when calling them.  In
kdb_ldap.c, cast the has_rootdse_ava() attribute before passing it to
ldap_search_ext_s(), which does not modify its attrs parameter but
does not declare it with a const qualifier.

9 years agoRemove unused SPNEGO context fields 355/head
Nicolas Williams [Mon, 30 Nov 2015 21:47:39 +0000 (16:47 -0500)] 
Remove unused SPNEGO context fields

The optionStr and default_cred fields of spnego_gss_ctx_id_rec are
unused; remove them.

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

9 years agoFix k5crypto NSS iov processing bug 360/head
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.

ticket: 8300 (new)
target_version: 1.14-next
tags: pullup

9 years agoCorrectly use k5_wrapmsg() in ldap_principal2.c 363/head
Tom Yu [Wed, 9 Dec 2015 18:49:22 +0000 (13:49 -0500)] 
Correctly use k5_wrapmsg() in ldap_principal2.c

Commit ebcdf02f8ec212555b1762007fa8454615900f36 incorrectly used
k5_prependmsg() in an error handling clause in
krb5_ldap_get_principal().  Use k5_wrapmsg() instead.

ticket: 8301
target_version: 1.14-next
tags: pullup

9 years agoFix FILE ccache negative enctype unmarshalling 362/head
Greg Hudson [Tue, 8 Dec 2015 04:59:31 +0000 (23:59 -0500)] 
Fix FILE ccache negative enctype unmarshalling

Commit b99c7c79dee33de966c8bed02ac79439989f6f99 broke the
unmarshalling of negative enctype values from FILE ccaches.  Fix it by
sign-extending the 16-bit enctype value in unmarshal_keyblock().

9 years agoAdd some common files to .gitignore 357/head
Sarah Day [Fri, 4 Dec 2015 15:01:11 +0000 (10:01 -0500)] 
Add some common files to .gitignore

Add some OS specific files and Eclipse project files, as well as the
top level build directory because it is recommended in the wiki to
perform your build inside of it.  Also ignore the autom4te.cache
directory.

[tlyu@mit.edu: minor commit message edits]

9 years agoRemove ANSI_STDIO conditional 354/head
Greg Hudson [Sun, 29 Nov 2015 20:03:15 +0000 (15:03 -0500)] 
Remove ANSI_STDIO conditional

As we no longer support pre-C89 platforms, assume that the fopen "b"
flag is always allowed.

9 years agoFix impersonate_name to work with interposers
Simo Sorce [Fri, 13 Nov 2015 19:54:11 +0000 (14:54 -0500)] 
Fix impersonate_name to work with interposers

This follows the same modifications applied to
gss_acquire_cred_with_password() when interposer plugins were
introduced.

[ghudson@mit.edu: minor whitespace changes; initialize out_mcred in
spnego_gss_acquire_cred_impersonate_name() since it is released in the
cleanup handler]

ticket: 8280 (new)

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]

ticket: 8276 (new)
target_version: 1.14
tags: pullup

9 years agoRename two test programs for consistency 346/head
Greg Hudson [Tue, 10 Nov 2015 16:54:07 +0000 (11:54 -0500)] 
Rename two test programs for consistency

In src/tests, rename t_init_creds.c and t_localauth.c to icred.c and
localauth.c for consistency with the other C test programs in that
directory.

9 years agoAdd test coverage for GSS context export/import
Greg Hudson [Mon, 2 Nov 2015 03:47:53 +0000 (22:47 -0500)] 
Add test coverage for GSS context export/import

Pass the -export flag to gss-server in t_gss_sample.py, in order to
test context export and import for each of the mechanisms.

ticket: 8273

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.

ticket: 8273

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

ticket: 8273 (new)
target_version: 1.14
tags: pullup

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.

9 years agoFix memory leak in test kdcpreauth module 345/head
Greg Hudson [Wed, 21 Oct 2015 17:23:37 +0000 (13:23 -0400)] 
Fix memory leak in test kdcpreauth module

In test_verify(), in the second round trip case, free the string
attribute before returning.

9 years agoZap secure cookie contents when freeing
Greg Hudson [Wed, 21 Oct 2015 17:21:48 +0000 (13:21 -0400)] 
Zap secure cookie contents when freeing

Secure cookies are intended to hold secret values which may contribute
to key data, and therefore should be sanitized when released.  Also
fix a memory leak in kdc_fast_make_cookie().

ticket: 8271 (new)
target_version: 1.14
tags: pullup

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

ticket: 8252 (new)
target_version: 1.14
tags: pullup

9 years agoAdd more gss_inquire_context() tests
Greg Hudson [Fri, 11 Sep 2015 21:58:33 +0000 (17:58 -0400)] 
Add more gss_inquire_context() tests

Add tests for partial IAKERB and SPNEGO initiators, and for partial
krb5 (DCE-style), IAKERB, and SPNEGO acceptors.  Make flag checking
more strict for existing tests.

ticket: 8244

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]

ticket: 8244
target_version: 1.14
tags: pullup

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]

ticket: 8244
target_version: 1.14
tags: pullup

9 years agoFix env-setup.shin after RUN_ENV simplification
Greg Hudson [Fri, 23 Oct 2015 19:20:33 +0000 (15:20 -0400)] 
Fix env-setup.shin after RUN_ENV simplification

env-setup.shin converts @KRB5_RUN_ENV@ to a shell expression and evals
it.  Now that RUN_ENV no longer contains export statements, we need to
do that explicitly.

9 years agoAllow clock skew in krb5 gss_accept_sec_context() 344/head
Greg Hudson [Thu, 8 Oct 2015 12:53:37 +0000 (08:53 -0400)] 
Allow clock skew in krb5 gss_accept_sec_context()

Remove an unnecessarily strict check for ticket expiration from
kg_accept_krb5() and kg_accept_dce().  Instead, add the maximum
allowable clock skew to the reported lifetime of acceptor contexts.

ticket: 8268
target_version: 1.14
tags: pullup

9 years agoMake ksu work when unsetenv() returns NULL 342/head
Greg Hudson [Sun, 4 Oct 2015 23:54:35 +0000 (19:54 -0400)] 
Make ksu work when unsetenv() returns NULL

Some older platforms (OS X 10.4, glibc 2.2.1) declare unsetenv() as
returning void, as does ksu's compatibility definition of unsetenv().
Don't use the return value in get_configured_defccname().

ticket: 8267
target_version: 1.14
tags: pullup

9 years agoSimplify RUN_ENV definition 341/head
Greg Hudson [Fri, 2 Oct 2015 17:40:47 +0000 (13:40 -0400)] 
Simplify RUN_ENV definition

In the shlib.conf definitions of RUN_ENV, instead of "var=value;
export var;" use just "var=value", taking advantage of the Bourne
shell's "var=value cmd args..." syntax.  This syntax doesn't work
with for loops, so adjust the few Makefile rules which iterate over
$(RUN_VARS).

9 years agoFix installed message catalog uses in kdb tests
Greg Hudson [Sun, 4 Oct 2015 19:55:43 +0000 (15:55 -0400)] 
Fix installed message catalog uses in kdb tests

In src/tests/Makefile.in, rename RUN_SETUP to RUN_DB_TEST, and include
"LC_ALL=C" in the definition to avoid using the message catalog.  Also
include $(VALGRIND) for consistency with RUN_TEST.

ticket: 8264
target_version: 1.14
tags: pullup

9 years agoUse RUN_TEST and fix installed krb5.conf uses
Greg Hudson [Sun, 4 Oct 2015 18:45:29 +0000 (14:45 -0400)] 
Use RUN_TEST and fix installed krb5.conf uses

Use $(RUN_TEST) to run most C test programs, for simplicity and to fix
accidental uses of the installed krb5.conf.  Where a particular
krb5.conf must be used instead of the one in src/config-files, use a
locally defined variant like RUN_TEST_LOCAL_CONF.

Accidental references to the installed krb5.conf were present when
running t_pac, t_princ, t_etypes, t_trace, t_attr, t_attrset,
t_packet, t_remote, t_client, pkinit_kdf_test, test_chpw_message,
text_cxx_krb5, and test_cxx_k5int.

Based on a patch from Robbie Harwood.

ticket: 8266
target_version: 1.14
tags: pullup

9 years agoAdd RUN_TEST make variable
Greg Hudson [Sun, 4 Oct 2015 15:09:28 +0000 (11:09 -0400)] 
Add RUN_TEST make variable

Add a pre.in variable to simplify running C test programs from
Makefile rules.

ticket: 8266

9 years agoUse fixed rcache directory when cross-compiling
Paul Fertser [Mon, 19 Oct 2015 18:46:14 +0000 (14:46 -0400)] 
Use fixed rcache directory when cross-compiling

When cross-compiling, looking at what directories are present on the
build machine makes no sense.  Default to /var/tmp instead.

[ghudson@mit.edu: use /var/tmp instead of /tmp; adjust commit message]

ticket: 8254
target_version: 1.14
tags: pullup

9 years agoUpdates for krb5-1.15-prerelease
Tom Yu [Fri, 9 Oct 2015 17:20:35 +0000 (13:20 -0400)] 
Updates for krb5-1.15-prerelease

9 years agoUpdate mitK5features.rst for krb5-1.14
Tom Yu [Mon, 5 Oct 2015 19:59:25 +0000 (15:59 -0400)] 
Update mitK5features.rst for krb5-1.14

9 years agoAccept new passwords as const char pointers
Andreas Schneider [Tue, 6 Oct 2015 11:35:03 +0000 (13:35 +0200)] 
Accept new passwords as const char pointers

In krb5_change_password(), krb5_set_password(), and
krb5_set_password_using_ccache(), accept the new password as a const
char * instead of a char *.  Propagate this change to the necessary
internal functions.

[ghudson@mit.edu: commit message rewrite]

ticket: 8269 (new)
target_version: 1.14
tags: pullup

9 years agoSet plugin_base_dir for kadmin tests
Nalin Dahyabhai [Thu, 1 Oct 2015 22:59:34 +0000 (18:59 -0400)] 
Set plugin_base_dir for kadmin tests

In the krb5.conf used by the kadmin tests, include a plugin_base_dir
setting.  Otherwise the KDC can load and run code from kdcpreauth
modules in the install tree.

[ghudson@mit.edu: commit message]

ticket: 8262 (new)
target_version: 1.14
tags: pullup

9 years agoFix gss_store_cred() minor code on acceptor cred
Tomas Kuthan [Wed, 30 Sep 2015 13:44:11 +0000 (15:44 +0200)] 
Fix gss_store_cred() minor code on acceptor cred

In krb5_gss_store_cred_into(), if the credential is acceptor-only, set
the minor status to G_STORE_ACCEPTOR_CRED_NOSUPP instead of
G_BAD_USAGE.

[ghudson@mit.edu: edit commit message]

ticket: 8260 (new)
target_version: 1.14
tags: pullup

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]

ticket: 8259 (new)
target_version: 1.14
tags: pullup

9 years agoCorrect GSS major code for non-default QOP values
Tomas Kuthan [Wed, 30 Sep 2015 13:34:26 +0000 (15:34 +0200)] 
Correct GSS major code for non-default QOP values

This patch fixes several krb5 mech error cases to comply with RFC
2743; non-default QOP arguments should result in GSS_S_BAD_QOP, not
GSS_S_FAILURE.

[ghudson@mit.edu: edit commit message]

ticket: 8258 (new)
target_version: 1.14
tags: pullup

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]

ticket: 8257 (new)
target_version: 1.14
tags: pullup

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]

ticket: 8256 (new)
target_version: 1.14
tags: pullup

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]

ticket: 8255 (new)
target_version: 1.14
tags: pullup

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.

ticket: 8253 (new)
target_version: 1.14
tags: pullup

9 years agoFix kadmin with e2fsprogs libss 330/head
Greg Hudson [Wed, 23 Sep 2015 22:20:41 +0000 (18:20 -0400)] 
Fix kadmin with e2fsprogs libss

The libss in e2fsprogs exports ss_execute_command(), but does not
prototype it (as of this writing; a patch has been submitted
upstream).  When using the system ss library, check if a prototype is
needed and provide one if so.

ticket: 8251 (new)
target_version: 1.14
tags: pullup

9 years agoFail during configure if stdint.h missing 329/head
Tom Yu [Mon, 21 Sep 2015 21:20:06 +0000 (17:20 -0400)] 
Fail during configure if stdint.h missing

We now require stdint.h to build this software.  Gracefully fail
during configure time if stdint.h is missing.

ticket: 8221
target_version: 1.14
tags: pullup

9 years agoUpdate acknowledgments
Tom Yu [Wed, 16 Sep 2015 21:13:53 +0000 (17:13 -0400)] 
Update acknowledgments

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]

ticket: 8246 (new)
target_version: 1.13.3
tags: pullup

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.

ticket: 8245

9 years agoFix memory leak in t_accname test program
Greg Hudson [Tue, 1 Sep 2015 16:17:18 +0000 (12:17 -0400)] 
Fix memory leak in t_accname test program

In t_accname.c, release real_acceptor_name and namebuf before
returning from main().

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]

ticket: 8239 (new)
target_version: 1.13.3
tags: pullup