Export krb5_set_trace_callback/filename

krb5_set_trace_callback and krb5_set_trace_filename were added to
krb5.h in krb5 1.9, but were mistakenly left out of the library export
lists.  Add them now.  Reported by Russ Allbery.

ticket: 7143
target_version: 1.10.2
tags: pullup
Make doc/coding-style point to wiki page

The old doc/coding-style file was out of date; replace its content
with a pointer to the wiki page.

ticket: 7147 (new)
Export gss_mech_krb5_wrong from libgssapi_krb5

Although there are few legitimate reasons to use gss_mech_krb5_wrong,
it's declared in the public header and exported in the Windows DLL.
So export it from the Unix library as well.

ticket: 7148 (new)
target_version: 1.10.2
tags: pullup
Modified the Sphinx HTML page layout

1. The Feedback button is moved into the footer;
2. The default page/doc width are set to 960px;
Document "{keytab}" trace format specifier
Add support for "{ptype}" trace format specifier

Add the "{ptype}" trace format specifier, for principal name types.
Also document the new option in the "k5-trace.h" comments.

ticket: 7151
Add tests for trace.c formatting

This improves the previously minimal test coverage of "trace.c".

ticket: 7151
Convert DEBUG_REFERRALS to TRACE_* framework

The referrals debugging code under DEBUG_REFERRALS ceased building
correctly at some point.  Convert this debugging code to use the
tracing framework instead, including adding new trace macros to
k5-trace.h.

ticket: 7151
Fix S4U user identification in preauth case

In 1.10, encrypted timestamp became a built-in module instead of a
hardcoded padata handler.  This changed the behavior of
krb5_get_init_creds as invoked by s4u_identify_user such that
KRB5_PREAUTH_FAILED is returned instead of the gak function's error.
(Module failures are not treated as hard errors, while hardcoded
padata handler errors are.)  Accordingly, we should look for
KRB5_PREAUTH_FAILED in s4u_identify_user.

On a less harmful note, the gak function was returning a protocol
error code instead of a com_err code, and the caller was testing for a
different protocol error code (KDC_ERR_PREAUTH_REQUIRED) which could
never be returned by krb5_get_init_creds.  Clean up both of those by
returning KRB5_PREAUTH_FAILED from the gak function and testing for
that alone.

Reported by Michael Morony.

ticket: 7136
target_version: 1.10.2
tags: pullup
Fix TRACE_GET_CRED_VIA_TKT_EXT format string
Null pointer deref in kadmind [CVE-2012-1013]

The fix for #6626 could cause kadmind to dereference a null pointer if
a create-principal request contains no password but does contain the
KRB5_KDB_DISALLOW_ALL_TIX flag (e.g. "addprinc -randkey -allow_tix
name").  Only clients authorized to create principals can trigger the
bug.  Fix the bug by testing for a null password in check_1_6_dummy.

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

[ghudson@mit.edu: Minor style change and commit message]

ticket: 7152
target_version: 1.10.2
tags: pullup
Add a copy of the BSD <sys/queue.h> as k5-queue.h

queue.h implements various types of linked lists as cpp macros,
without needing any library support.
Use a hash table in the KDC lookaside cache

Add a hash table to kdc/replay.c for fast lookup of incoming packets.
Continue to keep a time-ordered linked list of all entries for fast
expiry of stale entries.  The preprocessor constant
LOOKASIDE_HASH_SIZE can be used to change the size of the hash table.