Annotation of 43BSDReno/kerberosIV/krb/get_svc_in_tkt.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * $Source: /usr/src/kerberosIV/krb/RCS/get_svc_in_tkt.c,v $
        !             3:  * $Author: kfall $
        !             4:  *
        !             5:  * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
        !             6:  *
        !             7:  * For copying and distribution information, please see the file
        !             8:  * <mit-copyright.h>.
        !             9:  */
        !            10: 
        !            11: #ifndef lint
        !            12: static char rcsid_get_svc_in_tkt_c[] =
        !            13: "$Header: /usr/src/kerberosIV/krb/RCS/get_svc_in_tkt.c,v 4.10 90/06/25 20:56:10 kfall Exp $";
        !            14: #endif /* lint */
        !            15: 
        !            16: #include <mit-copyright.h>
        !            17: #include <des.h>
        !            18: #include <krb.h>
        !            19: #include <prot.h>
        !            20: 
        !            21: #ifndef NULL
        !            22: #define NULL 0
        !            23: #endif
        !            24: 
        !            25: /*
        !            26:  * This file contains two routines: srvtab_to_key(), which gets
        !            27:  * a server's key from a srvtab file, and krb_get_svc_in_tkt() which
        !            28:  * gets an initial ticket for a server.
        !            29:  */
        !            30: 
        !            31: /*
        !            32:  * srvtab_to_key(): given a "srvtab" file (where the keys for the
        !            33:  * service on a host are stored), return the private key of the
        !            34:  * given service (user.instance@realm).
        !            35:  *
        !            36:  * srvtab_to_key() passes its arguments on to read_service_key(),
        !            37:  * plus one additional argument, the key version number.
        !            38:  * (Currently, the key version number is always 0; this value
        !            39:  * is treated as a wildcard by read_service_key().)
        !            40:  *
        !            41:  * If the "srvtab" argument is null, KEYFILE (defined in "krb.h")
        !            42:  * is passed in its place.
        !            43:  *
        !            44:  * It returns the return value of the read_service_key() call.
        !            45:  * The service key is placed in "key".
        !            46:  */
        !            47: 
        !            48: static int srvtab_to_key(user, instance, realm, srvtab, key)
        !            49:     char *user, *instance, *realm, *srvtab;
        !            50:     C_Block key;
        !            51: {
        !            52:     if (!srvtab)
        !            53:         srvtab = KEYFILE;
        !            54: 
        !            55:     return(read_service_key(user, instance, realm, 0, srvtab,
        !            56:                             (char *)key));
        !            57: }
        !            58: 
        !            59: /*
        !            60:  * krb_get_svc_in_tkt() passes its arguments on to krb_get_in_tkt(),
        !            61:  * plus two additional arguments: a pointer to the srvtab_to_key()
        !            62:  * function to be used to get the key from the key file and a NULL
        !            63:  * for the decryption procedure indicating that krb_get_in_tkt should 
        !            64:  * use the default method of decrypting the response from the KDC.
        !            65:  *
        !            66:  * It returns the return value of the krb_get_in_tkt() call.
        !            67:  */
        !            68: 
        !            69: krb_get_svc_in_tkt(user, instance, realm, service, sinstance, life, srvtab)
        !            70:     char *user, *instance, *realm, *service, *sinstance;
        !            71:     int life;
        !            72:     char *srvtab;
        !            73: {
        !            74:     return(krb_get_in_tkt(user, instance, realm, service, sinstance,
        !            75:                           life, srvtab_to_key, NULL, srvtab));
        !            76: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.