1 #pragma ident	"%Z%%M%	%I%	%E% SMI"
2 /*
3  * lib/krb5/rcache/rc_conv.c
4  *
5  * This file of the Kerberos V5 software is derived from public-domain code
6  * contributed by Daniel J. Bernstein, <brnstnd@acf10.nyu.edu>.
7  *
8  */
9 
10 
11 /*
12  * An implementation for the default replay cache type.
13  */
14 
15 
16 #include "rc_base.h"
17 
18 /*
19 Local stuff:
20  krb5_auth_to_replay(context, krb5_tkt_authent *auth,krb5_donot_replay *rep)
21   given auth, take important information and make rep; return -1 if failed
22 */
23 
24 krb5_error_code
25 krb5_auth_to_rep(krb5_context context, krb5_tkt_authent *auth, krb5_donot_replay *rep)
26 {
27  krb5_error_code retval;
28  rep->cusec = auth->authenticator->cusec;
29  rep->ctime = auth->authenticator->ctime;
30  if ((retval = krb5_unparse_name(context, auth->ticket->server, &rep->server)))
31    return retval; /* shouldn't happen */
32  if ((retval = krb5_unparse_name(context, auth->authenticator->client,
33 				 &rep->client))) {
34      free(rep->server);
35      return retval; /* shouldn't happen. */
36  }
37  return 0;
38 }
39