]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
10 years agoAdd test for kinit output ccache error
Tom Yu [Tue, 16 Dec 2014 17:38:47 +0000 (12:38 -0500)] 
Add test for kinit output ccache error

(back ported from commit e47d8204843ce87fcc1342c7970dded8536fcbde)

ticket: 8028
version_fixed: 1.13.1
status: resolved

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

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

(cherry picked from commit feeddfb78ca5de066a509b6be8551d036e0f2c8a)

ticket: 8028
version_fixed: 1.13.1
status: resolved

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

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

(cherry picked from commit 13e9694b17945d43d0cfc203b2645204f2d87086)

ticket: 7962
version_fixed: 1.13.1
status: resolved

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

(cherry picked from commit 49f8ec5975df3cb5f204444df2a284b2e662df85)

ticket: 7880
version_fixed: 1.13.1
status: resolved

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

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

(cherry picked from commit 68cfc8b4e6338b78dce5a960ce47974a73906fac)

ticket: 8024
version_fixed: 1.13.1
status: resolved

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

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

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

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

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

(cherry picked from commit fa4138c7853487105ab3c54e6d176c45eaf8b065)

ticket: 7927
version_fixed: 1.13
status: resolved

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

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

(cherry picked from commit 9b51ffb0c55a6c4c44501d86eb207acc79403c5c)

ticket: 7761
version_fixed: 1.13
status: resolved

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

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

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

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

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

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

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

CVE-2014-5351:

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

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

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

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

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

(cherry picked from commit af0ed4df4dfae762ab5fb605f5a0c8f59cb4f6ca)

ticket: 8018
version_fixed: 1.13
status: resolved

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

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

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

(cherry picked from commit 17689700b27c6fb6d26156330d11b57ef79385d3)

ticket: 8017
version_fixed: 1.13
status: resolved

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

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

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

(cherry picked from commit c61e8c0c6ad5fda8d23dd896c4aed0ac5b470020)

ticket: 3498
version_fixed: 1.13
status: resolved

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

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

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

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

(cherry picked from commit 005f4eb3ccc1092f4a43afc4d6a4fabfa20b2b41)

ticket: 8016
version_fixed: 1.13
status: resolved

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

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

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

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

(cherry picked from commit 5fd5a67c5a93514e7d0a64425baa007ad91f57de)

ticket: 8015
version_fixed: 1.13
status: resolved

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

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

(cherry picked from commit 59cbb7662282f6f882b5d108cf45bdd042857c6a)

ticket: 6731
version_fixed: 1.13
status: resolved

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

Make the KDC default to listening on TCP.

(cherry picked from commit 8d88e2ab00be126237569dc72827ced2ce6b7d04)

ticket: 6731

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

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

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

(cherry picked from commit 0794746f8d8e6b8ce3748d442d2bc1faecf960ce)

ticket: 8000
version_fixed: 1.13
status: resolved

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

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

(cherry picked from commit d2b76e1ba0f4bb0ec7e560a9a681d938f45f950c)

ticket: 7999

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

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

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

(cherry picked from commit 674f7d7abe2d4f8bc3fe791e4347a332e3ccfd41)

ticket: 7998
version_fixed: 1.13
status: resolved

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

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

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

(cherry picked from commit e56f3d43a746c198b1fd1889dc1211b9feedbfc3)

ticket: 8008
version_fixed: 1.13
status: resolved

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

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

[ghudson@mit.edu: minor style changes]

(cherry picked from commit bda574576a5a2d0613fecf12d820e0adcbedf95c)

ticket: 8007
version_fixed: 1.13
status: resolved

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

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

(cherry picked from commit 32c9b8f1aa1b348388ed227394cc609e68ed833b)

ticket: 7995
version_fixed: 1.13
status: resolved

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

(cherry picked from commit 8ee40f56e6c789a87dc403bf70d524d2b3b21dbf)

ticket: 7995
version_fixed: 1.13
status: resolved

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

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

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

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

(cherry picked from commit 2cb54d39316f9a0cc8e75b791b2faf6f051c9495)

ticket: 8006
version_fixed: 1.13
status: resolved

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

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

