diff options
author | Theodore Tso <tytso@mit.edu> | 1994-11-21 20:33:53 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1994-11-21 20:33:53 +0000 |
commit | 713fb98f15b22f626aa792a60f0e00f502a04456 (patch) | |
tree | 9210ae111762a6758d03304ccbc755b41f8f5a8e /src/lib/krb5/krb/encode_kdc.c | |
parent | 701efdf4670d556f9164a87ce44939c2cd3f050d (diff) | |
download | krb5-713fb98f15b22f626aa792a60f0e00f502a04456.zip krb5-713fb98f15b22f626aa792a60f0e00f502a04456.tar.gz krb5-713fb98f15b22f626aa792a60f0e00f502a04456.tar.bz2 |
encode_kdc.c (krb5_encode_kdc_rep): Now requires that the
caller pass in the encryption block to be used for
encrpyting the ticket. That way, this routine doesn't
need to create its own encryption block.
encrypt_tk.c (krb5_encrypt_tkt_part): Now requires that the
caller pass in the encryption block to be used for
encrpyting the ticket. That way, this routine doesn't
need to create its own encryption block.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4710 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/krb/encode_kdc.c')
-rw-r--r-- | src/lib/krb5/krb/encode_kdc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/krb5/krb/encode_kdc.c b/src/lib/krb5/krb/encode_kdc.c index 4270c57..6b01b64 100644 --- a/src/lib/krb5/krb/encode_kdc.c +++ b/src/lib/krb5/krb/encode_kdc.c @@ -46,17 +46,18 @@ krb5_error_code krb5_encode_kdc_rep(DECLARG(const krb5_msgtype, type), DECLARG(const krb5_enc_kdc_rep_part *, encpart), + DECLARG(krb5_encrypt_block *, eblock), DECLARG(const krb5_keyblock *, client_key), DECLARG(krb5_kdc_rep *, dec_rep), DECLARG(krb5_data **, enc_rep)) OLDDECLARG(const krb5_msgtype, type) OLDDECLARG(const krb5_enc_kdc_rep_part *, encpart) +OLDDECLARG(krb5_encrypt_block *, eblock) OLDDECLARG(const krb5_keyblock *, client_key) OLDDECLARG(krb5_kdc_rep *, dec_rep) OLDDECLARG(krb5_data **, enc_rep) { krb5_data *scratch; - krb5_encrypt_block eblock; krb5_error_code retval; krb5_enc_kdc_rep_part tmp_encpart; @@ -77,7 +78,7 @@ OLDDECLARG(krb5_data **, enc_rep) * type correct. * * Although note that it may be doing nothing with the message - * type, to be compatible with old versions of Kerberos that ways + * type, to be compatible with old versions of Kerberos that always * encode this as a TGS_REP regardly of what it really should be; * also note that the reason why we are passing it in a structure * instead of as an argument to encode_krb5_enc_kdc_rep_part (the @@ -95,11 +96,8 @@ OLDDECLARG(krb5_data **, enc_rep) #define cleanup_scratch() { (void) memset(scratch->data, 0, scratch->length); \ krb5_free_data(scratch); } - /* put together an eblock for this encryption */ - - krb5_use_cstype(&eblock, dec_rep->enc_part.etype); dec_rep->enc_part.ciphertext.length = - krb5_encrypt_size(scratch->length, eblock.crypto_entry); + krb5_encrypt_size(scratch->length, eblock->crypto_entry); /* add padding area, and zero it */ if (!(scratch->data = realloc(scratch->data, dec_rep->enc_part.ciphertext.length))) { @@ -122,24 +120,26 @@ free(dec_rep->enc_part.ciphertext.data); \ dec_rep->enc_part.ciphertext.length = 0; \ dec_rep->enc_part.ciphertext.data = 0;} - retval = krb5_process_key(&eblock, client_key); + retval = krb5_process_key(eblock, client_key); if (retval) { goto clean_encpart; } -#define cleanup_prockey() {(void) krb5_finish_key(&eblock);} +#define cleanup_prockey() {(void) krb5_finish_key(eblock);} retval = krb5_encrypt((krb5_pointer) scratch->data, (krb5_pointer) dec_rep->enc_part.ciphertext.data, - scratch->length, &eblock, 0); + scratch->length, eblock, 0); if (retval) { goto clean_prockey; } + dec_rep->enc_part.etype = krb5_eblock_enctype(eblock); + /* do some cleanup */ cleanup_scratch(); - retval = krb5_finish_key(&eblock); + retval = krb5_finish_key(eblock); if (retval) { cleanup_encpart(); return retval; |