call krb5_c_ versions of enctype/cksumtype checking routines
authorKen Raeburn <raeburn@mit.edu>
Sat, 6 Apr 2002 01:47:59 +0000 (01:47 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sat, 6 Apr 2002 01:47:59 +0000 (01:47 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14367 dc483132-0cff-0310-8789-dd5450dbe970

23 files changed:
src/kadmin/dbutil/ChangeLog
src/kadmin/dbutil/kdb5_stash.c
src/kadmin/dbutil/kdb5_util.c
src/kadmin/dbutil/loadv4.c
src/kdc/ChangeLog
src/kdc/do_as_req.c
src/kdc/do_tgs_req.c
src/kdc/kdc_util.c
src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/decrypt_tk.c
src/lib/krb5/krb/encode_kdc.c
src/lib/krb5/krb/gc_frm_kdc.c
src/lib/krb5/krb/gic_keytab.c
src/lib/krb5/krb/in_tkt_ktb.c
src/lib/krb5/krb/in_tkt_sky.c
src/lib/krb5/krb/init_ctx.c
src/lib/krb5/krb/mk_safe.c
src/lib/krb5/krb/rd_safe.c
src/lib/krb5/krb/send_tgs.c
src/tests/create/ChangeLog
src/tests/create/kdb5_mkdums.c
src/tests/verify/ChangeLog
src/tests/verify/kdb5_verify.c

index de2ba00d716ffe54b44f6192d518615c74ba45c0..af9b18496956ee03289eab8f41dd1bb85241b14d 100644 (file)
@@ -1,3 +1,10 @@
+2002-04-05  Ken Raeburn  <raeburn@mit.edu>
+
+       * kdb5_stash.c (kdb5_stash): Call krb5_c_valid_enctype instead of
+       valid_enctype.
+       * kdb5_util.c (main, open_db_and_mkey): Likewise.
+       * loadv4.c (load_v4db): Likewise.
+
 2002-01-08  Sam Hartman  <hartmans@mit.edu>
 
        * kdb5_create.c (kdb5_create): Load strong random data
index 0c6aed5ca423011bdee384496b35aefd96ab6bdc..37db048ac8ab6748a72a951da3634e612d7e1f70 100644 (file)
@@ -70,8 +70,8 @@ extern int close_policy_db;
 
 void
 kdb5_stash(argc, argv)
-int argc;
-char *argv[];
+    int argc;
+    char *argv[];
 {
     extern char *optarg;
     extern int optind;
@@ -110,7 +110,7 @@ char *argv[];
        }
     }
 
-    if (!valid_enctype(master_keyblock.enctype)) {
+    if (!krb5_c_valid_enctype(master_keyblock.enctype)) {
        char tmp[32];
        if (krb5_enctype_to_string(master_keyblock.enctype, tmp, sizeof(tmp)))
            com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP,
index d44f867147138d1b3e21a56ac64e7ba63a2be494..bace2fae426477fcc28edfd2a5a7a918de1887ce 100644 (file)
@@ -230,7 +230,7 @@ int main(argc, argv)
 
     master_keyblock.enctype = global_params.enctype;
     if ((master_keyblock.enctype != ENCTYPE_UNKNOWN) &&
-       (!valid_enctype(master_keyblock.enctype))) {
+       (!krb5_c_valid_enctype(master_keyblock.enctype))) {
        com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP,
                "while setting up enctype %d", master_keyblock.enctype);
     }
@@ -369,7 +369,7 @@ static int open_db_and_mkey()
        /* If no encryption type is set, use the default */
        if (master_keyblock.enctype == ENCTYPE_UNKNOWN) {
            master_keyblock.enctype = DEFAULT_KDC_ENCTYPE;
-           if (!valid_enctype(master_keyblock.enctype))
+           if (!krb5_c_valid_enctype(master_keyblock.enctype))
                com_err(progname, KRB5_PROG_KEYTYPE_NOSUPP,
                        "while setting up enctype %d",
                        master_keyblock.enctype);
index 74710884ccf717b1d17c8b98029fe16b55740c38..7ddba43c04aaf10e17dcfa6ad0811a222f4a7e67 100644 (file)
@@ -154,8 +154,8 @@ static krb5_principal_data db_create_princ = {
 
 void
 load_v4db(argc, argv)
-int argc;
-char *argv[];
+    int argc;
+    char *argv[];
 {
     krb5_error_code retval;
     /* The kdb library will default to this, but it is convenient to
@@ -247,7 +247,7 @@ char *argv[];
        return;
     }
 
-    if (!valid_enctype(master_keyblock.enctype)) {
+    if (!krb5_c_valid_enctype(master_keyblock.enctype)) {
        com_err(PROGNAME, KRB5_PROG_KEYTYPE_NOSUPP,
                "while setting up enctype %d", master_keyblock.enctype);
        krb5_free_context(context);
index 9a70906801a8dce07f745c96fae30fb3134e4d42..1805af0977b7274374b767f4025718fdeffed200 100644 (file)
@@ -1,3 +1,11 @@
+2002-04-05  Ken Raeburn  <raeburn@mit.edu>
+
+       * do_as_req.c (process_as_req): Call krb5_c_valid_enctype instead
+       of valid_enctype.
+       * do_tgs_req.c (process_tgs_req): Likewise.
+       * kdc_util.c (select_session_keytype): Likewise.
+       (comp_cksum): Similarly for valid_cksumtype, is_coll_proof_cksum.
+
 2002-02-20  Ken Raeburn  <raeburn@mit.edu>
 
        * network.c: Include foreachaddr.c.
index 8ccada4c70b0a71531cbc7c582e48eef94bc66c1..45ef811787e9db3f908439a1514a94f2d5b3a9c3 100644 (file)
@@ -51,10 +51,10 @@ static krb5_error_code prepare_error_as (krb5_kdc_req *, int, krb5_data *,
 /*ARGSUSED*/
 krb5_error_code
 process_as_req(request, from, portnum, response)
-register krb5_kdc_req *request;
-const krb5_fulladdr *from;             /* who sent it ? */
-int    portnum;
-krb5_data **response;                  /* filled in with a response packet */
+    krb5_kdc_req *request;
+    const krb5_fulladdr *from; /* who sent it ? */
+    int        portnum;
+    krb5_data **response;      /* filled in with a response packet */
 {
 
     krb5_db_entry client, server;
@@ -338,7 +338,7 @@ krb5_data **response;                       /* filled in with a response packet */
     client_key = (krb5_key_data *) NULL;
     for (i = 0; i < request->nktypes; i++) {
        useenctype = request->ktype[i];
-       if (!valid_enctype(useenctype))
+       if (!krb5_c_valid_enctype(useenctype))
            continue;
 
        if (!krb5_dbe_find_enctype(kdc_context, &client, useenctype, -1,
index 2da823cbe1143e388eccb84aa9502bd002ed5a72..ce1047947df5e2be0cccdad068283e9e99807320 100644 (file)
@@ -238,7 +238,7 @@ tgt_again:
        }
        
        etype = request->second_ticket[st_idx]->enc_part2->session->enctype;
-       if (!valid_enctype(etype)) {
+       if (!krb5_c_valid_enctype(etype)) {
            status = "BAD_ETYPE_IN_2ND_TKT";
            errcode = KRB5KDC_ERR_ETYPE_NOSUPP;
            goto cleanup;
index c0c35dad4617d68ebc2e86de171a51378c75cffe..779d0a80fc46c6d19ff39051aef14553e5d033ab 100644 (file)
@@ -179,11 +179,11 @@ comp_cksum(kcontext, source, ticket, his_cksum)
     krb5_error_code      retval;
     krb5_boolean         valid;
 
-    if (!valid_cksumtype(his_cksum->checksum_type)) 
+    if (!krb5_c_valid_cksumtype(his_cksum->checksum_type)) 
        return KRB5KDC_ERR_SUMTYPE_NOSUPP;
 
     /* must be collision proof */
-    if (!is_coll_proof_cksum(his_cksum->checksum_type))
+    if (!krb5_c_is_coll_proof_cksum(his_cksum->checksum_type))
        return KRB5KRB_AP_ERR_INAPP_CKSUM;
 
     /* verify checksum */
@@ -1456,7 +1456,7 @@ select_session_keytype(context, server, nktypes, ktype)
     int                i;
     
     for (i = 0; i < nktypes; i++) {
-       if (!valid_enctype(ktype[i]))
+       if (!krb5_c_valid_enctype(ktype[i]))
            continue;
 
        if (!krb5_is_permitted_enctype(context, ktype[i]))
index f2d3ac21f7fe14879775ddb836f3bdd9b98a5cfc..9e062c3e7b20686ac77bda56adca73ce5e499abe 100644 (file)
@@ -1,3 +1,21 @@
+2002-04-05  Ken Raeburn  <raeburn@mit.edu>
+
+       * decrypt_tk.c (krb5_decrypt_tkt_part): Call krb5_c_valid_enctype
+       instead of valid_enctype.
+       * encode_kdc.c (krb5_encode_kdc_rep): Likewise.
+       * gc_frm_kdc.c (krb5_get_cred_from_kdc_opt): Likewise.
+       * gic_keytab.c (krb5_get_as_key_keytab): Likewise.
+       * in_tkt_ktb.c (keytab_keyproc): Likewise.
+       * in_tkt_sky.c (skey_keyproc): Likewise.
+       * init_ctx.c (krb5_set_default_in_tkt_ktypes,
+       krb5_set_default_tgs_enctypes): Likewise.
+       * send_tgs.c (krb5_send_tgs): Likewise.
+
+       * mk_safe.c (krb5_mk_safe_basic): Call krb5_c_valid_cksumtype,
+       krb5_c_is_coll_proof_cksum, krb5_c_is_keyed_cksum instead of
+       non-prefixed forms.
+       * rd_safe.c (krb5_rd_safe_basic): Likewise.
+
 2002-03-28  Sam Hartman  <hartmans@mit.edu>
 
        * Makefile.in :  New file init_keyblock.c
index c8b35d4429a4cc37d9c5f502432d5ec5edb30bb4..d1c44ba02d3f8cddc3f45f8ebd5fb50b13b1972e 100644 (file)
@@ -48,7 +48,7 @@ krb5_decrypt_tkt_part(context, srv_key, ticket)
     krb5_data scratch;
     krb5_error_code retval;
 
-    if (!valid_enctype(ticket->enc_part.enctype))
+    if (!krb5_c_valid_enctype(ticket->enc_part.enctype))
        return KRB5_PROG_ETYPE_NOSUPP;
 
     scratch.length = ticket->enc_part.ciphertext.length;
index 3b0410dd316200c33d71cae929e0b4de202d4c47..fb19f3fc41312f463bde1852858825e2198d085c 100644 (file)
@@ -59,7 +59,7 @@ krb5_encode_kdc_rep(context, type, encpart, using_subkey, client_key,
     krb5_enc_kdc_rep_part tmp_encpart;
     krb5_keyusage usage;
 
-    if (!valid_enctype(dec_rep->enc_part.enctype))
+    if (!krb5_c_valid_enctype(dec_rep->enc_part.enctype))
        return KRB5_PROG_ETYPE_NOSUPP;
 
     switch (type) {
index 25ae0a601896f8761378bde054277f37f3f8d410..26f195b264b8d44687c7be3d5789a12f717730e7 100644 (file)
@@ -230,7 +230,7 @@ krb5_get_cred_from_kdc_opt(context, ccache, in_cred, out_cred, tgts, kdcopt)
        /* didn't find it in the cache so try and get one */
        /* with current tgt.                              */
     
-       if (!valid_enctype(tgt.keyblock.enctype)) {
+       if (!krb5_c_valid_enctype(tgt.keyblock.enctype)) {
            retval = KRB5_PROG_ETYPE_NOSUPP;
            goto cleanup;
        }
@@ -291,7 +291,7 @@ krb5_get_cred_from_kdc_opt(context, ccache, in_cred, out_cred, tgts, kdcopt)
   
              /* not in the cache so try and get one with our current tgt. */
   
-             if (!valid_enctype(tgt.keyblock.enctype)) {
+             if (!krb5_c_valid_enctype(tgt.keyblock.enctype)) {
                  retval = KRB5_PROG_ETYPE_NOSUPP;
                  goto cleanup;
              }
@@ -375,7 +375,7 @@ krb5_get_cred_from_kdc_opt(context, ccache, in_cred, out_cred, tgts, kdcopt)
 
   /* got/finally have tgt!  try for the creds */
 
-  if (!valid_enctype(tgt.keyblock.enctype)) {
+  if (!krb5_c_valid_enctype(tgt.keyblock.enctype)) {
     retval = KRB5_PROG_ETYPE_NOSUPP;
     goto cleanup;
   }
index 461940657c5f8cfa2e9dc9e6f84011112a5794aa..4fd0aed9330b980178bdc2e42dcda9c000131e30 100644 (file)
@@ -28,7 +28,7 @@ krb5_get_as_key_keytab(
        as_key->length = 0;
     }
 
-    if (!valid_enctype(etype))
+    if (!krb5_c_valid_enctype(etype))
        return(KRB5_PROG_ETYPE_NOSUPP);
 
     if ((ret = krb5_kt_get_entry(context, keytab, client,
index 9991c970934e78825e5d12d523144094e9b24d53..5d8cf3c6de175521fa2454ccb0386b2ed199e641 100644 (file)
@@ -64,7 +64,7 @@ keytab_keyproc(context, type, salt, keyseed, key)
 
     kt_id = arg->keytab;
 
-    if (!valid_enctype(type))
+    if (!krb5_c_valid_enctype(type))
        return KRB5_PROG_ETYPE_NOSUPP;
 
     if (kt_id == NULL)
index 245a03243cab50373c64f469ce04cb6bbfa031bb..168ada566777ea108dc615d0f84b63363d9fc583 100644 (file)
@@ -61,7 +61,7 @@ skey_keyproc(context, type, salt, keyseed, key)
 
     keyblock = (const krb5_keyblock *)keyseed;
 
-    if (!valid_enctype(type))
+    if (!krb5_c_valid_enctype(type))
        return KRB5_PROG_ETYPE_NOSUPP;
 
     if ((retval = krb5_copy_keyblock(context, keyblock, &realkey)))
index 79a1cb09e344a587a341e2f6bbaad3eca2ca2bdd..c2477c5e22dbb2bdd0fbcf1eeabef8d3234c3ea1 100644 (file)
@@ -273,7 +273,7 @@ krb5_set_default_in_tkt_ktypes(context, ktypes)
 
     if (ktypes) {
        for (i = 0; ktypes[i]; i++) {
-           if (!valid_enctype(ktypes[i])) 
+           if (!krb5_c_valid_enctype(ktypes[i])) 
                return KRB5_PROG_ETYPE_NOSUPP;
        }
 
@@ -400,7 +400,7 @@ krb5_set_default_tgs_enctypes (context, ktypes)
 
     if (ktypes) {
        for (i = 0; ktypes[i]; i++) {
-           if (!valid_enctype(ktypes[i])) 
+           if (!krb5_c_valid_enctype(ktypes[i])) 
                return KRB5_PROG_ETYPE_NOSUPP;
        }
 
index eef712007adb26b604ac9c7d2e82181de26580a3..d34f88668a6bab422429a144ba082977bdaf224e 100644 (file)
@@ -64,9 +64,10 @@ krb5_mk_safe_basic(context, userdata, keyblock, replaydata, local_addr,
     krb5_checksum safe_checksum;
     krb5_data *scratch1, *scratch2;
 
-    if (!valid_cksumtype(sumtype))
+    if (!krb5_c_valid_cksumtype(sumtype))
        return KRB5_PROG_SUMTYPE_NOSUPP;
-    if (!is_coll_proof_cksum(sumtype) || !is_keyed_cksum(sumtype))
+    if (!krb5_c_is_coll_proof_cksum(sumtype)
+       || !krb5_c_is_keyed_cksum(sumtype))
        return KRB5KRB_AP_ERR_INAPP_CKSUM;
 
     safemsg.user_data = *userdata;
index a7f87b23da10f83126b5a381ee9314d5dcd65831..200a338cb342704a38cb15cf3f96b18bc4f2fdba 100644 (file)
@@ -70,12 +70,12 @@ krb5_rd_safe_basic(context, inbuf, keyblock, recv_addr, sender_addr,
     if ((retval = decode_krb5_safe(inbuf, &message)))
        return retval;
 
-    if (!valid_cksumtype(message->checksum->checksum_type)) {
+    if (!krb5_c_valid_cksumtype(message->checksum->checksum_type)) {
        retval = KRB5_PROG_SUMTYPE_NOSUPP;
        goto cleanup;
     }
-    if (!is_coll_proof_cksum(message->checksum->checksum_type) ||
-       !is_keyed_cksum(message->checksum->checksum_type)) {
+    if (!krb5_c_is_coll_proof_cksum(message->checksum->checksum_type) ||
+       !krb5_c_is_keyed_cksum(message->checksum->checksum_type)) {
        retval = KRB5KRB_AP_ERR_INAPP_CKSUM;
        goto cleanup;
     }
index 452600201316862d4057ffeea1776753396328ce..341296cb33e09b1e9e4a5895be2d611bff7bfedb 100644 (file)
@@ -197,7 +197,7 @@ krb5_send_tgs(context, kdcoptions, timestruct, ktypes, sname, addrs,
     if (ktypes) {
        /* Check passed ktypes and make sure they're valid. */
        for (tgsreq.nktypes = 0; ktypes[tgsreq.nktypes]; tgsreq.nktypes++) {
-           if (!valid_enctype(ktypes[tgsreq.nktypes]))
+           if (!krb5_c_valid_enctype(ktypes[tgsreq.nktypes]))
                return KRB5_PROG_ETYPE_NOSUPP;
        }
        tgsreq.ktype = (krb5_enctype *)ktypes;
index c9e18d510f8fd4bc9967f125aa2529ba97201a37..7c24a40db139310323c95392dd0612c9aabb38de 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-05  Ken Raeburn  <raeburn@mit.edu>
+
+       * kdb5_mkdums.c (main): Call krb5_c_valid_enctype instead of
+       valid_enctype.
+
 2001-11-19  Ezra Peisach  <epeisach@mit.edu>
 
        * kdb5_mkdums.c (main): Invoke krb5_free_context when finished. 
index 32753958044195c9712669be3e08e6784f2f7984..d9c34062da0a006be993d8c4ee627ec5541ebf0a 100644 (file)
@@ -81,8 +81,8 @@ void add_princ (krb5_context, char *);
 
 int
 main(argc, argv)
-int argc;
-char *argv[];
+    int argc;
+    char *argv[];
 {
     extern char *optarg;       
     int optchar, i, n;
@@ -159,7 +159,7 @@ char *argv[];
     if (!enctypedone)
        master_keyblock.enctype = DEFAULT_KDC_ENCTYPE;
 
-    if (!valid_enctype(master_keyblock.enctype)) {
+    if (!krb5_c_valid_enctype(master_keyblock.enctype)) {
        com_err(progname, KRB5_PROG_ETYPE_NOSUPP,
                "while setting up enctype %d", master_keyblock.enctype);
        exit(1);
index 39c3982c2154d93f1a6be61bd782eadb28fea459..6ce4abd064918e538acdbcf7f6b46aef2e03073a 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-05  Ken Raeburn  <raeburn@mit.edu>
+
+       * kdb5_verify.c (main): Call krb5_c_valid_enctype instead of
+       valid_enctype.
+
 2001-11-19  Ezra Peisach  <epeisach@mit.edu>
 
        * kdb5_verify.c (main): Use krb5_free_unparsed_name() to free up
index 1127c7fda09b516d4da0510286fe9bd9556da78e..878104d0a7fd7cf615690f9d8745ca7990b9c0d7 100644 (file)
@@ -82,8 +82,8 @@ int check_princ (krb5_context, char *);
 
 int
 main(argc, argv)
-int argc;
-char *argv[];
+    int argc;
+    char *argv[];
 {
     extern char *optarg;       
     int optchar, i, n;
@@ -153,7 +153,7 @@ char *argv[];
     if (!enctypedone)
        master_keyblock.enctype = DEFAULT_KDC_ENCTYPE;
 
-    if (!valid_enctype(master_keyblock.enctype)) {
+    if (!krb5_c_valid_enctype(master_keyblock.enctype)) {
        com_err(progname, KRB5_PROG_ETYPE_NOSUPP,
                "while setting up enctype %d", master_keyblock.enctype);
        exit(1);