(cherry picked from commit a85923073ad2d1f5d0314ab330fd6c5f07749be8)

ticket: 8001
version_fixed: 1.13
status: resolved

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

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

(cherry picked from commit bf040d0c4072742efab854ab01af162569f0a8f7)

ticket: 8005
version_fixed: 1.13
status: resolved

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

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

(cherry picked from commit b7a4d695263f1a5b7fe72b1eadce4acdc3f0490b)

ticket: 8004
version_fixed: 1.13
status: resolved

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

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

(cherry picked from commit f749c07bb18878f34f63aa3997bb0ef1360a9a0a)

ticket: 8003
version_fixed: 1.13
status: resolved

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

(cherry picked from commit b96f562888e3e7733e449a922920158e84e0a933)

ticket: 7994
version_fixed: 1.13
status: resolved

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

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

(cherry picked from commit 05a3b205c5d7ee491a64e24581cb4def3814c05b)

ticket: 7994

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

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

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

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

(cherry picked from commit e86e3baaa684a7e891ffe852d74095c1a8b630ba)

ticket: 7997
version_fixed: 1.13
status: resolved

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

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

[ghudson@mit.edu: rewrote commit message]

(cherry picked from commit bbfe19f03bdeca7b05b542dbae4c1692c9800c70)

ticket: 7996
version_fixed: 1.13
status: resolved

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

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

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

(cherry picked from commit a7a8e3186a21c15132cd8fb6c141afcf25a1fb74)

ticket: 7993
version_fixed: 1.13
status: resolved

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

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

[ghudson@mit.edu: clarified commit message]

(cherry picked from commit fefd465614f11f374f5ff183e6eb6cbc1b550de5)

ticket: 7992
version_fixed: 1.13
status: resolved

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

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

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

(cherry picked from commit fdd1c69471bbe5fec0da9f9bcaa9d0a7739db77f)

ticket: 7990
version_fixed: 1.13
status: resolved

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

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

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

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

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

(cherry picked from commit 7208dace8bfbdf5b930e26a19c8ff31c13ea1ef3)

ticket: 7975
version_fixed: 1.13
status: resolved

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

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

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

(cherry picked from commit bca1191210eb582fe09e94486e2631d72b8a5ca5)

ticket: 7988
version_fixed: 1.13
status: resolved

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

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

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

Fix both of these cases.

(cherry picked from commit d899084e24555dc8fd091eb08187ca2a45a08324)

ticket: 7987
version_fixed: 1.13
status: resolved

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

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

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

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

ticket: 7986 (new)

11 years agoMake ksu respect the default_ccache_name setting
Nalin Dahyabhai [Thu, 31 Oct 2013 01:47:14 +0000 (21:47 -0400)] 
Make ksu respect the default_ccache_name setting

Move the logic for resolving and initializing a cache that we're
copying creds into out of krb5_ccache_copy(), and let the caller deal
with it.  Add a helper functions to select/resolve an output ccache in
the default location for the target user after we've switched to the
target user's privileges.  If the destination is a collection, take
care not to change which subsidiary is its primary, and reuse a
subsidiary cache if we can.  If the destination is not a collection,
append a unique value to its name to make a new ccache.

[ghudson@mit.edu: some changes to variable names and comments; move
responsibility for getting target ccache name from
resolve_target_ccache to main]

ticket: 7984 (new)

11 years agoUse an intermediate memory cache in ksu
Nalin Dahyabhai [Thu, 31 Oct 2013 01:45:35 +0000 (21:45 -0400)] 
Use an intermediate memory cache in ksu

Instead of copying source or obtained creds into the target cache and
changing ownership if everything succeeds, copy them into a MEMORY:
cache and then, if everything succeeds, create the target cache as the
target user.

We no longer need to clean up the temporary ccache when exiting in
most error cases.

Use a fake principal name ("_ksu/_ksu@_ksu") as the primary holder of
the temporary cache so that we won't accidentally select it when we
make a subsequent call to krb5_cc_cache_match() (to be added in a
later patch) to find the target location where the creds should be
stored for use while running as the target user.

