From: John Kohl Date: Thu, 10 May 1990 17:42:24 +0000 (+0000) Subject: changes for new encryption & cksum interface X-Git-Tag: krb5-1.0-alpha2~574 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f4aca780a07b1bc44b88a71bd4a2d28bb52cb9dd;p=krb5.git changes for new encryption & cksum interface git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@831 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/send_tgs.c b/src/lib/krb5/krb/send_tgs.c index 46b042f0d..eb5e7457c 100644 --- a/src/lib/krb5/krb/send_tgs.c +++ b/src/lib/krb5/krb/send_tgs.c @@ -18,6 +18,7 @@ static char rcsid_send_tgs_c[] = #include #include #include +#include #include #include @@ -100,14 +101,20 @@ OLDDECLARG(krb5_response *,rep) if (retval) return(retval); - /* xxx choose a checksum type */ + /* XXX choose a checksum type */ + if (!(ap_checksum.contents = (krb5_octet *) + malloc(krb5_cksumarray[sumtype]->checksum_length))) { + krb5_free_data(scratch); + return ENOMEM; + } + if (retval = (*(krb5_cksumarray[sumtype]-> sum_func))(scratch->data, - 0, /* XXX? */ - (krb5_pointer) usecred->keyblock.contents, scratch->length, + (krb5_pointer) usecred->keyblock.contents, usecred->keyblock.length, &ap_checksum)) { + xfree(ap_checksum.contents); krb5_free_data(scratch); return retval; } @@ -115,7 +122,7 @@ OLDDECLARG(krb5_response *,rep) xfree(scratch); #define cleanup() {(void) free((char *)tgsreq.tgs_request.data); \ - (void) free((char *)ap_checksum.contents);} + xfree(ap_checksum.contents);} /* * Now get an ap_req. */ @@ -136,7 +143,8 @@ OLDDECLARG(krb5_response *,rep) } #undef cleanup #define cleanup() {(void) free(tgsreq.header.data); \ - (void) free(tgsreq.tgs_request.data);} + (void) free(tgsreq.tgs_request.data);\ + xfree(ap_checksum.contents);} /* now send request & get response from KDC */ retval = krb5_sendto_kdc(scratch, krb5_princ_realm(sname),