Change __signed to signed.
[dragonfly.git] / crypto / kerberosIV / lib / krb / get_svc_in_tkt.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 "krb_locl.h"
23
24 RCSID("$Id: get_svc_in_tkt.c,v 1.9 1999/06/29 21:18:04 bg Exp $");
25
26 /*
27  * This file contains two routines: srvtab_to_key(), which gets
28  * a server's key from a srvtab file, and krb_get_svc_in_tkt() which
29  * gets an initial ticket for a server.
30  */
31
32 /*
33  * srvtab_to_key(): given a "srvtab" file (where the keys for the
34  * service on a host are stored), return the private key of the
35  * given service (user.instance@realm).
36  *
37  * srvtab_to_key() passes its arguments on to read_service_key(),
38  * plus one additional argument, the key version number.
39  * (Currently, the key version number is always 0; this value
40  * is treated as a wildcard by read_service_key().)
41  *
42  * If the "srvtab" argument is null, KEYFILE (defined in "krb.h")
43  * is passed in its place.
44  *
45  * It returns the return value of the read_service_key() call.
46  * The service key is placed in "key".
47  */
48
49 int 
50 srvtab_to_key(const char *user,
51               char *instance,
52               const char *realm,
53               const void *srvtab,
54               des_cblock *key)
55 {
56     if (!srvtab)
57         srvtab = KEYFILE;
58
59     return(read_service_key(user, instance, realm, 0, (char *)srvtab,
60                             (char *)key));
61 }
62
63 /*
64  * krb_get_svc_in_tkt() passes its arguments on to krb_get_in_tkt(),
65  * plus two additional arguments: a pointer to the srvtab_to_key()
66  * function to be used to get the key from the key file and a NULL
67  * for the decryption procedure indicating that krb_get_in_tkt should 
68  * use the default method of decrypting the response from the KDC.
69  *
70  * It returns the return value of the krb_get_in_tkt() call.
71  */
72
73 int
74 krb_get_svc_in_tkt(char *user, char *instance, char *realm, char *service,
75                    char *sinstance, int life, char *srvtab)
76 {
77     return(krb_get_in_tkt(user, instance, realm, service, sinstance,
78                           life, srvtab_to_key, NULL, srvtab));
79 }