11 years agoIn ksu, don't stat() not-on-disk ccache residuals
Nalin Dahyabhai [Fri, 1 Nov 2013 13:48:13 +0000 (09:48 -0400)] 
In ksu, don't stat() not-on-disk ccache residuals

Don't assume that ccache residual names are filenames which we can
stat() usefully.  Instead, use helper functions to call the library
routines to try to read the default principal name from caches, and
use whether or not that succeeds as an indication of whether or not
there's a ccache in a given location.

ticket: 7728

11 years agoIn ksu, merge krb5_ccache_copy() and _restricted()
Nalin Dahyabhai [Thu, 24 Jul 2014 19:39:53 +0000 (15:39 -0400)] 
In ksu, merge krb5_ccache_copy() and _restricted()

Other than whether or not they limit the creds it stores to the new
ccache based on the principal name of the client for whom the creds were
issued, there's no meaningful difference between what these two
functions do.  Merge them.

11 years agoAdd regression test for LDAP key fencepost bug
Greg Hudson [Sat, 2 Aug 2014 02:10:35 +0000 (22:10 -0400)] 
Add regression test for LDAP key fencepost bug

ticket: 7980

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

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

CVE-2014-4345:

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

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

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

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

ticket: 7980 (new)
target_version: 1.12.2
tags: pullup

11 years agoDisallow unlocked iteration of hash databases 186/head
Tom Yu [Wed, 6 Aug 2014 22:45:20 +0000 (18:45 -0400)] 
Disallow unlocked iteration of hash databases

It's not clear whether unlocked iteration over a hash DB2 database
will omit unaffected entries if database additions or deletions occur
concurrently with the iteration.  Avoid this situation by disabling
unlocked iteration in the unlikely event that someone is still using a
hash database for their KDB.

ticket: 7977

11 years agoFix glob memory leak in GSS initialization
Greg Hudson [Tue, 5 Aug 2014 03:34:32 +0000 (23:34 -0400)] 
Fix glob memory leak in GSS initialization

In loadConfigFiles, call globfree even if glob fails, since glob can
allocate memory and report partial results on failure.  Also
initialize globbuf before calling glob; this is not strictly required,
but hedges against hypothetical libc implementation bugs which could
leave globbuf.gl_pathc or globbuf.gl_pathv uninitialized on error.

ticket: 7981

11 years agoFix KDC race in t_unlockiter.py
Tom Yu [Wed, 6 Aug 2014 19:03:03 +0000 (15:03 -0400)] 
Fix KDC race in t_unlockiter.py

The second KDC startup in t_unlockiter.py could race with the
garbage-collected shutdown of the first, causing the second one to
fail to bind the listening port.  Avoid the situation by setting
start_kdc=False, because there doesn't need to be a KDC running for
these tests anyway.  Also use create_user=False and create_host=False,
because those principals aren't necessary either.

ticket: 7977

11 years agoFix OS X build
Ben Kaduk [Wed, 6 Aug 2014 16:49:52 +0000 (12:49 -0400)] 
Fix OS X build

Commit 58312ae8beb0499ac3a06196164eb833e9f8975e, "Fix the build on
windows", had a typo that broke the build of KCM support on OS X.
Attempt to increment the cardinality of the set of buildable platforms,
instead of just adjusting its contents, by fixing the typo.

11 years agoFix the build on windows 184/head
Ben Kaduk [Tue, 5 Aug 2014 15:11:45 +0000 (11:11 -0400)] 
Fix the build on windows

Windows does not provide the glob() functionality used to implement
the /etc/gss/mechs.d/ feature, so we must avoid compiling the
relevant code for windows.  (It would never have been called, anyway.)

Adjust the ccache/Makefile.in rules to not use '-' or '@' in
make variable names that are processed by nmake.

Also in ccache/Makefile.in, remove some latent leading whitespace that
had been previously hidden by the previous rule; this exposed some
flawed dependencies that are now removed.

Windows does not provide sys/socket.h or sys/un.h, so don't try
to include them in cc_kcm.c.

The commit which moved the KKDCP TLS support to a plugin left some
dangling references to checkhost.c byproducts in os/Makefile.in,
which can be safely removed.

Use k5-platform.h in support/json.c instead of a set of system includes;
this lets windows build the static inline helper functions therein.

