From d625e6d8ccf42193c6522d1ae36f12662cc8a085 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Thu, 20 Sep 1990 15:33:40 +0000 Subject: [PATCH] use macros to hide abstraction git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1138 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/kdc_util.c | 17 ++++++++--------- src/kdc/main.c | 5 ++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index 027239da3..1c3775894 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -108,26 +108,25 @@ const krb5_fulladdr *from; eblock.crypto_entry = krb5_csarray[tgs_req->tgs_request2->etype]->system; /* XXX */ /* do any necessary key pre-processing */ - if (retval = (*eblock.crypto_entry->process_key)(&eblock, - tgs_req->header2->ticket->enc_part2->session)) { + if (retval = krb5_process_key(&eblock, + tgs_req->header2->ticket->enc_part2->session)) { free(scratch.data); return(retval); } /* call the encryption routine */ - if (retval = - (*eblock.crypto_entry->decrypt_func)((krb5_pointer) tgs_req->tgs_request2->enc_part.data, - (krb5_pointer) scratch.data, - scratch.length, &eblock, - 0)) { - (void) (*eblock.crypto_entry->finish_key)(&eblock); + if (retval = krb5_decrypt((krb5_pointer) tgs_req->tgs_request2->enc_part.data, + (krb5_pointer) scratch.data, + scratch.length, &eblock, + 0)) { + (void) krb5_finish_key(&eblock); free(scratch.data); return retval; } #define clean_scratch() {bzero(scratch.data, scratch.length); free(scratch.data);} - if (retval = (*eblock.crypto_entry->finish_key)(&eblock)) { + if (retval = krb5_finish_key(&eblock)) { clean_scratch(); return retval; } diff --git a/src/kdc/main.c b/src/kdc/main.c index 5454d1522..d36d015b9 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -284,8 +284,7 @@ krb5_keyblock *masterkeyblock; } /* do any necessary key pre-processing */ - if (retval = (*master_encblock.crypto_entry-> - process_key)(&master_encblock, masterkeyblock)) { + if (retval = krb5_process_key(&master_encblock, masterkeyblock)) { master_encblock.crypto_entry = 0; (void) krb5_db_fini(); return(retval); @@ -300,7 +299,7 @@ closedown_db() krb5_error_code retval; /* clean up master key stuff */ - retval = (*master_encblock.crypto_entry->finish_key)(&master_encblock); + retval = krb5_finish_key(&master_encblock); bzero((char *)&master_encblock, sizeof(master_encblock)); -- 2.26.2