Make kprop/kpropd work with RC4 session key

In krb5_auth_con_initivector and mk_priv/rd_priv, stop assuming that
the enctype's block size is the size of the cipher state.  Instead,
make and discard a cipher state to get the size.

(cherry picked from commit 8d01455ec9ed88bd3ccae939961a6e123bb3d45f)

ticket: 7575 (new)
version_fixed: 1.10.4
status: resolved
Convert success in krb5_chpw_result_code_string

Result code 0 used to be converted properly by krb5_set_password,
though not krb5_change_password; this changed in 1.10 when
krb5int_setpw_result_code_string was folded into
krb5_chpw_result_code_string.  Restore the old behavior, and make it
apply to krb5_change_password as well, by making
krb5_chpw_result_code_string convert result code 0.

[ghudson@mit.edu: commit message]

(cherry picked from commit 316bf74b4696058e2b60c95c9d0fc90d6c2c2ffe)

ticket: 7576 (new)
version_fixed: 1.10.4
status: resolved
PKINIT null pointer deref [CVE-2013-1415]

Don't dereference a null pointer when cleaning up.

The KDC plugin for PKINIT can dereference a null pointer when a
malformed packet causes processing to terminate early, leading to
a crash of the KDC process.  An attacker would need to have a valid
PKINIT certificate or have observed a successful PKINIT authentication,
or an unauthenticated attacker could execute the attack if anonymous
PKINIT is enabled.

CVSSv2 vector: AV:N/AC:M/Au:N/C:N/I:N/A:C/E:P/RL:O/RC:C

This is a minimal commit for pullup; style fixes in a followup.
[kaduk@mit.edu: reformat and edit commit message]

(cherry picked from commit c773d3c775e9b2d88bcdff5f8a8ba88d7ec4e8ed)

ticket: 7577 (new)
version_fixed: 1.10.4
status: resolved
Check for negative poll timeout in k5_sendto_kdc

(cherry picked from commit 74bee54227deb64a41c2e79f57dd2a2c5ea010a3)

ticket: 7578 (new)
version_fixed: 1.10.4
status: resolved
Fix gss_str_to_oid for OIDs with zero-valued arcs

gss_str_to_oid wasn't outputting any bytes for a zero-valued arc.  It
should output one byte with value 0.

[ghudson@mit.edu: commit message]

(cherry picked from commit 54fa4433df7412267375240aba40959e97ac4fe2)

ticket: 7579 (new)
version_fixed: 1.10.4
status: resolved
Fix no_host_referral concatention in KDC

If no_host_referral is set in both [kdcdefaults] and the realm
subsection, we're supposed to concatenate their values.  But the logic
in handle_referral_params would overwrite the value with the
non-concatenated realm value.  Similar bugs of this nature were fixed
in 639c9d0f5a7c68dc98a2a452abc05ca32443cddf (r22037) but this one was
missed.

(cherry picked from commit 6338d039cbd0b138642e3b123ac58dc802d1d907)

ticket: 7580 (new)
version_fixed: 1.10.4
status: resolved
Fix kdb5_util dump.c uninitialized warnings

Some versions of clang report an uninitialized variable warning (which
we treat as an error) in process_k5beta_record.  Due to the if-ladder
style of the function, uninitialized tmpint values can be copied
around in certain error cases, although the garbage values would be
ultimately ignored.  As a minimal fix, initialize the tmpint
variables.

(cherry picked from commit 1b7f7eef8a95bda0135159b2c06a168b56d9f42b)

ticket: 7581 (new)
version_fixed: 1.10.4
status: resolved
Fix initial call to svcraw_create

gssrpc raw services could not work because svcraw_create did not set
svcraw_private after allocating memory for it.

[ghudson@mit.edu: commit message, patch splitting]

(cherry picked from commit 5e3bf4ac6cb02601c5f10c5b2804fd5028c80119)

ticket: 7582 (new)
subject: Minor pointer management patches
Fix various result checks

