From 509ce0aaff8af4d160a938a3029337ab18c591a4 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Mon, 5 Feb 1990 15:32:53 +0000 Subject: [PATCH] change to use eblock parameter git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@283 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/verify_mky.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/lib/kdb/verify_mky.c b/src/lib/kdb/verify_mky.c index 6937c16a5..9b221d4ac 100644 --- a/src/lib/kdb/verify_mky.c +++ b/src/lib/kdb/verify_mky.c @@ -22,16 +22,22 @@ static char rcsid_verify_mky_c[] = #include #include +/* + * Verify that the master key in *mkey matches the database entry + * for mprinc. + * + * eblock points to an encrypt_block used for the realm in question. + */ + krb5_error_code -krb5_db_verify_master_key(mprinc, mkey) +krb5_db_verify_master_key(mprinc, mkey, eblock) krb5_principal mprinc; krb5_keyblock *mkey; +krb5_encrypt_block *eblock; { krb5_error_code retval; krb5_db_entry master_entry; int nprinc, more; - krb5_encrypt_block eblock; - extern krb5_encrypt_block master_encblock; krb5_keyblock tempkey; nprinc = 1; @@ -47,21 +53,19 @@ krb5_keyblock *mkey; return(KRB5KDC_ERR_PRINCIPAL_NOT_UNIQUE); } - eblock = master_encblock; - /* do any necessary key pre-processing */ - if (retval = (*eblock.crypto_entry->process_key)(&eblock, mkey)) { + if (retval = (*eblock->crypto_entry->process_key)(eblock, mkey)) { return(retval); } - if (retval = krb5_kdb_decrypt_key(&master_entry.key, &tempkey, &eblock)) { - (void) (*eblock.crypto_entry->finish_key)(&eblock); + if (retval = krb5_kdb_decrypt_key(&master_entry.key, &tempkey, eblock)) { + (void) (*eblock->crypto_entry->finish_key)(eblock); return retval; } if (!bcmp(mkey->contents, tempkey.contents, mkey->length)) { retval = KRB5_KDB_BADMASTERKEY; - (void) (*eblock.crypto_entry->finish_key)(&eblock); + (void) (*eblock->crypto_entry->finish_key)(eblock); } else - retval = (*eblock.crypto_entry->finish_key)(&eblock); + retval = (*eblock->crypto_entry->finish_key)(eblock); return retval; } -- 2.26.2