diff options
author | John Kohl <jtkohl@mit.edu> | 1990-02-03 17:21:00 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1990-02-03 17:21:00 +0000 |
commit | 39ec875a72e0c927be58696b9ac56f19e5f1ac4d (patch) | |
tree | 2cc3e5e68e8b83b0a0f6f1fd56a543221edf47d0 /src/kdc | |
parent | b85d249d4e3a3084c855004f2ecc4431f7882ac0 (diff) | |
download | krb5-39ec875a72e0c927be58696b9ac56f19e5f1ac4d.tar.gz krb5-39ec875a72e0c927be58696b9ac56f19e5f1ac4d.tar.xz krb5-39ec875a72e0c927be58696b9ac56f19e5f1ac4d.zip |
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@261 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kdc')
-rw-r--r-- | src/kdc/main.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/kdc/main.c b/src/kdc/main.c new file mode 100644 index 0000000000..b652e2b39d --- /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 + * <krb5/mit-copyright.h>. + * + * Main procedure body for the KDC server process. + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_main_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/copyright.h> + +/* + 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; +} |