Simplify LDAP password decoding

Make dec_password a static function in ldap_service_stash.c and remove
some impedance mismatch with krb5_ldap_readpassword() by making it
operate on C strings and return a krb5_error_code.
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.

ticket: 7560 (new)
target_version: 1.11.1
tags: pullup
Simplify kdb5_util create using a null password

kadm5_create_principal now uses a random key if passed a null
password, so we don't need a multi-step process to create admin
principals when creating a database any more.
Add more tests for dump and load

Move the existing dump/load tests from t_general.py to a new script
t_dump.py.  Add additional tests using pre-created dumpfiles, to
exercise the -r18, -r13, -b7, and -ov formats.

bigredbutton: whitespace
Remove -b6 and -old dump formats

Get rid of the code to dump and load -b6 and -old format dump files.
Loading these versions hasn't worked since at least 1.3.

ticket: 7564 (new)
Reorder dump.c

Without changing anything (except to make a few internal functions
static), reorder dump.c to bottom-up order so that forward function
declarations aren't needed.
Refactor dump.c

When dumping, use a common iterator function to unpack the dump_args
structure, unparse and filter the principal name, and convert master
keys.  Add helper functions to dump and load the "octets or -1" format
used for optional binary fields in the current dump format.
Modernize dump.c

Reformat and simplify dump.c code according to current coding
standards.  No functional changes except for some error messages.
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.

ticket: 7561
target_version: 1.11.1
tags: pullup
Add kprop Python tests

Create a K5Realm.kprop_port method so test scripts can invoke kprop
usefully, and create a simple Python test script exercising the same
kprop functionality as the dejagnu suite's kprop.exp.
Desupport krb5_auth_con_setivector

ticket: 7565 (new)
Replace i_vector with cstate in auth context

Use a proper cipher state in the auth context structure, and free it
when the auth context is freed.  Simplify mk_priv/rd_priv accordingly.
Modernize send_tgs.c

Bring send_tgs.c up to date with current coding practices.  No
functional changes.
Simplify TGS request construction

Move krb5int_make_tgs_request from gc_via_tkt.c into send_tgs.c,
combine it with krb5int_make_tgs_request_ext (which nothing else
called), and rename the combined function to k5_make_tgs_req.  Also
use a typedef for the pacb callback.
Add and use k5memdup, k5memdup0 helpers

Add k5-int.h static functions to duplicate byte ranges, optionally
with a trailing zero byte, and set an error code like k5alloc does.
Use them where they would shorten existing code.
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.

ticket: 7567 (new)
target_version: 1.11.1
tags: pullup
Make internal JSON functions return error codes

Return error codes (0, ENOMEM, or EINVAL) from JSON support functions
instead of returning results directly.  This makes error handling
simpler for functions which assemble JSON objects and then return a
krb5_error_code values.  Adjust all callers.  Use shims in
export_cred.c to minimize changes there; it will be redesigned
internally in a subsequent commit.
Add k5_json_array_fmt and use it in export_cred.c

Add a template-based array constructor for convenient marshalling of
structured values as JSON array values.  Use it to simplify
export_cred.c.
Modernize k5buf

Rename the krb5int_buf_ family of functions to use the k5_ prefix for
brevity.  Reformat some k5buf implementation code to match current
practices.
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]

ticket: 7569 (new)
target_version: 1.11.1
tags: pullup