Simplify crypto IOV helpers

Expand the concept of an IOV block state into a cursor which remembers
the IOV set being iterated over, the block size, and both input and
output positions.  Eliminate the no-copy inline block getter for now,
but provide helpers to grab contiguous chains of blocks from a cursor.
Also provide an inline helper to sum the total length of an iov chain.
Refactor AES, Camellia builtin enc providers

In preparation for AES-NI support, adjust the block encryption helpers
in the AES enc provider so that the cache is only touched by helpers,
and reframe the CTS operations in terms of CBC operations.  Change the
Camellia enc provider as well for consistency.
Add Intel AESNI assembly files

Add assembly files from the Intel AESNI Sample Library, version 1.2,
which implement AES encryption using AES-NI instructions.  Trailing
whitespace was removed.
Adjust AESNI sources for krb5 tree

Remove functions we don't need.  Add macros to redefine functions with
an appropriate namespace prefix.
Add AES-NI support on Linux

If yasm and cpuid.h are present on a Linux i686 or x64 system, compile
the modified Intel AES-NI assembly sources.  In the builtin AES enc
provider, check at runtime whether the CPU supports AES-NI
instructions and use the assembly functions if so.
Don't warn or error on variadic macros

Our portability assumptions now allow the use of variadic macros, so
don't warn or error on them.
Fix rc4 string-to-key on unterminated inputs

The internal UTF-8 to UCS-2 conversion functions did not properly
respect their length arguments, instead assuming that the input string
is terminated with a zero bytes.  As a result,
krb5int_arcfour_string_to_key could fail on unterminated inputs.  Fix
the underlying support functions to read their inputs only up to the
specified length.

ticket: 7643 (new)
Make empty passwords work via init_creds APIs

In the gak_data value used by krb5_get_as_key_password, separate the
already-known password from the storage we might have allocated to put
it in, so that we no longer use an empty data buffer to determine
whether we know the password.  This allows empty passwords to work via
the API.

Remove the kadm5 test which explicitly uses an empty password.

Based on a patch from Stef Walter.

ticket: 7642
Fix non-builtin crypto module builds

Commit 4b0985f8573840838bcfa8ec1df3dcd39a3dbf15 went a bit too far in
pruning the placeholder makefiles for the openssl and nss crypto
modules.  We need enough boilerplate to create OBJS.SH in each
directory.
Change message macro for configure selection

AC_MSG_RESULT is to print result after AC_MSG_CHECKING.
AC_MSG_NOTICE is to deliver message to user.
So use AC_MSG_NOTICE for --with options.

Remove overquoting too.

ticket: 7648
Properly handle use_master in k5_init_creds_get

If we make multiple requests in an initial creds exchange, the
krb5_sendto_kdc call in k5_init_creds_get may flip the use_master
value from 0 to 1 if it detects that the response was from a master
KDC.  Don't turn this into a requirement for future requests during
the same exchange, or we may have trouble following AS referrals.
Reported by Sumit Bose.

ticket: 7650
Link dbtest with libkrb5support

In a static build, linking dbtest could fail on platforms where libdb2
depends on krb5support (platforms without a native mkstemp).  Reported
by Gilles Espinasse <g.esp@free.fr>.

ticket: 7651
Fix warnings in dbtest.c

Check return values of read() and write().  Avoid some unsigned
comparisons.  Cast a ptrdiff_t value to int for use with %d in a
format string.

[ghudson@mit.edu: rewrap long lines; fix one more warning; commit
message]
Document preauth flags for service principals

These flags are overloaded to mean different things for clients and
servers; previously we only documented the client behavior.

ticket: 7653 (new)
tags: pullup
target_version: 1.11.4
Clarify retiring-des based on user feedback

Explain why DES keys should be removed from principals, and clarify
that allow_weak_crypto overrides all other configuration.

ticket: 7654 (new)
tags: pullup
target_version: 1.11.4
Clean up dangling antecedent in allow_weak_crypto

The "previous three lists" are not previous any more.
Say explicitly which three lists, and make the parenthetical bind
to the correct noun.

ticket: 7655 (new)
tags: pullup
target_version: 1.11.4
Fix spurious clock skew caused by preauth delay

Commit 37b0e55e21926c7875b7176e24e13005920915a6 (#7063) prevented
clock skew caused by preauth delay by recording the time of the
initial request.  However, it failed to take into account delay
between requests due to prompting during preauthentication.  Fix this
by recording the request time for each request.

ticket: 7656 (new)
Untabify and reindent t_authpkinit.py
Refactor AS-REQ nonce and timestamp handling

Create helper functions to set the request nonce and to set the
request timestamp.  Don't bother picking a nonce in
restart_init_creds_loop since we will just pick a new one in
init_creds_step_request.  Create a library-internal function to get
the current time with possible adjustment from a preauth-required
error.  Only set ctx->request_time in one place (just before encoding
each request).  Remove unused parameters from stash_as_reply.

Partially based on a patch from Stef Walter.
Use KDC clock skew for AS-REQ timestamps

Calculate request timestamps each time we encode a request, and use
the adjusted current time when calculating them, including adjustments
resulting from preauth-required errors early in the AS exchange.

As a side effect, this reverts one of the changes in commit
37b0e55e21926c7875b7176e24e13005920915a6 (#7063); we will once again
use the time adjustment from any ccache we read before the AS
exchange, if we don't have a more specific adjustment from a
preauth-required error.

Based on a patch from Stef Walter.

ticket: 7657 (new)