aboutsummaryrefslogtreecommitdiff
path: root/src/lib/krb5/rcache/rc_conv.c
blob: 8eb73ccbe8756e525b3be7a16ca9b6ca36e4cfb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * lib/krb5/rcache/rc_conv.c
 *
 * This file of the Kerberos V5 software is derived from public-domain code
 * contributed by Daniel J. Bernstein, <brnstnd@acf10.nyu.edu>.
 *
 */


/*
 * An implementation for the default replay cache type.
 */

#define FREE(x) ((void) free((char *) (x)))

#include "rc_base.h"

/*
Local stuff:
 krb5_auth_to_replay(context, krb5_tkt_authent *auth,krb5_donot_replay *rep)
  given auth, take important information and make rep; return -1 if failed
*/

krb5_error_code
krb5_auth_to_rep(krb5_context context, krb5_tkt_authent *auth, krb5_donot_replay *rep)
{
 krb5_error_code retval;
 rep->cusec = auth->authenticator->cusec;
 rep->ctime = auth->authenticator->ctime;
 if ((retval = krb5_unparse_name(context, auth->ticket->server, &rep->server)))
   return retval; /* shouldn't happen */
 if ((retval = krb5_unparse_name(context, auth->authenticator->client,
				 &rep->client))) {
     FREE(rep->server);
     return retval; /* shouldn't happen. */
 }
 return 0;
}