This routine formats a KRB_AP_REQ message
into outbuf, with more complete options
The outbuf, ap_req_options, auth_context,
and ccache arguments are used in the same
fashion as for krb5_mk_req.
The in_creds argument is used to
supply the credentials (ticket and session key) needed to form the
If in_creds->ticket has
no data (length == 0), then an error is returned.
During a call to this routine, the structure elements in in_creds may
be freed and reallocated. Hence all of the structure elements which
are pointers should point to allocated memory, and there should
be no other pointers aliased to the same memory, since it may be
deallocated during this routine call.
If ap_req_options specifies AP_OPTS_USE_SUBKEY,
then a subkey will be generated if need be by krb5_generate_subkey.
A copy of the authenticator will be stored in the auth_context,
with the principal and checksum fields nulled out, unless an error
is returned. (This is to prevent pointer-sharing problems; the
caller should not need these fields anyway, since the caller supplied