11 years agoIn ksu, without the -e flag, also check .k5users
Nalin Dahyabhai [Wed, 30 Jul 2014 21:12:31 +0000 (17:12 -0400)] 
In ksu, without the -e flag, also check .k5users

When ksu was explicitly told to spawn a shell, a line in .k5users which
listed "*" as the allowed command would cause the principal named on the
line to be considered as a candidate for authentication.

When ksu was not passed a command to run, which implicitly meant that
the invoking user wanted to run the target user's login shell, knowledge
that the principal was a valid candidate was ignored, which could cause
a less optimal choice of the default target principal.

This doesn't impact the authorization checks which we perform later.

ticket: 7983 (new)

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

ticket: 7982 (new)
target_version: 1.12.2
tags: pullup

11 years agoCorrect includes for unlockiter.c 182/head
Tom Yu [Mon, 4 Aug 2014 16:34:24 +0000 (12:34 -0400)] 
Correct includes for unlockiter.c

Some platforms (e.g., Solaris) need a declaration of memset() for the
FD_ZERO() macro to work, contrary to POSIX standards.  Add an
inclusion of <string.h> to accommodate them.  Also add <sys/time.h>,
possibly needed by some older platforms, and remove a spurious
inclusion of <sys/socket.h>.

ticket: 7977

11 years agoSupport kdb5_util dump -rev again 178/head
Tom Yu [Sat, 2 Aug 2014 18:20:35 +0000 (14:20 -0400)] 
Support kdb5_util dump -rev again

Restore kdb5_util dump support for reversed dumps.

ticket: 7978 (new)

11 years agoDocument unlockiter
Tom Yu [Sat, 2 Aug 2014 18:20:35 +0000 (14:20 -0400)] 
Document unlockiter

ticket: 7977

11 years agoStop locking around iprop dumps
Tom Yu [Sat, 2 Aug 2014 18:20:35 +0000 (14:20 -0400)] 
Stop locking around iprop dumps

ticket: 7977

11 years agoIgnore iprop deletion of deleted princ
Tom Yu [Sat, 2 Aug 2014 18:20:35 +0000 (14:20 -0400)] 
Ignore iprop deletion of deleted princ

Now that an iprop full dump might not hold a lock around the entire
dump, it's possible that iprop will queue an incremental update while
the dump is in progress.  If a principal is deleted while the dump is
in progress, the dump could omit that principal, yet the deletion
event would still be queued in the ulog.  Ignore that deletion without
generating an error.

This is the same basic change as for ticket #7753.

ticket: 7977

11 years agoTests for unlocked iteration
Tom Yu [Sat, 2 Aug 2014 18:20:35 +0000 (14:20 -0400)] 
Tests for unlocked iteration

ticket: 7977

11 years agoSupport unlocked iteration in DB2
Tom Yu [Sat, 2 Aug 2014 18:20:33 +0000 (14:20 -0400)] 
Support unlocked iteration in DB2

Add support to the DB2 KDB back end to optionally release the lock
when calling the iterator callback.  This prevents the blocking of
other processes when dumps of large databases are taking place.

Also add support for reversed iteration.

ticket: 7977

11 years agoUse write lock flag for update_princ_encryption
Tom Yu [Sat, 2 Aug 2014 18:20:33 +0000 (14:20 -0400)] 
Use write lock flag for update_princ_encryption

In kdb5_util update_princ_encryption, instead of getting a write lock
on the KDB surrounding the call to krb5_db_iterate(), use the
iterflags parameter of krb5_db_iterate() to request that it obtain a
write lock around the iteration.

ticket: 7977

11 years agoSupport write locks in DB2 iteration
Tom Yu [Sat, 2 Aug 2014 18:20:33 +0000 (14:20 -0400)] 
Support write locks in DB2 iteration

Add support to krb5_db_iterate() for requesting write locks in the DB2
back end.

ticket: 7977

11 years agoAdd flag word to KDB iteration APIs
Tom Yu [Sat, 2 Aug 2014 18:20:33 +0000 (14:20 -0400)] 
Add flag word to KDB iteration APIs

ticket: 7977 (new)
subject: Enable unlocked KDB iteration

