]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
7 years agoLength check when parsing GSS token encapsulation krb5-1.14
Greg Hudson [Sat, 11 Nov 2017 18:42:28 +0000 (13:42 -0500)] 
Length check when parsing GSS token encapsulation

gssint_get_mech_type_oid() is used by gss_accept_sec_context() to
determine the mechanism of the token.  Without length checking, it
might read a few bytes past the end of the input token buffer.  Add
length checking as well as test cases for truncated encapsulations.
Reported by Bar Katz.

(cherry picked from commit f949e990f930f48df1f108fe311c58ae3da18b24)

ticket: 8620
version_fixed: 1.14.7

7 years agoFix PKINIT cert matching data construction
Greg Hudson [Tue, 17 Oct 2017 22:50:15 +0000 (18:50 -0400)] 
Fix PKINIT cert matching data construction

Rewrite X509_NAME_oneline_ex() and its call sites to use dynamic
allocation and to perform proper error checking.

(cherry picked from commit fbb687db1088ddd894d975996e5f6a4252b9a2b4)

ticket: 8617
version_fixed: 1.14.7

7 years agoUpdate for krb5-1.14.6-postrelease
Greg Hudson [Mon, 25 Sep 2017 17:49:58 +0000 (13:49 -0400)] 
Update for krb5-1.14.6-postrelease

7 years agoUpdate for krb5-1.14.6 krb5-1.14.6-final
Greg Hudson [Mon, 25 Sep 2017 16:26:51 +0000 (12:26 -0400)] 
Update for krb5-1.14.6

7 years agomake update-po
Greg Hudson [Mon, 25 Sep 2017 15:44:31 +0000 (11:44 -0400)] 
make update-po

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

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

(cherry picked from commit 29c504504f0c56c861d968ba2498590bf34714cd)

ticket: 8600
version_fixed: 1.14.6

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

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

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

CVE-2017-11368:

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

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

(cherry picked from commit ffb35baac6981f9e8914f8f3bffd37f284b85970)

ticket: 8599
version_fixed: 1.14.6

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

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

CVE-2017-11462:

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

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

(cherry picked from commit 56f7b1bc95a2a3eeb420e069e7655fb181ade5cf)

ticket: 8598
version_fixed: 1.14.6

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

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

(cherry picked from commit f8ed1bde848a16dfda5c6558ffe4326acc37bc95)

ticket: 8589
version_fixed: 1.14.6

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

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

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

(cherry picked from commit 3efb19294012ad38ac3a95d407e739313838c68a)

ticket: 8588
version_fixed: 1.14.6

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

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

This patch frees the memory unconditionally in make_ap_req_v1().

(cherry picked from commit 29337e7c7b796685fb6a03466d32147e17aa2d16)

ticket: 8584
version_fixed: 1.14.6

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

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

(cherry picked from commit b0a072e6431261734e7350996a363801f180e8ea)

ticket: 8581
version_fixed: 1.14.6

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

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

(cherry picked from commit aace82e17ed0185faa3e9cda5437a3c6a7a40b10)

ticket: 8580
version_fixed: 1.14.6

8 years agoMake RC4 string-to-key more robust
Greg Hudson [Sat, 15 Apr 2017 01:41:20 +0000 (21:41 -0400)] 
Make RC4 string-to-key more robust

krb5int_utf8cs_to_ucs2les() can read slightly beyond the end of the
input buffer if the buffer ends with an invalid UTF-8 sequence.  When
computing the RC4 string-to-key result, make a zero-terminated copy of
the input string and use krb5int_utf8s_to_ucs2les() instead.

(cherry picked from commit b8814745049b5f401e3ae39a81dc1e14598ae48c)

ticket: 8576
version_fixed: 1.14.6

8 years agoCheck for FAST in encrypted challenge client
Greg Hudson [Tue, 11 Apr 2017 21:00:01 +0000 (17:00 -0400)] 
Check for FAST in encrypted challenge client

If we reach the encrypted challenge clpreauth process method without
an armor key, error out instead of crashing.  This can happen if (a)
the KDC offers encrypted challenge even though the request doesn't use
FAST (the Heimdal KDC apparently does this), and (b) we fall back to
that preauth method before generating a preauthenticated request,
typically because of a prompter failure in encrypted timestamp.
Reported by Nico Williams.

(cherry picked from commit ff6aac3e018e80fa32df2e14446c6ed9595dfc3c)

ticket: 8573
version_fixed: 1.14.6

8 years agoFix uninitialized flags in MSLSA ccache type
Alexander Karaivanov [Mon, 24 Apr 2017 07:01:12 +0000 (09:01 +0200)] 
Fix uninitialized flags in MSLSA ccache type

The flags field in krb5_lcc_data is not initialized in
krb5_lcc_resolve(), so krb5_lcc_next_cred() can sometimes fail to
include a ticket when retrieving a ccache entry.  This results in a
"Request did not supply a ticket" error from k5_make_tgs_req() when
trying to use the credential.

[ghudson@mit.edu: condensed commit message]

(cherry picked from commit e5a78d4c90d9d6968c94b0c07f2cd3835f02aa5d)

ticket: 8567
version_fixed: 1.14.6

8 years agoFix krb5int_open_plugin_dirs() error handling
Martin Kittel [Wed, 15 Mar 2017 16:21:28 +0000 (17:21 +0100)] 
Fix krb5int_open_plugin_dirs() error handling

In krb5int_open_plugin_dirs(), if constructing filepath fails,
filepath is set to null but accessed a few lines later.  Add an error
check before calling krb5int_open_plugin().

(cherry picked from commit ec56309e95e37cb3c91bad2a696b9bd094620876)

ticket: 8565
version_fixed: 1.14.6

8 years agoForce autoconf rebuild in maintainer rules
Greg Hudson [Tue, 14 Mar 2017 23:39:38 +0000 (19:39 -0400)] 
Force autoconf rebuild in maintainer rules

