From: John Kohl Date: Sat, 3 Feb 1990 17:21:00 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: krb5-1.0-alpha2~1122 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=39ec875a72e0c927be58696b9ac56f19e5f1ac4d;p=krb5.git *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@261 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/main.c b/src/kdc/main.c new file mode 100644 index 000000000..b652e2b39 --- /dev/null +++ b/src/kdc/main.c @@ -0,0 +1,76 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Main procedure body for the KDC server process. + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_main_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include + +/* + outline: + + initialize database access (fetch master key, open DB) + + initialize network + + loop: + listen for packet + + determine packet type, dispatch to handling routine + (AS or TGS (or V4?)) + + reflect response + + exit on signal + + clean up secrets + + shut down network + + exit + */ + +krb5_error_code +init_db(dbname, masterkeyname, masterkeyblock) +char *dbname; +krb5_principal masterkeyname; +krb5_keyblock *masterkeyblock; +{ + krb5_error_code retval; + krb5_db_entry master_entry; + + /* set db name if appropriate */ + if (dbname && (retval = krb5_db_set_name(dbname))) + return(retval); + + /* initialize database */ + if (retval = krb5_db_init()) + return(retval); + + master_encblock.crypto_entry = &krb5_des_cs_entry; + + if (retval = krb5_db_verify_master_key(masterkeyname, masterkeyblock)) { + master_encblock.crypto_entry = 0; + return(retval); + } + + /* do any necessary key pre-processing */ + if (retval = (*master_encblock.crypto_entry-> + process_key)(&eblock, masterkeyblock)) { + master_encblock.crypto_entry = 0; + return(retval); + } + + return 0; +}