Add more formats to krb5_timestamp_to_sfstring

krb5_timestamp_to_string() can produce ambiguous dates.  The final
fallback, "%d/%m/%Y %R", contains a European order date format that
can be confused with a US date format.  Add some additional strftime()
format strings, including locale-dependent formats and some ISO 8601
formats.  Remove the hardcoded strftime() format that had an ambiguous
date order.

(cherry picked from commit e8e34ead59b3e1fd28beb151c5e6efb47bc57bee)

ticket: 7458
version_fixed: 1.11.1
status: resolved
Fix DPRINT in ipropd_svc.c

cea0b28045b262b1098f17f17f78b2efbf89a6c1 contained an incorrect
definition of DPRINT.  Fix it.

[ghudson@mit.edu: commit message]

(cherry picked from commit 02de9812378cf62293b4acbdaa5f1e13d9c38c6d)

ticket: 7525
version_fixed: 1.11.1
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: 7523
version_fixed: 1.11.1
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: 7534
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]

(cherry picked from commit a9ee4a040eeacab1d410ff9e4c862484b531c401)

ticket: 7534
version_fixed: 1.11.1
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: 7539
version_fixed: 1.11.1
status: resolved
Fix iprop safety net in kdb5_util load

The error message was missing a newline, and the exit behavior causes
the database to be destroyed.

(cherry picked from commit b264161818eba43263b4d7f137dbae6b266907f0)

ticket: 7370
version_fixed: 1.11.1
status: resolved
Check for negative poll timeout in k5_sendto_kdc

(cherry picked from commit 74bee54227deb64a41c2e79f57dd2a2c5ea010a3)

ticket: 7553
version_fixed: 1.11.1
status: resolved
Fix h1 end tag in Sphinx header titles

A </h1> end tag was incorrectly written as <h1>.  Also adjust style
settings so that the resulting computed style remains the same for
div.rel.

(cherry picked from commit 21e14aed841e109b31a9f27c0e78751e450364f2)

ticket: 7557
version_fixed: 1.11.1
status: resolved
Fix typos in layout.html

There were multiple misplaced semicolons, etc.

(cherry picked from commit 95fc179c21cab802469907b2759f0e8bd1cafef1)

ticket: 7558
version_fixed: 1.11.1
status: resolved
Fix "search" accesskey in layout.html

The accesskey for the "search" link conflicted with the one for the
"contents" link.

(cherry picked from commit ba8a8a6b25027079ffd3e565a6e6ed450217a024)

ticket: 7559
version_fixed: 1.11.1
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: 7560
version_fixed: 1.11.1
status: resolved
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: 7561
version_fixed: 1.11.1
status: resolved
Fix RFC 5587 const pointer typedefs

gss_const_ctx_id_t, gss_const_cred_id_t, and gss_const_name_t are
supposed to be const pointers to the appropriate structures, not the
structures themselves.  These are not used by any prototypes yet, and
no application would have any reason to use them as they are, so it
should be safe to change them within the public header.

(cherry picked from commit 884e040c0478c94585395a03dfbb0bbdee7c5ed4)

ticket: 7567
version_fixed: 1.11.1
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: 7570
version_fixed: 1.11.1
status: resolved
Allow multi-hop SAM-2 exchanges

Prior to 1.11, it was possible to do SAM-2 preauth exchanges with
multiple hops by sending repeated preauth-required errors with
different challenges (which is not the way multi-hop exchanges are
described in RFC 6113, but it can still work).  This stopped working
when SAM-2 was converted to a built-in module because of the use_count
field.  Disable the use count for SAM-2 specifically.

ticket: 7571
version_fixed: 1.11.1
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: 7569
version_fixed: 1.11.1
status: resolved
Fix memory leak closing DIR ccaches

A ccache type's close function is supposed to free the cache container
as well as the type-specific data.  dcc_close was not doing so,
causing a small memory leak each time a ccache is created or
destroyed.

(cherry picked from commit c264c4e824e1abe77806e7bf43ab2641459b7ee9)

ticket: 7574
version_fixed: 1.11.1
status: resolved
Fix fd leak in DIR ccache cursor function

If dcc_ptcursor_next reached the end of a directory, it called free()
on the directory handle instead of closedir(), causing the directory
fd to be leaked.  Call closedir() instead.

(cherry picked from commit c29d5f61af301aa8993b01ed0e3eb4f529d6862c)

ticket: 7573
version_fixed: 1.11.1
status: resolved
Update acknowledgments in README

Also update copyright years.