17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate * lib/krb5/rcache/rc_conv.c
37c478bd9Sstevel@tonic-gate *
47c478bd9Sstevel@tonic-gate * This file of the Kerberos V5 software is derived from public-domain code
57c478bd9Sstevel@tonic-gate * contributed by Daniel J. Bernstein, <brnstnd@acf10.nyu.edu>.
67c478bd9Sstevel@tonic-gate *
77c478bd9Sstevel@tonic-gate */
87c478bd9Sstevel@tonic-gate
97c478bd9Sstevel@tonic-gate
107c478bd9Sstevel@tonic-gate /*
117c478bd9Sstevel@tonic-gate * An implementation for the default replay cache type.
127c478bd9Sstevel@tonic-gate */
137c478bd9Sstevel@tonic-gate
14*159d09a2SMark Phalan /* Solaris Kerberos - resync */
15*159d09a2SMark Phalan #define FREE_RC(x) ((void) free((char *) (x)))
167c478bd9Sstevel@tonic-gate
177c478bd9Sstevel@tonic-gate #include "rc_base.h"
187c478bd9Sstevel@tonic-gate
197c478bd9Sstevel@tonic-gate /*
207c478bd9Sstevel@tonic-gate Local stuff:
217c478bd9Sstevel@tonic-gate krb5_auth_to_replay(context, krb5_tkt_authent *auth,krb5_donot_replay *rep)
227c478bd9Sstevel@tonic-gate given auth, take important information and make rep; return -1 if failed
237c478bd9Sstevel@tonic-gate */
247c478bd9Sstevel@tonic-gate
257c478bd9Sstevel@tonic-gate krb5_error_code
krb5_auth_to_rep(krb5_context context,krb5_tkt_authent * auth,krb5_donot_replay * rep)26505d05c7Sgtb krb5_auth_to_rep(krb5_context context, krb5_tkt_authent *auth, krb5_donot_replay *rep)
277c478bd9Sstevel@tonic-gate {
287c478bd9Sstevel@tonic-gate krb5_error_code retval;
297c478bd9Sstevel@tonic-gate rep->cusec = auth->authenticator->cusec;
307c478bd9Sstevel@tonic-gate rep->ctime = auth->authenticator->ctime;
317c478bd9Sstevel@tonic-gate if ((retval = krb5_unparse_name(context, auth->ticket->server, &rep->server)))
327c478bd9Sstevel@tonic-gate return retval; /* shouldn't happen */
337c478bd9Sstevel@tonic-gate if ((retval = krb5_unparse_name(context, auth->authenticator->client,
347c478bd9Sstevel@tonic-gate &rep->client))) {
35*159d09a2SMark Phalan FREE_RC(rep->server);
367c478bd9Sstevel@tonic-gate return retval; /* shouldn't happen. */
377c478bd9Sstevel@tonic-gate }
387c478bd9Sstevel@tonic-gate return 0;
397c478bd9Sstevel@tonic-gate }
40