11 years agoAdd kiprop/<master-hostname> during KDB creation
Neng Xue [Fri, 11 Jul 2014 23:04:42 +0000 (16:04 -0700)] 
Add kiprop/<master-hostname> during KDB creation

To reduce the number of steps in the deployment of iprop, create the
kiprop/hostname principal for the master KDC during KDB creation.
Adjust tests to match the new behavior.

[ghudson@mit.edu: clarified commit message; avoided applying kadmin
flags/lifetime to kiprop principal]

ticket: 7979 (new)

11 years agoSimplify kdb5_ldap_util special princ creation
Greg Hudson [Tue, 22 Jul 2014 18:20:32 +0000 (14:20 -0400)] 
Simplify kdb5_ldap_util special princ creation

In kdb5_ldap_realm.c, factor out special principal creation into three
helper functions to reduce the amount of verbiage in kdb5_ldap_create.

11 years agoDocument KCM ccache type
Greg Hudson [Fri, 11 Jul 2014 19:00:09 +0000 (15:00 -0400)] 
Document KCM ccache type

Document the new KCM ccache type in ccache_def.rst.  Document the
kcm_socket and kcm_mach_service variables in krb5_conf.rst.

ticket: 7964

11 years agoMake KCM the default ccache on OS X
Greg Hudson [Fri, 11 Jul 2014 03:11:11 +0000 (23:11 -0400)] 
Make KCM the default ccache on OS X

If we do not find a default ccache value from krb5-config and we
detect that the host platform is OS X 10.7 or higher, use KCM: as the
default ccache name instead of FILE:/tmp/krb5cc_%{uid}.

ticket: 7964

11 years agoAdd KCM credential cache type (client only)
Greg Hudson [Tue, 1 Jul 2014 15:49:07 +0000 (11:49 -0400)] 
Add KCM credential cache type (client only)

Add a new credential cache type "KCM" which performs cache operations
by speaking to a Heimdal or OS X KCM daemon, via either Unix domain
sockets or (on OS X only) Mach RPC.  Add "kcm_socket" and
"kcm_mach_service" profile variables to control the socket path and
bootstrap service name respectively.  In ccmarshal.c, add
k5_marshal_mcred to marshal matching credentials in the KCM protocol
representation.

This cache type is not currently supported on Windows, as Windows does
not support Unix domain sockets.

As with the keyring cache type, the lastchange method of this cache
type is mostly useless, reporting only the time of the last change
made through that cache handle.  The KCM protocol currently has no
support for obtaining the last change time of the cache itself.

ticket: 7964 (new)

11 years agoAdjust marshalling interfaces for KCM
Greg Hudson [Tue, 1 Jul 2014 16:13:15 +0000 (12:13 -0400)] 
Adjust marshalling interfaces for KCM

Make k5_marshal_cred and k5_marshal_princ write to an existing struct
k5buf instead of allocating a new one, so that they can be marshalled
before or after other data.

11 years agoModify k5buf interfaces for easier use
Greg Hudson [Wed, 2 Jul 2014 16:03:54 +0000 (12:03 -0400)] 
Modify k5buf interfaces for easier use

Make struct k5buf less opaque and get rid of k5buf-int.h.  Make it
easy to initialize a k5buf in an error state so that it can be freed
in a cleanup handler.  Add a function k5_buf_status which returns 0 or
ENOMEM.  Remove k5_buf_data and k5_buf_len.  Rename k5_free_buf to
k5_buf_free.  Adjust all callers to match.

11 years agoAdd profile tests for deletion bugs
Greg Hudson [Wed, 16 Jul 2014 20:30:44 +0000 (16:30 -0400)] 
Add profile tests for deletion bugs

Add three new libprofile tests to prof_test1, two to test for the bugs
in #7971 and one to test a bug which would have been introduced by a
candidate fix.

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

profile_rename_section should demand only one name.

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

ticket: 7972 (new)
target_version: 1.12.2
tags: pullup

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

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

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

ticket: 7971 (new)
target_version: 1.12.2
tags: pullup

11 years agoAdd SPNEGO renegotiation test case
Greg Hudson [Tue, 15 Jul 2014 16:51:35 +0000 (12:51 -0400)] 
Add SPNEGO renegotiation test case

