From: Ken Raeburn Date: Wed, 1 Sep 1999 21:47:24 +0000 (+0000) Subject: testcase fixes from 1.1 branch: X-Git-Tag: krb5-1.2-beta1~253 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cdb1b0fc4869d3a6362b6c8f3bed7b6644d9a926;p=krb5.git testcase fixes from 1.1 branch: * t_kdb.c (add_principal): Free only contents of a generated key, since the keyblock structure itself is on the stack. * t_kdb.c (add_principal): Update for new calling sequence to krb5_dbekd_encrypt_key_data. (do_testing): Update calls. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11775 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index c655c178f..42d640c11 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,14 @@ +1999-08-30 Ken Raeburn + + * t_kdb.c (add_principal): Free only contents of a generated key, + since the keyblock structure itself is on the stack. + +1999-08-17 Ken Raeburn + + * t_kdb.c (add_principal): Update for new calling sequence to + krb5_dbekd_encrypt_key_data. + (do_testing): Update calls. + 1998-11-13 Theodore Ts'o * Makefile.in: Set the myfulldir and mydir variables (which are diff --git a/src/lib/kdb/t_kdb.c b/src/lib/kdb/t_kdb.c index b14152602..aef50ee1c 100644 --- a/src/lib/kdb/t_kdb.c +++ b/src/lib/kdb/t_kdb.c @@ -273,16 +273,16 @@ principal_found(nvalid, pname) * Add a principal to the database. */ static krb5_error_code -add_principal(kcontext, principal, eblock, key, rseed) +add_principal(kcontext, principal, mkey, key, rseed) krb5_context kcontext; krb5_principal principal; - krb5_encrypt_block * eblock; + krb5_keyblock * mkey; krb5_keyblock * key; krb5_pointer rseed; { krb5_error_code kret; krb5_db_entry dbent; - krb5_keyblock * rkey = NULL; + krb5_keyblock * rkey = NULL, lkey; krb5_timestamp timenow; int nentries = 1; @@ -304,19 +304,21 @@ add_principal(kcontext, principal, eblock, key, rseed) goto out; if (!key) { - if ((kret = krb5_random_key(kcontext, eblock, rseed, &rkey))) + kret = krb5_c_make_random_key (kcontext, mkey->enctype, &lkey); + if (kret) goto out; + rkey = &lkey; } else rkey = key; if ((kret = krb5_dbe_create_key_data(kcontext, &dbent))) goto out; - if ((kret = krb5_dbekd_encrypt_key_data(kcontext, eblock, rkey, NULL, 1, + if ((kret = krb5_dbekd_encrypt_key_data(kcontext, mkey, rkey, NULL, 1, &dbent.key_data[0]))) goto out; if (!key) - krb5_free_keyblock(kcontext, rkey); + krb5_free_keyblock_contents(kcontext, rkey); kret = krb5_db_put_principal(kcontext, &dbent, &nentries); if ((!kret) && (nentries != 1)) @@ -564,7 +566,7 @@ do_testing(db, passes, verbose, timing, rcases, check, save_db, dontclean, op = "adding master principal"; if ((kret = add_principal(kcontext, master_princ, - &master_encblock, + &master_keyblock, &master_keyblock, rseed))) goto goodbye; @@ -628,7 +630,7 @@ do_testing(db, passes, verbose, timing, rcases, check, save_db, dontclean, swatch_on(); } if ((kret = add_principal(kcontext, playback_principal(passno), - &master_encblock, kbp, rseed))) { + &master_keyblock, kbp, rseed))) { linkage = "initially "; oparg = playback_name(passno); goto cya; @@ -659,7 +661,7 @@ do_testing(db, passes, verbose, timing, rcases, check, save_db, dontclean, } if ((kret = add_principal(kcontext, playback_principal(nvalid), - &master_encblock, + &master_keyblock, kbp, rseed))) { oparg = playback_name(nvalid); goto cya; @@ -789,7 +791,7 @@ do_testing(db, passes, verbose, timing, rcases, check, save_db, dontclean, for (passno=0; passno 4) fprintf(stderr, "*A(%s)\n", playback_name(passno)); @@ -885,7 +887,7 @@ do_testing(db, passes, verbose, timing, rcases, check, save_db, dontclean, for (j=0; j