autoconf normally avoids recreating files that it does not consider
obsolete.  Since it knows nothing about patchlevel.h (which we read at
autoconf time using m4's esyscmd()), changes to patchlevel.h won't be
reflected in configure unless another input to configure has changed,
and the maintainer rule will re-run autoconf over and over again.  Fix
this issue by passing the force flag to autoconf when we invoke it
from the maintainer rule.

(cherry picked from commit 7027788ae6adbd06d5a16de6ee62e489a4dca68b)

ticket: 8560
version_fixed: 1.14.6

8 years agoFix leaks in gss_inquire_cred_by_oid()
Greg Hudson [Sun, 12 Mar 2017 16:30:59 +0000 (12:30 -0400)] 
Fix leaks in gss_inquire_cred_by_oid()

In the mechglue gss_inquire_cred_by_oid(), remove an unnecessary
allocation of ret_set which is overwritten by the first mechanism's
result.

(cherry picked from commit 0d39d46852587d36fcc5024d5766586faba9044a)

ticket: 8559
version_fixed: 1.14.6

8 years agoAllow null outputs to gss_get_name_attribute()
Isaac Boukris [Sat, 4 Mar 2017 19:23:32 +0000 (21:23 +0200)] 
Allow null outputs to gss_get_name_attribute()

In krb5_gss_get_name_attribute(), always ask for kvalue and
kdisplay_value when calling krb5_authdata_get_attribute(), as it
currently expect non-null arguments.  This change allows applications
to pass GSS_C_NO_BUFFER for the value and display_value output
parameters.  (Passing NULL for the authenticated and complete output
parameters already works.)

[ghudson@mit.edu: initialized kvalue and kdisplay_value for safety]

(cherry picked from commit 0cff20bd02c7e9b0bc88c425b58fa2d379da51b3)

ticket: 8557
version_fixed: 1.14.6

8 years agoUpdate for krb5-1.14.5-postrelease
Greg Hudson [Fri, 3 Mar 2017 17:30:31 +0000 (12:30 -0500)] 
Update for krb5-1.14.5-postrelease

8 years agoUpdate for krb5-1.14.5 krb5-1.14.5-final
Greg Hudson [Thu, 2 Mar 2017 18:43:56 +0000 (13:43 -0500)] 
Update for krb5-1.14.5

8 years agomake update-po
Greg Hudson [Thu, 2 Mar 2017 18:15:33 +0000 (13:15 -0500)] 
make update-po

8 years agoUpdate man pages
Greg Hudson [Thu, 2 Mar 2017 18:15:05 +0000 (13:15 -0500)] 
Update man pages

8 years agoUpdate copyright years to 2017
Michael Mattioli [Tue, 27 Dec 2016 22:02:04 +0000 (17:02 -0500)] 
Update copyright years to 2017

(cherry picked from commit 35cd8db0f6627324b3b3a31f29b34774f649263b)

8 years agoFix udp_preference_limit with SRV records
Greg Hudson [Tue, 28 Feb 2017 03:35:07 +0000 (22:35 -0500)] 
Fix udp_preference_limit with SRV records

In sendto_kdc:resolve_server() when resolving a server entry with a
specified transport, defer the resulting addresses if the strategy
dictates that the specified transport is not preferred.  Reported by
Jochen Hein.

(cherry picked from commit bc7594058011c2f9711f24af4fa15a421a8d5b62)

ticket: 8554
version_fixed: 1.14.5

8 years agoFix PKINIT two-component matching rule parsing
Greg Hudson [Fri, 24 Feb 2017 18:41:53 +0000 (13:41 -0500)] 
Fix PKINIT two-component matching rule parsing

In pkinit_matching.c:parse_rule_set(), apply the default relation when
parsing the second component of a rule, not the third.  Otherwise we
apply no default relation to two-component matching rules, effectively
reducing such rules to their second components.  Reported by Sumit
Bose.

(cherry picked from commit 67ae7bbe1ea7032d1cb79682be3a14e7e13ec64f)

ticket: 8553
version_fixed: 1.14.5

8 years agoFix error handling in PKINIT decode_data()
Greg Hudson [Wed, 14 Dec 2016 16:25:41 +0000 (11:25 -0500)] 
Fix error handling in PKINIT decode_data()

decode_data() mixes errno values with OpenSSL return codes.  Change
its return type to int, and return 1 on success or 0 on failure.

(back ported from commit cc9035a7d25008bdcd9c7beb01670aa57b51d829)

ticket: 8525
version_fixed: 1.14.5

8 years agoAdd caveats to krbtgt change documentation
Greg Hudson [Sun, 4 Dec 2016 23:34:41 +0000 (18:34 -0500)] 
Add caveats to krbtgt change documentation

In database.rst, describe a couple of krbtgt rollover issues and how
to avoid them.

(cherry picked from commit 56d05e87858b672591c1e6b7869cb08e8b1e0d59)

ticket: 8524
version_fixed: 1.14.5

8 years agoAdd krbPwdPolicy attributes to kerberos.ldif
Tomas Kuthan [Fri, 2 Dec 2016 14:22:54 +0000 (15:22 +0100)] 
Add krbPwdPolicy attributes to kerberos.ldif

When LDAP backend support for policy extensions was added by
5edafa0532 (ticket 7223), the kerberos.ldif change neglected to add
the new attributes to krbPwdPolicy.

(cherry picked from commit 823e3088d835661fd718a941f602bb2972db96c8)

ticket: 8523
version_fixed: 1.14.5

8 years agoAllow slapd path configuration in t_kdb.py
Greg Hudson [Sun, 27 Nov 2016 23:37:12 +0000 (18:37 -0500)] 
Allow slapd path configuration in t_kdb.py

The upstream OpenLDAP installs slapd in libexec, which is not
typically in the path.  Also, copying the binary can sometimes cause
it to fail; for instance, in the OpenCSW package,
/opt/csw/libexec/slapd is a script which chooses a binary based on the
system architecture and the path to the script.  Allow the test runner
to set the SLAPD environment variable to specify the slapd location
and avoid the copy.

(cherry picked from commit 9290e52b7f206dcbfd9dd5d873cf9379cb9de760)

ticket: 8521
version_fixed: 1.14.5

8 years agoRelicense ccapi/common/win/OldCC/autolock.hxx
Greg Hudson [Tue, 29 Nov 2016 06:46:21 +0000 (01:46 -0500)] 
Relicense ccapi/common/win/OldCC/autolock.hxx

With permission from Danilo Almeida, change the license on
autolock.hxx to the 2-clause BSD license used by MIT krb5.

(cherry picked from commit 90bfe396781c3b2a427c95dd2e58a234027ff269)

ticket: 8520
version_fixed: 1.14.5

8 years agoUse zap() more consistently
Greg Hudson [Mon, 31 Oct 2016 16:10:48 +0000 (12:10 -0400)] 
Use zap() more consistently

Use zap() or zapfree() in places where we previously used memset() to
scrub memory.  Reported by Zhaomo Yang and Brian Johannesmeyer.

(back ported from commit d58cfa06bab766cf1354bc593deea300388072c0)

ticket: 8514
version_fixed: 1.14.5

8 years agoMake zap() more reliable
Greg Hudson [Mon, 31 Oct 2016 15:48:54 +0000 (11:48 -0400)] 
Make zap() more reliable

The gcc assembly version of zap() could still be optimized out under
gcc 5.1 or later, and the krb5int_zap() function could be optimized
out with link-time optimization.  Based on work by Zhaomo Yang and
Brian Johannesmeyer, use the C11 memset_s() when available, then fall
back to a memory barrier with gcc or clang, and finally fall back to
using krb5int_zap().  Modify krb5int_zap() to use a volatile pointer
in case link-time optimization is used.

(cherry picked from commit c163275f899b201dc2807b3ff2949d5e2ee7d838)

ticket: 8514
version_fixed: 1.14.5

8 years agoFix detection of libaceclnt for securid_sam2
Greg Hudson [Fri, 28 Oct 2016 14:13:13 +0000 (10:13 -0400)] 
Fix detection of libaceclnt for securid_sam2

The symbol we need is SD_Init(), not sd_init().

(cherry picked from commit 081ee2f7d98b939bf7b4866845d4243b5ca3992c)

ticket: 8512
version_fixed: 1.14.5

8 years agoFix rare leak in krb5_cccol_have_content()
Greg Hudson [Fri, 21 Oct 2016 06:06:18 +0000 (02:06 -0400)] 
Fix rare leak in krb5_cccol_have_content()

If krb5_cc_start_seq_get() fails inside the loop, close the current
credential cache before continuing to the next one.  Reported by Todd
Lipcon.

(cherry picked from commit 1735f2e74767e56ac3bd75de61d41b8363ec6ce4)

ticket: 8509
version_fixed: 1.14.5

8 years agoSet alg param correctly for PKCS1
Tom Yu [Tue, 4 Oct 2016 22:14:51 +0000 (18:14 -0400)] 
Set alg param correctly for PKCS1

When using a smart card and constructing a DigestInfo to pass to the
CKM_RSA_PKCS mechanism, make sure to set the AlgorithmIdentifier
parameters correctly.  This is typically an ASN.1 NULL value.

Reported to Ubuntu in Launchpad #1629370.

(cherry picked from commit fded9063c23daa3dbd9ffaf32f8145844293f472)

ticket: 8506
version_fixed: 1.14.5

8 years agoProperly handle EOF condition on libkrad sockets
Nathaniel McCallum [Fri, 30 Sep 2016 14:03:33 +0000 (10:03 -0400)] 
Properly handle EOF condition on libkrad sockets

In the previous code, when the remote peer performed an orderly shutdown
on the socket, libkrad would enter a state in which all future requests
timed out.  Instead, if the peer shuts down its socket, we need to
attempt to reopen it.

(cherry picked from commit 248497427d5a45225817b6c22e9224e8ad969872)

ticket: 8504
version_fixed: 1.14.5

8 years agoClarify kinit principal selection
Tom Yu [Wed, 28 Sep 2016 16:33:52 +0000 (12:33 -0400)] 
Clarify kinit principal selection

Describe the principal selection behavior of kinit when the principal
argument is absent.

(cherry picked from commit 9896d4ffecb69f0262375b2f0db5b275a5e25de9)

ticket: 8403
version_fixed: 1.14.5

8 years agoFix typo in install_kdc.rst
Greg Hudson [Mon, 26 Sep 2016 22:01:12 +0000 (18:01 -0400)] 
Fix typo in install_kdc.rst

(cherry picked from commit f619c2621443d9463898c434828dc67e587c2afd)

ticket: 8500
version_fixed: 1.14.5

8 years agoImprove keytab documentation
Ben Kaduk [Mon, 26 Jan 2015 16:15:42 +0000 (11:15 -0500)] 
Improve keytab documentation

In the k5srvutil man page, do not give the impression that arbitrary
new keys can be added to the keytab (requested by Dan Gillmor), since
only the new keys randomly generated by the KDC via 'k5srvutil change'
can be added to the keytab.  Reiterate the importance of running
k5srvutil delold after running k5srvutil change in the description of
k5srvutil change, as well as in the description of k5srvutil delold
itself.

In install_kdc.rst, mention using a separate keytab file when
generating a keytab on a KDC for use on another host.

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

(cherry picked from commit b1e655b38b60a05d4d2e4e0d4aedb7a9c36ab93b)

ticket: 8500
version_fixed: 1.14.5

8 years agoDocument krb5_kt_next_entry() requirement
Ben Kaduk [Wed, 11 Jun 2014 20:38:57 +0000 (16:38 -0400)] 
Document krb5_kt_next_entry() requirement

Successful calls to krb5_kt_next_entry() return a krb5_keytab_entry
that the caller is responsible for freeing.  Note this, and the
proper function to do so, in the doxygen comments.

(cherry picked from commit e70c73b804400a2f18a044dd386dbf1a8430b92e)

ticket: 8500
version_fixed: 1.14.5

8 years agoFix unlikely leak in KDC AS-REQ error path
Greg Hudson [Thu, 22 Sep 2016 06:21:39 +0000 (02:21 -0400)] 
Fix unlikely leak in KDC AS-REQ error path

In prepare_error_as(), if krb5_us_timeofday() fails and error pa-data
was supplied, the FAST cookie and a shallow copy of the error padata
can be leaked.  Reported by Will Fiveash.

(cherry picked from commit 8d852c577039d59e1bea383e4ddfe575c20f240d)

ticket: 8498
version_fixed: 1.14.5

8 years agoUpdate for krb5-1.14.4-postrelease
Tom Yu [Wed, 14 Sep 2016 17:37:33 +0000 (13:37 -0400)] 
Update for krb5-1.14.4-postrelease

8 years agoUpdate for krb5-1.14.4 krb5-1.14.4-final
Tom Yu [Mon, 12 Sep 2016 22:13:50 +0000 (18:13 -0400)] 
Update for krb5-1.14.4

8 years agomake update-po
Tom Yu [Mon, 12 Sep 2016 21:28:51 +0000 (17:28 -0400)] 
make update-po

8 years agoUpdate man pages
Tom Yu [Mon, 12 Sep 2016 21:24:01 +0000 (17:24 -0400)] 
Update man pages

8 years agoUpdate config.guess, config.sub
Tom Yu [Wed, 31 Aug 2016 22:58:09 +0000 (18:58 -0400)] 
Update config.guess, config.sub

(cherry picked from commit f60ac0e5256d9a4006688b0e1c5cc8caf7c9d2b3)

ticket: 8489
version_fixed: 1.14.4

8 years agoTest bt_split.c unaligned access
Tom Yu [Wed, 7 Sep 2016 22:20:56 +0000 (18:20 -0400)] 
Test bt_split.c unaligned access

(back ported from commit 4613d503986f34f05ff310fcc580f65ba60eec5b)

ticket: 8493
version_fixed: 1.14.4

8 years agoFix unaligned accesses in bt_split.c
Tom Yu [Wed, 7 Sep 2016 21:28:34 +0000 (17:28 -0400)] 
Fix unaligned accesses in bt_split.c

In the libdb2 btree back end, splitting a page at an overflow key
could result in an unaligned access, causing a crash (and data
corruption) on platforms with strict alignment.  This probably occurs
only rarely in practice.

(cherry picked from commit 537aba0dda3a1f696f10fde56348fde06d88939c)

ticket: 8493
version_fixed: 1.14.4

8 years agoFix build with -O3 on ppc64el
Ben Kaduk [Thu, 11 Aug 2016 04:25:47 +0000 (23:25 -0500)] 
Fix build with -O3 on ppc64el

Ubuntu runs ppc64el builds with -O3, which elicited a few warnings
from gcc that were not generated elsewhere, as documented at
https://bugs.launchpad.net/ubuntu/+source/krb5/+bug/1592841 .

Initialize the output variable at the top of a couple of helper functions
to silence the uninitialized-variable warnings.

(cherry picked from commit 7db89952d8d4f806ac8b4908f898ac651df11643)

ticket: 8475
version_fixed: 1.14.4

8 years agoRemove meaningless checks decoding DB2 principals
Greg Hudson [Tue, 6 Sep 2016 16:58:57 +0000 (12:58 -0400)] 
Remove meaningless checks decoding DB2 principals

Commit e3d9f03a658e247dbb43cb345aa93a28782fd995 (ticket 8481) added
several checks for negative length values when decoding DB2 principal
entries, including two unnecessary checks on unsigned values.  Remove
those checks as they can generate warnings.

(cherry picked from commit c0f08f2eadbf179ec30008893a125722536c7802)

ticket: 8491
version_fixed: 1.14.4

8 years agoFix directory changes to use explicit subshells
Robbie Harwood [Fri, 2 Sep 2016 18:53:59 +0000 (14:53 -0400)] 
Fix directory changes to use explicit subshells

We depend on the behavior of having a separate subshell for each line in
our Makefiles, so force it where make (observed FreeBSD 10.3) does not
create one.

[ghudson@mit.edu: also changed rules in config/post.in]

(back ported from commit 69571141ccc2483b54e015a5d7c77d1e926f2822)

ticket: 8492
version_fixed: 1.14.4

8 years agoAvoid byte-swap cache corruption in libdb2
Tom Yu [Thu, 25 Aug 2016 22:02:56 +0000 (18:02 -0400)] 
Avoid byte-swap cache corruption in libdb2

Apply a patch from NetBSD to restore the cached copy of a page to the
machine byte order after a write operation swapped it to the file byte
order.  As a regression test, modify test13 to sync the database file
after each put to exercise this bug.

(cherry picked from commit 56d02135d4c77b6aa0cb7136477d426248c60a6f)

ticket: 8483
version_fixed: 1.14.4

8 years agoAdd known file test case for btree byte swap
Tom Yu [Fri, 26 Aug 2016 22:40:49 +0000 (18:40 -0400)] 
Add known file test case for btree byte swap

Add a regression test for the preceding bugfix.  This test uses btree
database files with known contents and byte orders with short keys and
overflow data items.

(back ported from commit af3e7a4ac8b49ae8047ae2be7070d32feb69217d)

ticket: 8485
version_fixed: 1.14.4

8 years agoFix btree byte swapping for overflow data
Tom Yu [Fri, 26 Aug 2016 19:24:52 +0000 (15:24 -0400)] 
Fix btree byte swapping for overflow data

When operating on a btree database file of the opposite endianness,
libdb2 was swapping the wrong bytes if a record had a short key but
overflow data.  Fix this bug by not incrementing p when swapping a
P_BIGKEY overflow pointer, and by always skipping the full key size
before swapping a P_BIGDATA overflow pointer (instead of assuming that
a P_BIGKEY pointer always precedes a P_BIGDATA pointer).

(cherry picked from commit b6238a61769ffbf8a8ac653baeed1c3373b961f8)

ticket: 8485
version_fixed: 1.14.4

8 years agoTest btree unaligned byte swapping
Tom Yu [Fri, 26 Aug 2016 16:47:00 +0000 (12:47 -0400)] 
Test btree unaligned byte swapping

Add a regression test for unaligned accesses during btree byte
swapping.

(back ported from commit eaa03649fb5a3d983d48afe0124b15ad12b7bead)

ticket: 8484
version_fixed: 1.14.4

8 years agoAvoid unaligned access in btree byte swapping
Tom Yu [Fri, 26 Aug 2016 17:56:18 +0000 (13:56 -0400)] 
Avoid unaligned access in btree byte swapping

Apply a patch from NetBSD to use temporary character buffers instead
of doing an unaligned read when swapping bytes.

(cherry picked from commit 0936b2578b64be2c53c8cfccd70cbe93519d42fa)

ticket: 8484
version_fixed: 1.14.4

8 years agoImprove checking of decoded DB2 principal values
Greg Hudson [Tue, 23 Aug 2016 17:41:00 +0000 (13:41 -0400)] 
Improve checking of decoded DB2 principal values

In krb5_decode_princ_entry(), verify the length of the principal name
before calling krb5_parse_name() or strlen(), to avoid a possible
buffer read overrun.  Check all length fields for negative values.
Avoid performing arithmetic as part of bounds checks.  If the value of
key_data_ver is unexpected, return KRB5_KDB_BAD_VERSION instead of
aborting.

(cherry picked from commit e3d9f03a658e247dbb43cb345aa93a28782fd995)

ticket: 8481
version_fixed: 1.14.4

8 years agoGuess Samba client mutual flag using ap_options
Andreas Schneider [Thu, 25 Aug 2016 08:41:33 +0000 (10:41 +0200)] 
Guess Samba client mutual flag using ap_options

To work correctly with older Samba clients, we should guess the mutual
flag based on the ap_options from the AP-REQ and not set it
unconditionally.  Found by the Samba torture testsuite.

[ghudson@mit.edu: edited comments and commit message]

(cherry picked from commit 7919818c0eec534828521aed01b89aa72e5e7e81)

ticket: 8486
version_fixed: 1.14.4

8 years agoFix leak in krb5_server_decrypt_ticket_keytab()
Seemant Choudhary [Wed, 24 Aug 2016 16:20:01 +0000 (12:20 -0400)] 
Fix leak in krb5_server_decrypt_ticket_keytab()

When we skip a keytab entry because it is of the wrong enctype, free
it before continuing.

(cherry picked from commit 9984c2343c96f3aaaf8a8d6dfc1b6de1eae533c2)

ticket: 8482
version_fixed: 1.14.4

8 years agoFix GSSRPC server credential memory leak
Greg Hudson [Tue, 23 Aug 2016 16:35:50 +0000 (12:35 -0400)] 
Fix GSSRPC server credential memory leak

In svc_auth_gss.c, stop using the global svcauth_gss_creds, and
instead keep a credential in struct svc_rpc_gss_data.  This change
ensures that the same credential is used for each accept_sec_context
call for a particular context, and ensures that the credential is
freed when the authentication data is destroyed.  Also, do not acquire
a credential when the default name is used (as it is in kadmind) as it
is not needed.

Leave the svcauth_gss_creds around for the backportable fix as it is
in the library export list.  It will be removed in a subsequent
commit.

(cherry picked from commit 670d9828086e979d5cdfd26f00ca88958a03754e)

ticket: 8480
version_fixed: 1.14.4

8 years agoFix SPNEGO imported cred initialization
Greg Hudson [Wed, 20 Jul 2016 21:08:55 +0000 (17:08 -0400)] 
Fix SPNEGO imported cred initialization

In spnego_gss_import_cred(), use create_spnego_cred() to create the
SPNEGO credential structure.  Prior to this change, an imported SPNEGO
cred did not initialize the no_ask_integ field (added by commit
cf39ed349976908626cad3e05e17788f8334bce9, ticket #6938).

(cherry picked from commit 1bedcf7fc43e45882edcb9eb17d0852a30babae3)

ticket: 8460
version_fixed: 1.14.4

8 years agoUse responder for non-preauth AS requests
Greg Hudson [Fri, 5 Aug 2016 16:28:03 +0000 (12:28 -0400)] 
Use responder for non-preauth AS requests

If no AS reply key is computed during pre-authentication (typically
because no pre-authentication was required by the KDC), ask for the
password using the responder before calling gak_fct for the key, and
supply any resulting responder items to gak_fct.

(cherry picked from commit 0639adc91ae9f66496171d14a232eae3c02bda0d)

ticket: 8454
version_fixed: 1.14.4

8 years agoHandle errors from curs_init in db2 back end
Tom Yu [Thu, 11 Aug 2016 20:27:33 +0000 (16:27 -0400)] 
Handle errors from curs_init in db2 back end

ctx_iterate could ignore errors from curs_init.  Actually pass them up
to the caller.

(cherry picked from commit da4447bd3a9e12485cf2e6cc925dcc386585a0c1)

ticket: 8473
version_fixed: 1.14.4

8 years agoFix KDC to drop repeated in-progress requests
Sarah Day [Mon, 15 Aug 2016 20:11:31 +0000 (16:11 -0400)] 
Fix KDC to drop repeated in-progress requests

When a KDC receives a repeated request while the original request is
still in progress, it is supposed to be to drop the request.  Commit
f07760088b72a11c54dd72efbc5739f231a4d4b0 introduced a bug in this
logic, causing the KDC to instead send an empty reply.  In
kdc_check_lookaside(), return a NULL reply_packet for empty entries,
restoring the expected behavior.

[ghudson@mit.edu: edited commit message, added a comment]

(cherry picked from commit 847fc7b3caa823c219c97cc307ccb8d7d519a20f)

ticket: 8477
version_fixed: 1.14.4

8 years agoWork around glibc OFD lock bug on 32-bit Linux
Greg Hudson [Sun, 14 Aug 2016 16:08:16 +0000 (12:08 -0400)] 
Work around glibc OFD lock bug on 32-bit Linux

A bug in Gnu libc causes OFD locking to fail unpredictably on 32-bit
Linux, typically leading to deadlocks.  Work around this bug by using
the fcntl64 system call and struct flock64.

See also: https://sourceware.org/bugzilla/show_bug.cgi?id=20251

(cherry picked from commit 65110210b75d38908cdd84cb202cf013ccf6ed0e)

ticket: 8474
version_fixed: 1.14.4

8 years agoProperly escape quotes for otp set_string example
Ben Kaduk [Wed, 3 Aug 2016 15:23:56 +0000 (10:23 -0500)] 
Properly escape quotes for otp set_string example

The libss parser will consume paired double quotes, but within
a double-quoted region, repeated double quotes will be treated
as an escape and passed through as a single double quote.

(The new kadmin(1) parser in 1.14 that lets commands be specified
on the command line without -q does not go through the libss parser,
so standard shell methods for escaping quotes function as usual.)

(cherry picked from commit 3e319b1f93f75a3bab86425221f2bcbf5603f3f9)

ticket: 8469
version_fixed: 1.14.4

8 years agoFix leak on error in libkadm5_srv initialization
Greg Hudson [Thu, 14 Jul 2016 15:15:40 +0000 (11:15 -0400)] 
Fix leak on error in libkadm5_srv initialization

In init_any(), free handle->params on failure.

(cherry picked from commit a60ed5c039642ec0bd6cdefba89762c3455fb84c)

ticket: 8453
version_fixed: 1.14.4

8 years agoFix leak in capaths processing
Greg Hudson [Wed, 29 Jun 2016 04:01:04 +0000 (00:01 -0400)] 
Fix leak in capaths processing

In k5_client_realm_path(), free the list of strings returned by
rtree_capaths_vals().

(cherry picked from commit 08756ce56bddab79afa4ee24b80243d8f822559d)

ticket: 8447
version_fixed: 1.14.4

8 years agoFix leak in kadm5_hook interface
Greg Hudson [Wed, 29 Jun 2016 02:15:17 +0000 (22:15 -0400)] 
Fix leak in kadm5_hook interface

In k5_kadm5_hook_free_handles(), free each handle structure as well as
its module data.

(cherry picked from commit 40f25ae58415304006dd66ad55eeeb7505d1a816)

ticket: 8445
version_fixed: 1.14.4

8 years agoFix unlikely leak in sendto_kdc
Greg Hudson [Wed, 29 Jun 2016 02:10:35 +0000 (22:10 -0400)] 
Fix unlikely leak in sendto_kdc

If a TCP connection is killed after it allocates the buffer (so is no
longer in READING state), free the buffer during cleanup.

(cherry picked from commit 6895dc9f204520e7f4da8da879cc67c149bc4e6b)

ticket: 8444
version_fixed: 1.14.4

8 years agoFix leak in FAST OTP client processing
Greg Hudson [Wed, 29 Jun 2016 01:38:57 +0000 (21:38 -0400)] 
Fix leak in FAST OTP client processing

In set_pa_data(), after encoding the OTP request and stealing the
pointer from the resulting krb5_data object, free the krb5_data
container.

(cherry picked from commit 7029efc11525299b87b9024280ef1d9f82059ec5)

ticket: 8443
version_fixed: 1.14.4

8 years agoFix leak in DB2 krb5_db_promote() implementation
Greg Hudson [Tue, 28 Jun 2016 22:09:35 +0000 (18:09 -0400)] 
Fix leak in DB2 krb5_db_promote() implementation

In krb5_db2_merge_nra_iterator(), free the entry loaded from the
source DB.

(cherry picked from commit 0c5f74a25f226b2ea61a0ad7906a7c6605fc3533)

ticket: 8442
version_fixed: 1.14.4

8 years agoFix leak in ulog_replay()
Greg Hudson [Tue, 28 Jun 2016 22:01:55 +0000 (18:01 -0400)] 
Fix leak in ulog_replay()

ulog_conv_2dbentry() allocates a krb5_db_entry container; the caller
should not also do so.

(cherry picked from commit 2908839fcae0a12c56514d551ed1f19a7797cddb)

ticket: 8441
version_fixed: 1.14.4

8 years agoFix krb5_get_init_creds_password() pwchange leak
Greg Hudson [Tue, 28 Jun 2016 18:52:31 +0000 (14:52 -0400)] 
Fix krb5_get_init_creds_password() pwchange leak

When krb5_get_init_creds_password() attempts to change the password,
make sure to free code_string along all exit paths.

(cherry picked from commit 3e5f7709e1928f1e814c427f2811d9204a167439)

ticket: 8440
version_fixed: 1.14.4

8 years agoFix leak in gss_display_name() for non-MN names
Greg Hudson [Tue, 28 Jun 2016 16:28:11 +0000 (12:28 -0400)] 
Fix leak in gss_display_name() for non-MN names

RFC 2744 states that the gss_display_name() output_name_type result is
"a pointer into static storage, and should be treated as read-only by
the caller (in particular, the application should not attempt to free
it)".  For non-mechanism names, we were making a copy of the name type
from the union name structure, causing a memory leak; stop doing that.

(cherry picked from commit 20fcbf2cb820df0d31e66bb11f64fb50a31008f5)

ticket: 8439
version_fixed: 1.14.4

8 years agoFix leak in k5_free_cammac()
Greg Hudson [Mon, 27 Jun 2016 23:38:36 +0000 (19:38 -0400)] 
Fix leak in k5_free_cammac()

free_vmac(), a helper function used by k5_free_cammac(), must free its
val pointer as well as the contents; otherwise the krb5_verifier_mac
container is leaked.

(cherry picked from commit d9d6e7e9aa619d5bd35fa6e4468683ee7ddb5e5d)

ticket: 8438
version_fixed: 1.14.4

8 years agoFix leaks on error in krb5 gss_acquire_cred()
Greg Hudson [Mon, 27 Jun 2016 21:49:57 +0000 (17:49 -0400)] 
Fix leaks on error in krb5 gss_acquire_cred()

In acquire_cred_context(), when releasing the partially constructed
cred on error, make sure to free the password and impersonator fields,
and to destroy the ccache if we created it.

(cherry picked from commit ee7315964e52fe351ddb6884e0e8baf1ecce2144)

ticket: 8437
version_fixed: 1.14.4

8 years agoFix leak on error in libkadm5_clnt initialization
Greg Hudson [Mon, 27 Jun 2016 06:00:26 +0000 (02:00 -0400)] 
Fix leak on error in libkadm5_clnt initialization

In init_any(), free handle->lhandle on failure.

(cherry picked from commit 39b96f8531aefa73f1c48f99e0e0229936a7dcaa)

ticket: 8435
version_fixed: 1.14.4

8 years agoFix memory leak destroying DIR ccache
Greg Hudson [Sun, 26 Jun 2016 04:46:39 +0000 (00:46 -0400)] 
Fix memory leak destroying DIR ccache

Credential cache destroy methods are supposed to free the krb5_ccache
structure as well as its contents, but dcc_destroy() was not doing so.

(cherry picked from commit 6f8597f85642562bf672eb9a3be542907d0555c1)

ticket: 8433
version_fixed: 1.14.4

8 years agoFix memory leak in db2 policy DB initialization
Greg Hudson [Fri, 24 Jun 2016 16:33:05 +0000 (12:33 -0400)] 
Fix memory leak in db2 policy DB initialization

osa_adb_init_db() maintains a static linked list mapping filenames to
lock structures.  Entries are never removed from the list; when their
reference counts hit 0, the lockfile is closed but the filename
remains allocated.  However, the filename is allocated each time the
lockfile is re-opened, leaking the old value.  Fix this leak by moving
filename initialization to entry creation.

(cherry picked from commit f53160634dd5de41c12701ade9e59d4b4dcd645b)

ticket: 8432
version_fixed: 1.14.4

8 years agoAdd Host HTTP header to MS-KKDCP requests
Christian Heimes [Mon, 8 Aug 2016 10:38:17 +0000 (12:38 +0200)] 
Add Host HTTP header to MS-KKDCP requests

Some web servers require a Host HTTP header for TLS connections with
SNI (server name indicator).  It is also required for virtual hosts.

(cherry picked from commit 69c8662190bcd46f2300d0cea139681001ea5b26)

ticket: 8472
version_fixed: 1.14.4

8 years agoWarn about dump -recurse nonfunctionality
Tom Yu [Wed, 3 Aug 2016 21:00:05 +0000 (17:00 -0400)] 
Warn about dump -recurse nonfunctionality

kdb5_util dump -recurse hasn't behaved as documented since krb5-1.5,
when the DAL was integrated.  Restoring it is a nontrivial amount of
work, so just document it for now.

(cherry picked from commit eb8dc865efec4938d74a7955fdcd02bbee4c22b9)

ticket: 8470
version_fixed: 1.14.4

9 years agoUpdates for krb5-1.14.3-postrelease
Tom Yu [Thu, 21 Jul 2016 21:19:19 +0000 (17:19 -0400)] 
Updates for krb5-1.14.3-postrelease

9 years agoUpdates for krb5-1.14.3 krb5-1.14.3-final
Tom Yu [Tue, 19 Jul 2016 22:23:41 +0000 (18:23 -0400)] 
Updates for krb5-1.14.3

9 years agomake update-po
Tom Yu [Tue, 19 Jul 2016 22:18:26 +0000 (18:18 -0400)] 
make update-po

9 years agomake depend
Tom Yu [Tue, 19 Jul 2016 22:17:37 +0000 (18:17 -0400)] 
make depend

9 years agoFix S4U2Self KDC crash when anon is restricted
Greg Hudson [Tue, 19 Jul 2016 15:00:28 +0000 (11:00 -0400)] 
Fix S4U2Self KDC crash when anon is restricted

In validate_as_request(), when enforcing restrict_anonymous_to_tgt,
use client.princ instead of request->client; the latter is NULL when
validating S4U2Self requests.

CVE-2016-3120:

In MIT krb5 1.9 and later, an authenticated attacker can cause krb5kdc
to dereference a null pointer if the restrict_anonymous_to_tgt option
is set to true, by making an S4U2Self request.

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

(cherry picked from commit 93b4a6306a0026cf1cc31ac4bd8a49ba5d034ba7)

ticket: 8458
version_fixed: 1.14.3

9 years agoFix error code on clpreauth module failure
Greg Hudson [Tue, 19 Jul 2016 14:52:06 +0000 (10:52 -0400)] 
Fix error code on clpreauth module failure

Commit 632260bd1fccfb420f0827b59c85c329203eafc9 (ticket #7517) allows
better error reporting for some client pre-authentication failures.
However, it breaks an assumption in the S4U2Self code that such errors
can be recognized by the KRB5_PREAUTH_FAILED error code.  Instead of
passing through the error code reported by the first real preauth
module, wrap that error and return KRB5_PREAUTH_FAILED.

(cherry picked from commit 560e11dabb63b141df29c54aaa2e120309a1e021)

ticket: 8457
version_fixed: 1.14.3

9 years agoFix error handling in k5_expand_path()
Greg Hudson [Fri, 15 Jul 2016 22:51:31 +0000 (18:51 -0400)] 
Fix error handling in k5_expand_path()

In k5_expand_path_tokens_extra(), don't throw away non-zero return
statuses in the cleanup handler.  Reported by Will Fiveash.

(cherry picked from commit 55b46445980584644980cbe32f261eb5ba3d14eb)

ticket: 8455
version_fixed: 1.14.3

9 years agoUpdate LDAP docs for password lockout
Greg Hudson [Thu, 7 Jul 2016 20:58:02 +0000 (16:58 -0400)] 
Update LDAP docs for password lockout

The KDC now needs write access to the LDAP KDB, unless password
lockout and tracking of the last successful authentication time are
disabled.  Update the example LDAP access control configuration in
conf_ldap.rst to reflect this, add a note that only read access is
required if lockout is disabled, and add a section to lockout.rst
calling out the need for write access.  Reported by Will Fiveash.

[ci skip]

(cherry picked from commit c6550832235c63ccfaceb61864e887a675b02619)

ticket: 8452
version_fixed: 1.14.3

9 years agoFix typo in doc/user/tkt_mgmt.rst
Tom Yu [Tue, 31 May 2016 19:01:21 +0000 (15:01 -0400)] 
Fix typo in doc/user/tkt_mgmt.rst

[ci skip]

(cherry picked from commit 8b5259b9d17a441a6914e141862c3fa29c234c3d)

ticket: 8417
version_fixed: 1.14.3

9 years agoFix profile_flush_to_file() state corruption
Greg Hudson [Thu, 23 Jun 2016 16:01:56 +0000 (12:01 -0400)] 
Fix profile_flush_to_file() state corruption

In write_data_to_file(), do not clear the profile data object's flags.
If the call to this function resulted from profile_flush_to_file(), we
do not want to clear the DIRTY flag, and we especially do not want to
clear the SHARED flag for a data object which is part of
g_shared_trees.  Instead, clear the DIRTY flag in
profile_flush_file_data().

Add a test case to prof_test1 to exercise the bug in unfixed code.
Also modify test1 to abandon the altered profile after flushing it to
a file, to preserve the external behavior of the script before this
fix.

(cherry picked from commit 32a05995ff9df0d5ef8aff0d020900a37747670d)

ticket: 8431
version_fixed: 1.14.3

9 years agoImprove kdb5 error when default realm is unset
Greg Hudson [Fri, 1 Jul 2016 15:10:19 +0000 (11:10 -0400)] 
Improve kdb5 error when default realm is unset

When the default realm name is unspecified, and none was set in the
krb5_context object, return KRB5_CONFIG_NODEFREALM from libkdb5
instead of the confusing KRB5_KDB_DBTYPE_NOTFOUND.  To accomplish
this, make kdb_get_library_name() return a krb5_error_code.

(cherry picked from commit 4131988dec0199287765e1875fe0bbd375656a62)

ticket: 8448
version_fixed: 1.14.3
tags: -pullup
status: resolved

9 years agoFix incorrect recv() size calculation in libkrad
Nathaniel McCallum [Tue, 21 Jun 2016 20:12:36 +0000 (16:12 -0400)] 
Fix incorrect recv() size calculation in libkrad

Before this patch libkrad would always subtract the existing buffer
length from pktlen before passing it to recv().  In the case of stream
sockets, this is incorrect since krad_packet_bytes_needed() already
performs this calculation.  Subtracting the buffer length twice could
cause integer underflow on the len parameter to recv().

(cherry picked from commit c969e8a37617e9c7743a28177dd3808f7d08cee9)

ticket: 8430
version_fixed: 1.14.3

9 years agoFix kadmin min_life check with nonexistent policy
Greg Hudson [Wed, 8 Jun 2016 04:00:55 +0000 (00:00 -0400)] 
Fix kadmin min_life check with nonexistent policy

In kadmind, self-service key changes require a check against the
policy's min_life field.  If the policy does not exist, this check
should succeed according to the semantics introduced by ticket #7385.
Fix check_min_life() to return 0 if kadm5_get_policy() returns
KADM5_UNK_POLICY.  Reported by John Devitofranceschi.

(cherry picked from commit 5fca279ca4d18f1b5798847a98e7df8737d2eb7c)

ticket: 8427
version_fixed: 1.14.3

9 years agoFix unlikely pointer error in get_in_tkt.c
Greg Hudson [Mon, 9 May 2016 17:45:06 +0000 (13:45 -0400)] 
Fix unlikely pointer error in get_in_tkt.c

In add_padata(), reset the caller's pointer and ensure the list is
terminated as soon as realloc() succeeds; otherwise, the old pointer
could be left behind if a later allocation fails.

(cherry picked from commit 24452cd737951fa6e0f35e97c6a644a9db0aa82d)

ticket: 8413
version_fixed: 1.14.3

9 years agoRelax t_sn2princ.py reverse resolution test
Tom Yu [Fri, 27 May 2016 19:19:43 +0000 (15:19 -0400)] 
Relax t_sn2princ.py reverse resolution test

Relax t_sn2princ.py check of the reverse resolution of the test
hostname.  The new requirement is that it be different from the
forward resolved hostname.  (There is also an existing implicit
requirement that it be in the mit.edu domain.)  This makes
t_sn2princ.py more robust against changes in the reverse resolution of
the test hostname.

(cherry picked from commit 45b34f8e8f10009435d86195ac17e02d1dd0684e)

ticket: 8422
version_fixed: 1.14.3

9 years agoAvoid setting AS key when OTP preauth fails
Nathaniel McCallum [Thu, 26 May 2016 20:54:29 +0000 (16:54 -0400)] 
Avoid setting AS key when OTP preauth fails

In otp_client_process(), call cb->set_as_key() later in the function
after the OTP request has been created.  The previous position of this
call caused the AS key to be replaced even when later code in the
function failed, preventing other preauth mechanisms from retrieving
the correct AS key.

(cherry picked from commit 0712d0059d72ddeaf1764f8fa173a321e3bc072d)

ticket: 8421
version_fixed: 1.14.3