Correct three cases where the wrong expression was checked to see if
an allocation function returned null.

[ghudson@mit.edu: commit message, patch splitting]
[tlyu@mit.edu: omit inapplicable lib/kadm/srv/svr_principal.c change]

(back ported from commit a9ee4a040eeacab1d410ff9e4c862484b531c401)

ticket: 7582
version_fixed: 1.10.4
status: resolved
Update acknowledgments in README

Also update copyright years.
Update README and patchlevel.h for krb5-1.10.4
Update patchlevel.h for krb5-1.10.4-postrelease
KDC TGS-REQ null deref [CVE-2013-1416]

By sending an unusual but valid TGS-REQ, an authenticated remote
attacker can cause the KDC process to crash by dereferencing a null
pointer.

prep_reprocess_req() can cause a null pointer dereference when
processing a service principal name.  Code in this function can
inappropriately pass a null pointer to strlcpy().  Unmodified client
software can trivially trigger this vulnerability, but the attacker
must have already authenticated and received a valid Kerberos ticket.

The vulnerable code was introduced by the implementation of new
service principal realm referral functionality in krb5-1.7, but was
corrected as a side effect of the KDC refactoring in krb5-1.11.

CVSSv2 vector: AV:N/AC:L/Au:S/C:N/I:N/A:C/E:H/RL:O/RC:C

ticket: 7600 (new)
version_fixed: 1.10.5
status: resolved
Fix condition with empty body

Found by clang's warnings.

(cherry picked from commit 18796a2eb6c05706c6635453b3e425955aab93f4)

ticket: 7606 (new)
version_fixed: 1.10.5
status: resolved
Reset ulog if database load failed

If an iprop slave tries to load a dump from the master and it fails,
reset the ulog header so we take another full dump, instead of
reporting that the slave is current when it isn't.

[ghudson@mit.edu: commit message]
[tlyu@mit.edu: remove ulog_sync_header call]

(cherry picked from commit 74b3f961e15d2eee5bad93d2a224c10834bbaab8)

ticket: 7607 (new)
version_fixed: 1.10.5
status: resolved
Updates for krb5-1.10.5 release
Update for krb5-1.10.5-postrelease
Fix kpasswd UDP ping-pong [CVE-2002-2443]

The kpasswd service provided by kadmind was vulnerable to a UDP
"ping-pong" attack [CVE-2002-2443].  Don't respond to packets unless
they pass some basic validation, and don't respond to our own error
packets.

Some authors use CVE-1999-0103 to refer to the kpasswd UDP ping-pong
attack or UDP ping-pong attacks in general, but there is discussion
leading toward narrowing the definition of CVE-1999-0103 to the echo,
chargen, or other similar built-in inetd services.

Thanks to Vincent Danen for alerting us to this issue.

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

(cherry picked from commit cf1a0c411b2668c57c41e9c4efd15ba17b6b322c)

ticket: 7638 (new)
target_version: 1.10.6
status: resolved
Fix transited handling for GSSAPI acceptors

The Acceptor Names project (#6855) extended krb5_rd_req so that it can
accept a "matching principal" in the server parameter.  If the
matching principal has an empty realm, rd_req_decoded_opt attempted to
do transited checking with an empty server realm.

To fix this, always reset server to req->ticket->server for future
processing steps if we decrypt the ticket using a keytab.
decrypt_ticket replaces req->ticket->server with the principal name
from the keytab entry, so we know this name is correct.

Based on a bug report and patch from nalin@redhat.com.

(cherry picked from commit 57acee11b5c6682a7f4f036e35d8b2fc9292875e)

[tlyu@mit.edu: removed test due to k5test.py incompatibility]

ticket: 7649 (new)
version_fixed: 1.10.6
status: resolved
Ignore missing Q in dh_params

Some implementations don't send the required Q value in dh_params, so
allow it to be absent.

(cherry picked from commit ed77a25c53ed6afd41372838f205a98a561a89fb)

ticket: 7658 (new)
version_fixed: 1.10.6
status: resolved