From 28e005930b59f2d80cf84b1bc0822b5cb9b0ea31 Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Wed, 6 Sep 1995 03:25:49 +0000 Subject: [PATCH] * adm_adm_func.c, adm_fmt_inq.c, adm_funcs.c, adm_process.c, * adm_server.c, adm_v4_pwd.c adm_v4_pwd.c: Remove krb5_enctype references, and replace with krb5_keytype where appropriate. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6671 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin.old/server/ChangeLog | 6 ++++ src/kadmin.old/server/adm_adm_func.c | 10 +++---- src/kadmin.old/server/adm_fmt_inq.c | 2 +- src/kadmin.old/server/adm_funcs.c | 4 +-- src/kadmin.old/server/adm_process.c | 4 +-- src/kadmin.old/server/adm_server.c | 44 ++++++++++------------------ src/kadmin.old/server/adm_v4_pwd.c | 2 +- 7 files changed, 33 insertions(+), 39 deletions(-) diff --git a/src/kadmin.old/server/ChangeLog b/src/kadmin.old/server/ChangeLog index 5db374d9c..819293bd9 100644 --- a/src/kadmin.old/server/ChangeLog +++ b/src/kadmin.old/server/ChangeLog @@ -1,4 +1,10 @@ +Tue Sep 05 22:10:34 1995 Chris Provenzano (proven@mit.edu) + + * adm_adm_func.c, adm_fmt_inq.c, adm_funcs.c, adm_process.c, + * adm_server.c, adm_v4_pwd.c adm_v4_pwd.c: Remove krb5_enctype + references, and replace with krb5_keytype where appropriate. + Mon Aug 21 17:05:18 EDT 1995 Paul Park (pjpark@mit.edu) * adm_server.c - Change dbm_db_set_name to db_set_name. Interpret -k and -e arguments as strings instead of string representations diff --git a/src/kadmin.old/server/adm_adm_func.c b/src/kadmin.old/server/adm_adm_func.c index 2f09cde7a..58eff881c 100644 --- a/src/kadmin.old/server/adm_adm_func.c +++ b/src/kadmin.old/server/adm_adm_func.c @@ -111,7 +111,7 @@ adm_build_key (context, auth_context, new_passwd, oper_type, entry) key_data = (krb5_key_data *) NULL; if (krb5_dbe_find_keytype(context, &entry, - KEYTYPE_DES, + KEYTYPE_DES_CBC_MD5, ((oper_type == CHGOPER) ? KRB5_KDB_SALTTYPE_NORMAL : KRB5_KDB_SALTTYPE_V4), @@ -603,28 +603,28 @@ adm_mod_old_key(context, auth_context, cmdname, customer_name) */ if (!krb5_dbe_find_keytype(context, &entry, - KEYTYPE_DES, + KEYTYPE_DES_CBC_MD5, KRB5_KDB_SALTTYPE_NORMAL, -1, &kdata)) kdata->key_data_kvno = atoi(tempstr); if (!krb5_dbe_find_keytype(context, &entry, - KEYTYPE_DES, + KEYTYPE_DES_CBC_CRC, KRB5_KDB_SALTTYPE_V4, -1, &kdata)) kdata->key_data_kvno = atoi(tempstr); if (!krb5_dbe_find_keytype(context, &entry, - KEYTYPE_DES, + KEYTYPE_DES_CBC_MD5, KRB5_KDB_SALTTYPE_NOREALM, -1, &kdata)) kdata->key_data_kvno = atoi(tempstr); if (!krb5_dbe_find_keytype(context, &entry, - KEYTYPE_DES, + KEYTYPE_DES_CBC_MD5, KRB5_KDB_SALTTYPE_ONLYREALM, -1, &kdata)) diff --git a/src/kadmin.old/server/adm_fmt_inq.c b/src/kadmin.old/server/adm_fmt_inq.c index 94a1fc52a..3ff13a9c3 100644 --- a/src/kadmin.old/server/adm_fmt_inq.c +++ b/src/kadmin.old/server/adm_fmt_inq.c @@ -171,7 +171,7 @@ adm_fmt_prt(context, entry, Principal_name, ret_data) pkey = (krb5_key_data *) NULL; if (retval = krb5_dbe_find_keytype(context, entry, - KEYTYPE_DES, + KEYTYPE_DES_CBC_MD5, KRB5_KDB_SALTTYPE_NORMAL, -1, &pkey)) { diff --git a/src/kadmin.old/server/adm_funcs.c b/src/kadmin.old/server/adm_funcs.c index 2e612c906..1bf841c9e 100644 --- a/src/kadmin.old/server/adm_funcs.c +++ b/src/kadmin.old/server/adm_funcs.c @@ -47,8 +47,8 @@ struct saltblock { }; static const krb5_key_salt_tuple keysalts[] = { -{ KEYTYPE_DES, KRB5_KDB_SALTTYPE_NORMAL }, -{ KEYTYPE_DES, KRB5_KDB_SALTTYPE_V4 } +{ KEYTYPE_DES_CBC_MD5, KRB5_KDB_SALTTYPE_NORMAL }, +{ KEYTYPE_DES_CBC_CRC, KRB5_KDB_SALTTYPE_V4 } }; static const krb5_int32 n_keysalts = sizeof(keysalts) / sizeof(keysalts[0]); diff --git a/src/kadmin.old/server/adm_process.c b/src/kadmin.old/server/adm_process.c index 98ab5ac1f..abab60aba 100644 --- a/src/kadmin.old/server/adm_process.c +++ b/src/kadmin.old/server/adm_process.c @@ -82,7 +82,7 @@ cpw_keyproc(context, keyblock) /* Find our key */ if (retval = krb5_dbe_find_keytype(context, &cpw_entry, - KEYTYPE_DES, + KEYTYPE_DES_CBC_MD5, -1, -1, &kdatap)) { @@ -210,7 +210,7 @@ process_client(context, prog) /* Find our key */ if (retval = krb5_dbe_find_keytype(context, &server_entry, - KEYTYPE_DES, + KEYTYPE_DES_CBC_MD5, -1, -1, &kdatap)) { diff --git a/src/kadmin.old/server/adm_server.c b/src/kadmin.old/server/adm_server.c index ae67a8ee1..547c40693 100644 --- a/src/kadmin.old/server/adm_server.c +++ b/src/kadmin.old/server/adm_server.c @@ -121,8 +121,7 @@ process_args(context, argc, argv) int keytypedone = 0; char *mkey_name = 0; char *local_realm; - krb5_enctype etype; - krb5_enctype kdc_etype = DEFAULT_KDC_ETYPE; + krb5_keytype ktype; #ifdef SANDIA char input_string[80]; @@ -165,12 +164,6 @@ process_args(context, argc, argv) } break; - case 'e': - if (krb5_string_to_enctype(optarg, &kdc_etype)) - fprintf(stderr, "%s: %s is an invalid encryption type\n", - argv[0], optarg); - break; - case 'k': /* keytype for master key */ if (!krb5_string_to_keytype(optarg, &master_keyblock.keytype)) keytypedone++; @@ -222,7 +215,7 @@ process_args(context, argc, argv) } if (!keytypedone) { - master_keyblock.keytype = KEYTYPE_DES; + master_keyblock.keytype = KEYTYPE_DES_CBC_MD5; } /* assemble & parse the master key name */ @@ -234,12 +227,7 @@ process_args(context, argc, argv) exit(1); } - if (!valid_etype(kdc_etype)) { - com_err(argv[0], KRB5_PROG_ETYPE_NOSUPP, - "while setting up etype %d", kdc_etype); - exit(1); - } - krb5_use_cstype(context, &master_encblock, kdc_etype); + krb5_use_keytype(context, &master_encblock, master_keyblock.keytype); if ((retval = krb5_db_fetch_mkey(context, master_princ, @@ -254,15 +242,15 @@ process_args(context, argc, argv) } /* initialize random key generators */ - for (etype = 0; etype <= krb5_max_cryptosystem; etype++) { - if (krb5_csarray[etype]) { - if ((retval = (*krb5_csarray[etype]->system-> + for (ktype = 0; ktype <= krb5_max_keytype; ktype++) { + if (krb5_keytype_array[ktype]) { + if (retval = (*krb5_keytype_array[ktype]->system-> init_random_key)(&master_keyblock, - &krb5_csarray[etype]->random_sequence))) { + &krb5_keytype_array[ktype]->random_sequence)) { com_err(argv[0], retval, - "while setting up random key generator for etype %d--etype disabled", - etype); - krb5_csarray[etype] = 0; + "while setting up random key generator for ktype %d--ktype disabled", + ktype); + krb5_keytype_array[ktype] = 0; } } } @@ -366,12 +354,12 @@ init_db(context, dbname, masterkeyname, masterkeyblock) convert server.key into a real key (it may be encrypted in the database) */ - if ((retval = krb5_dbe_find_keytype(context, - &server_entry, - KEYTYPE_DES, - -1, - -1, - &kdatap))) { + if (retval = krb5_dbe_find_keytype(context, + &server_entry, + KEYTYPE_DES_CBC_MD5, + -1, + -1, + &kdatap)) { krb5_db_free_principal(context, &server_entry, number_of_entries); (void) krb5_finish_key(context, &master_encblock); memset((char *)&master_encblock, 0, sizeof(master_encblock)); diff --git a/src/kadmin.old/server/adm_v4_pwd.c b/src/kadmin.old/server/adm_v4_pwd.c index b74d92372..8728092cc 100644 --- a/src/kadmin.old/server/adm_v4_pwd.c +++ b/src/kadmin.old/server/adm_v4_pwd.c @@ -357,7 +357,7 @@ int *outlen; return(1); } - v5_keyblock->keytype = KEYTYPE_DES; + v5_keyblock->keytype = KEYTYPE_DES_CBC_MD5; v5_keyblock->length = 8; if (!(v5_keyblock->contents = (krb5_octet *) calloc (1, 8))) { -- 2.26.2