From 34461f76af065f58d40001c50a727c22e32902b5 Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Wed, 6 Sep 1995 19:05:41 +0000 Subject: [PATCH] * do_as_req.c, do_tgs_req.c, kdc_util.c, kerberos_v4.c, main.c : s/keytype/enctype/g, s/KEYTYPE/ENCTYPE/g git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6709 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/ChangeLog | 4 +++ src/kdc/do_as_req.c | 24 +++++++++--------- src/kdc/do_tgs_req.c | 46 +++++++++++++++++----------------- src/kdc/kdc_util.c | 4 +-- src/kdc/kerberos_v4.c | 4 +-- src/kdc/main.c | 58 +++++++++++++++++++++---------------------- 6 files changed, 72 insertions(+), 68 deletions(-) diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index e10579008..4bf0779ec 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,7 @@ +Wed Sep 06 14:20:57 1995 Chris Provenzano (proven@mit.edu) + + * do_as_req.c, do_tgs_req.c, kdc_util.c, kerberos_v4.c, main.c : + s/keytype/enctype/g, s/KEYTYPE/ENCTYPE/g Tue Sep 05 22:10:34 1995 Chris Provenzano (proven@mit.edu) diff --git a/src/kdc/do_as_req.c b/src/kdc/do_as_req.c index 016eaffa4..94114f0c7 100644 --- a/src/kdc/do_as_req.c +++ b/src/kdc/do_as_req.c @@ -116,7 +116,7 @@ krb5_data **response; /* filled in with a response packet */ const char *status; krb5_encrypt_block eblock; krb5_key_data *server_key, *client_key; - krb5_keytype usekeytype; + krb5_enctype useenctype; #ifdef KRBCONF_KDC_MODIFIES_KDB krb5_boolean update_client = 0; #endif /* KRBCONF_KDC_MODIFIES_KDB */ @@ -204,10 +204,10 @@ krb5_data **response; /* filled in with a response packet */ } for (i = 0; i < request->nktypes; i++) { - if (!valid_keytype(request->ktype[i])) + if (!valid_enctype(request->ktype[i])) continue; - if (request->ktype[i] == KEYTYPE_DES_CBC_MD5 && + if (request->ktype[i] == ENCTYPE_DES_CBC_MD5 && !isflagset(server.attributes, KRB5_KDB_SUPPORT_DESMD5)) continue; @@ -215,7 +215,7 @@ krb5_data **response; /* filled in with a response packet */ * Find the server key of the appropriate type. If we could specify * a kvno, it would be supplied here. */ - if (!krb5_dbe_find_keytype(kdc_context, &server, request->ktype[i], + if (!krb5_dbe_find_enctype(kdc_context, &server, request->ktype[i], -1, /* Ignore salttype */ -1, /* Get highest kvno */ &server_key)) @@ -225,15 +225,15 @@ krb5_data **response; /* filled in with a response packet */ /* unsupported ktype */ krb5_klog_syslog(LOG_INFO,"AS_REQ: BAD ENCRYPTION TYPE: host %s, %s for %s", fromstring, cname, sname); - retval = prepare_error_as(request, KDC_ERR_KEYTYPE_NOSUPP, 0, response); + retval = prepare_error_as(request, KDC_ERR_ENCTYPE_NOSUPP, 0, response); goto errout; got_a_key:; - usekeytype = request->ktype[i]; - krb5_use_keytype(kdc_context, &eblock, request->ktype[i]); + useenctype = request->ktype[i]; + krb5_use_enctype(kdc_context, &eblock, request->ktype[i]); if ((retval = krb5_random_key(kdc_context, &eblock, - krb5_keytype_array[usekeytype]->random_sequence, + krb5_enctype_array[useenctype]->random_sequence, &session_key))) { /* random key failed */ krb5_klog_syslog(LOG_INFO,"AS_REQ: RANDOM KEY FAILED: host %s, %s for %s", @@ -402,9 +402,9 @@ got_a_key:; krb5_key_salt_tuple *kslist; kslist = (krb5_key_salt_tuple *) kdc_active_realm->realm_kstypes; - if (!krb5_dbe_find_keytype(kdc_context, + if (!krb5_dbe_find_enctype(kdc_context, &client, - kslist[i].ks_keytype, + kslist[i].ks_enctype, kslist[i].ks_salttype, -1, &client_key)) @@ -415,7 +415,7 @@ got_a_key:; krb5_klog_syslog(LOG_INFO, "AS_REQ: CANNOT FIND CLIENT KEY: host %s, %s for %s", fromstring, cname, sname); - retval = prepare_error_as(request, KDC_ERR_KEYTYPE_NOSUPP, 0, response); + retval = prepare_error_as(request, KDC_ERR_ENCTYPE_NOSUPP, 0, response); goto errout; } @@ -489,7 +489,7 @@ got_a_key:; /* now encode/encrypt the response */ - reply.enc_part.keytype = usekeytype; + reply.enc_part.enctype = useenctype; reply.enc_part.kvno = client_key->key_data_kvno; /* convert client.key_data into a real key */ diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c index 16a16fb27..8f97b417e 100644 --- a/src/kdc/do_tgs_req.c +++ b/src/kdc/do_tgs_req.c @@ -63,7 +63,7 @@ krb5_data **response; /* filled in with a response packet */ { krb5_keyblock * subkey; krb5_encrypt_block eblock; - krb5_keytype second_ticket_ktype = KEYTYPE_UNKNOWN; + krb5_enctype second_ticket_ktype = ENCTYPE_UNKNOWN; krb5_kdc_req *request = 0; krb5_db_entry server; krb5_kdc_rep reply; @@ -83,7 +83,7 @@ krb5_data **response; /* filled in with a response packet */ char *cname = 0, *sname = 0, *tmp = 0, *fromstring = 0; krb5_last_req_entry *nolrarray[2], nolrentry; /* krb5_address *noaddrarray[1]; */ - krb5_keytype usekeytype; + krb5_enctype useenctype; int errcode, errcode2; register int i; int firstpass = 1; @@ -210,26 +210,26 @@ tgt_again: * use to encrypt the ticket! */ if (isflagset(request->kdc_options, KDC_OPT_ENC_TKT_IN_SKEY)) - second_ticket_ktype = request->second_ticket[st_idx]->enc_part.keytype; + second_ticket_ktype = request->second_ticket[st_idx]->enc_part.enctype; for (i = 0; i < request->nktypes; i++) { - krb5_keytype ok_keytype; + krb5_enctype ok_enctype; - if (!valid_keytype(request->ktype[i])) + if (!valid_enctype(request->ktype[i])) continue; - if (second_ticket_ktype != KEYTYPE_UNKNOWN && + if (second_ticket_ktype != ENCTYPE_UNKNOWN && second_ticket_ktype != request->ktype[i]) continue; - if (request->ktype[i] == KEYTYPE_DES_CBC_MD5 && + if (request->ktype[i] == ENCTYPE_DES_CBC_MD5 && !isflagset(server.attributes, KRB5_KDB_SUPPORT_DESMD5)) continue; - ok_keytype = request->ktype[i]; + ok_enctype = request->ktype[i]; for (ok_key_data = 0; ok_key_data < server.n_key_data; ok_key_data++) - if (server.key_data[ok_key_data].key_data_type[0] == ok_keytype) + if (server.key_data[ok_key_data].key_data_type[0] == ok_enctype) goto got_a_key; } @@ -239,10 +239,10 @@ tgt_again: goto cleanup; got_a_key:; - usekeytype = request->ktype[i]; - krb5_use_keytype(kdc_context, &eblock, usekeytype); + useenctype = request->ktype[i]; + krb5_use_enctype(kdc_context, &eblock, useenctype); retval = krb5_random_key(kdc_context, &eblock, - krb5_keytype_array[usekeytype]->random_sequence, + krb5_enctype_array[useenctype]->random_sequence, &session_key); if (retval) { /* random key failed */ @@ -390,15 +390,15 @@ got_a_key:; krb5_data scratch; /* decrypt the authdata in the request */ - if (!valid_keytype(request->authorization_data.keytype)) { + if (!valid_enctype(request->authorization_data.enctype)) { status = "BAD_AUTH_ETYPE"; errcode = KRB5KDC_ERR_ETYPE_NOSUPP; goto cleanup; } /* put together an eblock for this encryption */ - krb5_use_keytype(kdc_context, &eblock, - request->authorization_data.keytype); + krb5_use_enctype(kdc_context, &eblock, + request->authorization_data.enctype); scratch.length = request->authorization_data.ciphertext.length; if (!(scratch.data = @@ -535,9 +535,9 @@ got_a_key:; } ticket_reply.enc_part.kvno = 0; - ticket_reply.enc_part.keytype = - request->second_ticket[st_idx]->enc_part2->session->keytype; - krb5_use_keytype(kdc_context, &eblock, ticket_reply.enc_part.keytype); + ticket_reply.enc_part.enctype = + request->second_ticket[st_idx]->enc_part2->session->enctype; + krb5_use_enctype(kdc_context, &eblock, ticket_reply.enc_part.enctype); if ((retval = krb5_encrypt_tkt_part(kdc_context, &eblock, request->second_ticket[st_idx]->enc_part2->session, &ticket_reply))) { @@ -556,8 +556,8 @@ got_a_key:; } ticket_reply.enc_part.kvno = server.key_data[ok_key_data].key_data_kvno; - ticket_reply.enc_part.keytype = usekeytype; - krb5_use_keytype(kdc_context, &eblock, ticket_reply.enc_part.keytype); + ticket_reply.enc_part.enctype = useenctype; + krb5_use_enctype(kdc_context, &eblock, ticket_reply.enc_part.enctype); retval = krb5_encrypt_tkt_part(kdc_context, &eblock, &encrypting_key, &ticket_reply); @@ -602,9 +602,9 @@ got_a_key:; /* use the session key in the ticket, unless there's a subsession key in the AP_REQ */ - reply.enc_part.keytype = subkey ? subkey->keytype : - header_ticket->enc_part2->session->keytype; - krb5_use_keytype(kdc_context, &eblock, reply.enc_part.keytype); + reply.enc_part.enctype = subkey ? subkey->enctype : + header_ticket->enc_part2->session->enctype; + krb5_use_enctype(kdc_context, &eblock, reply.enc_part.enctype); retval = krb5_encode_kdc_rep(kdc_context, KRB5_TGS_REP, &reply_encpart, &eblock, subkey ? subkey : diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index ada0325c7..4291bb744 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -367,9 +367,9 @@ kdc_get_server_key(ticket, key, kvno) krb5_key_salt_tuple *kslist; kslist = (krb5_key_salt_tuple *) kdc_active_realm->realm_kstypes; - if (!krb5_dbe_find_keytype(kdc_context, + if (!krb5_dbe_find_enctype(kdc_context, &server, - kslist[i].ks_keytype, + kslist[i].ks_enctype, -1, -1, &server_key)) diff --git a/src/kdc/kerberos_v4.c b/src/kdc/kerberos_v4.c index 490375c3c..b724c976e 100644 --- a/src/kdc/kerberos_v4.c +++ b/src/kdc/kerberos_v4.c @@ -387,9 +387,9 @@ kerb_get_principal(name, inst, principal, maxn, more) return(nprinc); } - if (krb5_dbe_find_keytype(kdc_context, + if (krb5_dbe_find_enctype(kdc_context, &entries, - KEYTYPE_DES_CBC_CRC, + ENCTYPE_DES_CBC_CRC, KRB5_KDB_SALTTYPE_V4, -1, &pkey)) { diff --git a/src/kdc/main.c b/src/kdc/main.c index c1cf5bf58..54bf69c3b 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -342,13 +342,13 @@ finish_realm(rdp) */ static krb5_error_code init_realm(progname, rdp, realm, def_dbname, def_mpname, - def_keytype, def_port, def_sport, def_manual) + def_enctype, def_port, def_sport, def_manual) char *progname; kdc_realm_t *rdp; char *realm; char *def_dbname; char *def_mpname; - krb5_keytype def_keytype; + krb5_enctype def_enctype; krb5_int32 def_port; krb5_int32 def_sport; krb5_boolean def_manual; @@ -395,12 +395,12 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, KRB5_KDB_M_NAME; /* Handle master key type */ - if (rparams && rparams->realm_keytype_valid) - rdp->realm_mkey.keytype = - (krb5_keytype) rparams->realm_keytype; + if (rparams && rparams->realm_enctype_valid) + rdp->realm_mkey.enctype = + (krb5_enctype) rparams->realm_enctype; else - rdp->realm_mkey.keytype = (def_keytype) ? def_keytype : - KEYTYPE_DES_CBC_CRC; + rdp->realm_mkey.enctype = (def_enctype) ? def_enctype : + ENCTYPE_DES_CBC_CRC; /* Handle KDC port */ if (rparams && rparams->realm_kdc_pport_valid) @@ -453,7 +453,7 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, */ if ((kslist = (krb5_key_salt_tuple *) malloc(sizeof(krb5_key_salt_tuple)))) { - kslist->ks_keytype = KEYTYPE_DES_CBC_CRC; + kslist->ks_enctype = ENCTYPE_DES_CBC_CRC; kslist->ks_salttype = KRB5_KDB_SALTTYPE_NORMAL; rdp->realm_kstypes = kslist; rdp->realm_nkstypes = 1; @@ -494,8 +494,8 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, } /* Select the specified encryption type */ - krb5_use_keytype(rdp->realm_context, &rdp->realm_encblock, - rdp->realm_mkey.keytype); + krb5_use_enctype(rdp->realm_context, &rdp->realm_encblock, + rdp->realm_mkey.enctype); /* * Get the master key. @@ -570,9 +570,9 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, */ kdata = (krb5_key_data *) NULL; for (i=0; irealm_context, + if ((kret = krb5_dbe_find_enctype(rdp->realm_context, &db_entry, - kslist[i].ks_keytype, + kslist[i].ks_enctype, -1, -1, &kdata))) @@ -639,9 +639,9 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, */ kdata = (krb5_key_data *) NULL; for (i=0; irealm_context, + if ((kret = krb5_dbe_find_enctype(rdp->realm_context, &db_entry, - kslist[i].ks_keytype, + kslist[i].ks_enctype, -1, -1, &kdata))) @@ -669,21 +669,21 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, } } if (!rkey_init_done) { - krb5_keytype keytype; + krb5_enctype enctype; /* * If all that worked, then initialize the random key * generators. */ - for (keytype = 0; keytype <= krb5_max_keytype; keytype++) { - if (krb5_keytype_array[keytype]) { - if ((kret = (*krb5_keytype_array[keytype]->system-> + for (enctype = 0; enctype <= krb5_max_enctype; enctype++) { + if (krb5_enctype_array[enctype]) { + if ((kret = (*krb5_enctype_array[enctype]->system-> init_random_key) (&rdp->realm_mkey, - &krb5_keytype_array[keytype]->random_sequence))) { + &krb5_enctype_array[enctype]->random_sequence))) { com_err(progname, kret, - "while setting up random key generator for keytype %d--keytype disabled", - keytype); - krb5_keytype_array[keytype] = 0; + "while setting up random key generator for enctype %d--enctype disabled", + enctype); + krb5_enctype_array[enctype] = 0; } } } @@ -732,7 +732,7 @@ void usage(name) char *name; { - fprintf(stderr, "usage: %s [-d dbpathname] [-r dbrealmname] [-R replaycachename ]\n\t[-m] [-k masterkeytype] [-M masterkeyname] [-p port] [-n]\n", name); + fprintf(stderr, "usage: %s [-d dbpathname] [-r dbrealmname] [-R replaycachename ]\n\t[-m] [-k masterenctype] [-M masterkeyname] [-p port] [-n]\n", name); return; } @@ -748,7 +748,7 @@ initialize_realms(kcontext, argc, argv) char *rcname = KDCRCACHE; char *lrealm; krb5_error_code retval; - krb5_keytype mkeytype = KEYTYPE_DES_CBC_CRC; + krb5_enctype menctype = ENCTYPE_DES_CBC_CRC; kdc_realm_t *rdatap; krb5_boolean manual = FALSE; krb5_int32 pport, sport; @@ -766,7 +766,7 @@ initialize_realms(kcontext, argc, argv) if (!find_realm_data(optarg, (krb5_ui_4) strlen(optarg))) { if ((rdatap = (kdc_realm_t *) malloc(sizeof(kdc_realm_t)))) { if ((retval = init_realm(argv[0], rdatap, optarg, db_name, - mkey_name, mkeytype, pport, sport, + mkey_name, menctype, pport, sport, manual))) { fprintf(stderr,"%s: cannot initialize realm %s\n", argv[0], optarg); @@ -789,9 +789,9 @@ initialize_realms(kcontext, argc, argv) case 'n': nofork++; /* don't detach from terminal */ break; - case 'k': /* keytype for master key */ - if (krb5_string_to_keytype(optarg, &mkeytype)) - com_err(argv[0], 0, "invalid keytype %s", optarg); + case 'k': /* enctype for master key */ + if (krb5_string_to_enctype(optarg, &menctype)) + com_err(argv[0], 0, "invalid enctype %s", optarg); break; case 'R': rcname = optarg; @@ -821,7 +821,7 @@ initialize_realms(kcontext, argc, argv) } if ((rdatap = (kdc_realm_t *) malloc(sizeof(kdc_realm_t)))) { if ((retval = init_realm(argv[0], rdatap, lrealm, db_name, - mkey_name, mkeytype, pport, sport, + mkey_name, menctype, pport, sport, manual))) { fprintf(stderr,"%s: cannot initialize realm %s\n", argv[0], lrealm); -- 2.26.2