Initial import from FreeBSD RELENG_4:
[dragonfly.git] / crypto / kerberosIV / lib / kdb / print_princ.c
1 /* 
2   Copyright (C) 1989 by the Massachusetts Institute of Technology
3
4    Export of this software from the United States of America is assumed
5    to require a specific license from the United States Government.
6    It is the responsibility of any person or organization contemplating
7    export to obtain such a license before exporting.
8
9 WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
10 distribute this software and its documentation for any purpose and
11 without fee is hereby granted, provided that the above copyright
12 notice appear in all copies and that both that copyright notice and
13 this permission notice appear in supporting documentation, and that
14 the name of M.I.T. not be used in advertising or publicity pertaining
15 to distribution of the software without specific, written prior
16 permission.  M.I.T. makes no representations about the suitability of
17 this software for any purpose.  It is provided "as is" without express
18 or implied warranty.
19
20   */
21
22 #include "kdb_locl.h"
23
24 RCSID("$Id: print_princ.c,v 1.5 1997/05/07 01:37:13 assar Exp $");
25
26 void
27 krb_print_principal(Principal *a_n)
28 {
29     struct tm *time_p;
30
31     /* run-time database does not contain string versions */
32     time_p = k_localtime(&(a_n->exp_date));
33
34     fprintf(stderr,
35     "\n%s %s expires %4d-%2d-%2d %2d:%2d, max_life %d*5 = %d min  attr 0x%02x",
36     a_n->name, a_n->instance,
37     time_p->tm_year + 1900,
38     time_p->tm_mon + 1, time_p->tm_mday,
39     time_p->tm_hour, time_p->tm_min,
40     a_n->max_life, 5 * a_n->max_life, a_n->attributes);
41
42     fprintf(stderr,
43     "\n\tkey_ver %d  k_low 0x%08lx  k_high 0x%08lx  akv %d  exists %ld\n",
44     a_n->key_version, (long)a_n->key_low, (long)a_n->key_high,
45     a_n->kdc_key_ver, (long)a_n->old);
46
47     fflush(stderr);
48 }