Tighten up error handling for fill_token_identity

Don't let our unconditional cleanup corrupt the minor status.

Change-Id: I092440e82f18ae7486fe49db4d2abfe36a209e59
Factor out rxgk_nonce

Produce a random nonce in an RXGK_Data, of the specified length.
Use to produce the client and server nonce for key negotiation.

Change-Id: Ibd80f4e496bfccafa0bde8ca6a4d6025469c52ea
Do not pretend to support multi-hop mechs

We don't really have a way to maintain an acceptor GSS context across
RPC calls at the moment, and this makes the code simpler.

Change-Id: I17cb0fa7f4c5d0821d18cdeb9b31c01897f3a44a
Remove the local opaque

It was a hack to pretend to support multi-hop mechs, but we should
really use a proper XDR type for that purpose when we do support it.

Change-Id: I32e93071709edba0b70e48b73d9ebe8ec822a540
Use a struct instead of separate variables

We have an RXGK_TokenInfo structure that describes the parameters
of a token.  Use it, instead of separate variables for enctype,
level, lifetime, and bytelife.  This will make factoring out helper
routines easier.

Change-Id: Icf89ead53754a4b2f9570d99719434dc9b060df9
Make localinlfo the authority for expiration/errorcode

All other users should be seeded from it.

Change-Id: Ic5eb510327560ce0018676e615081a35b1bd5345
Wrap TokenInfo->ClientInfo propagation in a function

No need to use multiple lines in the main code for this.

Change-Id: Ibf9b50b118e297cc94bcb0373859fb1745111505
Factor out determining the expiration time

Shorten up the main routine, and give us a place to put further
administrative checks.

Change-Id: Ib2213b6dc0eacc2ca9a1a630a040f514cc6653b6
Condense token creation from tokeninfo fields

Use a function call instead of a bunch of assignments.

Change-Id: I5a6635d5fb009d364861e9be54dc3f35bd3bbb34
Factor out token creation

First create the single identity that we'll produce for a token
from GSSNegotiate, then make the token from a tokeninfo and key and such.

We no longer need a token local in SRXGK_GSSNegotiate, as make_token()
returns the token already encrypted.

Change-Id: I7a9a9a768eb602a0df75079afdc09372ef0c5eaf
s/make_wrap_token/pack_wrap_token

It's packing/encoding the token, not filling its contents.

Change-Id: If6e9d5b36fddc289a6445509e6077aa6cd1b4ba2
Tighten up SRXGK_GSSNegotiate error handling

Always free everything we allocate (or at least try to).
Be sure to initialize them so we don't try to free stack garbage.
Use the GSS error code fields as appropriate.

Change-Id: Iad26fa3c36df6a6a928951bc0428010127a8752a
Enforce the tokeninfo errorcode

Do not make a token if there is a policy error.
(There are not currently any places where a policy error is set.)

Change-Id: I774afa31abe1b9ec383164ce3b5410501e0e92d4