Modify t_spnego.c to force a renegotiation in the SPNEGO exchange, by
making the initiator propose IAKERB while the acceptor supports only
krb5.

11 years agoDon't equate IAKERB and krb5 in SPNEGO initiator
Greg Hudson [Tue, 15 Jul 2014 17:20:43 +0000 (13:20 -0400)] 
Don't equate IAKERB and krb5 in SPNEGO initiator

To work around a historical bug in Samba, the SPNEGO initiator treats
a counterproposal as matching the optimistic token if both are aliases
for the krb5 mech.  When IAKERB support was added (#6712), IAKERB was
unintentionally added to the set of mech OIDs which were considered to
be krb5 aliases for this purpose.

Remove IAKERB from gss_mech_set_krb5_both and create a new internal
mech set, kg_all_mechs, for use by krb5_gss_indicate_mechs.

ticket: 7974 (new)

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

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

CVE-2014-4344:

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

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

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

ticket: 7970 (new)
subject: NULL dereference in SPNEGO acceptor for continuation tokens [CVE-2014-4344]
target_version: 1.12.2
tags: pullup

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

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

CVE-2014-4343:

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

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

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

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

ticket: 7969 (new)
target_version: 1.12.2
tags: pullup

11 years agoFix leak on GSS module symbol resolution error
Simo Sorce [Thu, 10 Jul 2014 14:04:06 +0000 (10:04 -0400)] 
Fix leak on GSS module symbol resolution error

If krb5int_get_plugin_func fails, errinfo may contain an allocated
error message.  Free it on error when loading GSS modules.

[ghudson@mit.edu: also fix GSS_ADD_DYNAMIC_METHOD; clarify commit
message]

ticket: 7966 (new)
target_version: 1.12.2
tags: pullup

11 years agoFix doc build
Greg Hudson [Sun, 20 Jul 2014 01:57:03 +0000 (21:57 -0400)] 
Fix doc build

Commit 15b7e405ff7b62ab96af45999d1350455948e602 contained an
indentation error which broke the doc build.  Fix it.

ticket: 7944

11 years agoDocument LDAP SASL configuration
Greg Hudson [Mon, 16 Jun 2014 17:15:33 +0000 (13:15 -0400)] 
Document LDAP SASL configuration

Document the LDAP SASL profile tags and DB options.  For consistency,
also condense the kdc.conf documentation for the two bind DN variables
into one entry.

ticket: 7944

11 years agoAdd tests for LDAP SASL support
Greg Hudson [Mon, 16 Jun 2014 16:52:29 +0000 (12:52 -0400)] 
Add tests for LDAP SASL support

In t_kdb.py, add a test case for EXTERNAL, and a test case for
DIGEST-MD5 if we built with the SASL header file and found the core
schema file.

ticket: 7944

11 years agoAdd SASL support to LDAP KDB module
Greg Hudson [Mon, 16 Jun 2014 16:41:03 +0000 (12:41 -0400)] 
Add SASL support to LDAP KDB module

Add variables for the SASL mechanism, authcid, authzid, and realm.  If
a SASL mechanism is set, perform an interactive bind with that
mechanism.  If <sasl/sasl.h> is found at build time, provide the
authcid, authzid, and realm in the interaction function, and provide a
SASL secret read from the service password file (under the authcid) if
we found one.

Based on a patch from Zoran Pericic <zpericic@netst.org>.

ticket: 7944 (new)

11 years agoModernize some LDAP sources
Greg Hudson [Mon, 9 Jun 2014 19:23:25 +0000 (15:23 -0400)] 
Modernize some LDAP sources

Bring ldap_misc.c up to date with current practices and make limited
changes to other files.  Of note:

* krb5_decode_krbsecretkey was freeing its bvalues argument; make that
  the caller's responsibility.
* Make is_principal_in_realm and has_modify_increment return
  krb5_boolean, reversing the sense of their results.
* Remove broken code path in decode_tl_data when an integer value has
  a length other than 2 (which should never happen).
* Simplify krb5_ldap_readpassword and make it take filename/name
  parameters instead of an LDAP context.
* Make krb5_ldap_bind (renamed to authenticate) responsible for
  setting a useful error message, so that its caller doesn't assume
  knowledge of the bind parameters.
* Make krb5_ldap_initialize (renamed to initialize_server) responsible
  for updating the handle list, and remove the otherwise unused
  krb5_update_ldap_handle.
* Remove remaining skeletal certificate support, including the unused
  has_sasl_external_mech function.
* Remove unused krb5_get_containerdn and KDB_TL_CONTAINERDN.
* Remove kdb_xdr.h; all of its prototypes were for functions that
  don't exist in the module or were duplicated in other headers.
* Remove krb5_ldap_get_strings and use ldap_get_values directly at
  its call sites; there was no need to copy the result.

11 years agoRename --with-proxy-tls-impl to --with-tls-impl
Greg Hudson [Thu, 17 Jul 2014 19:20:53 +0000 (15:20 -0400)] 
Rename --with-proxy-tls-impl to --with-tls-impl

Make the configure option for TLS implementation more generic, in case
we use the k5tls module for something other than KDC proxy support.
Rename all of the associated symbols for consistency.

ticket: 7929

11 years agoMove KKDCP OpenSSL code to an internal plugin
Greg Hudson [Sun, 22 Jun 2014 14:42:14 +0000 (10:42 -0400)] 
Move KKDCP OpenSSL code to an internal plugin

Create an internal pluggable interface "tls" with one in-tree dynamic
plugin module named "k5tls".  Move all of the OpenSSL calls to the
plugin module, and make the libkrb5 code load and invoke the plugin.
This way we do not load or initialize libssl unless an HTTP proxy is
used.

ticket: 7929

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

ticket: 7973
target_version: 1.12.2
tags: pullup

11 years agoRemove copyright statement added to bindresvport.c
Greg Hudson [Wed, 16 Jul 2014 01:34:08 +0000 (21:34 -0400)] 
Remove copyright statement added to bindresvport.c

Andreas's copyright statement was added to the Oracle license
statement by mistake; the code changes made to turn bindresvport into
bindresvport_sa are minimal.  Remove it with Andreas's permission.

ticket: 7935

11 years agoImprove error message for PRNG seeding failure
Greg Hudson [Wed, 16 Jul 2014 00:23:15 +0000 (20:23 -0400)] 
Improve error message for PRNG seeding failure

In prng_fortuna.c, if krb5_c_random_make_octets detects that we do not
have entropy, set an error message saying that the random number
generator could not be seeded, as we likely failed previously to read
from /dev/urandom or the Windows equivalent.

ticket: 7968 (new)

11 years agoImprove indentation of t_otp.py
Michael Mattioli [Tue, 15 Jul 2014 16:48:58 +0000 (12:48 -0400)] 
Improve indentation of t_otp.py

Move the RADIUS attribute dictionary text to a global variable defined
at indent level 0, so that we don't go back to indent level 0 in the
middle of the RadiusDaemon class definition.

[ghudson@mit.edu: clarified commit message, moved comment, changed
variable name]

11 years agoFix error check in krb5_ldap_parse_principal_name
Lukas Slebodnik [Sat, 21 Jun 2014 15:09:31 +0000 (17:09 +0200)] 
Fix error check in krb5_ldap_parse_principal_name

Test the correct variable for NULL to detect a strdup failure.

[ghudson@mit.edu: clarified commit message]

11 years agoAvoid closing fd -1 in libkrad
Lukas Slebodnik [Sat, 21 Jun 2014 14:43:12 +0000 (16:43 +0200)] 
Avoid closing fd -1 in libkrad

If a krad_remote is released before its fd is set, we could close the
file descriptor -1, which is harmless but incorrect.  Check the fd in
remote_disconnect to avoid this.

[ghudson@mit.edu: clarified commit message, minor style change]

11 years agoFix argment validation in krb5_make_fulladdr
Lukas Slebodnik [Sat, 21 Jun 2014 14:11:31 +0000 (16:11 +0200)] 
Fix argment validation in krb5_make_fulladdr

Check kaddr and kport, not kport twice.

[ghudson@mit.edu: clarified commit message, minor style change]