From: edg Date: Wed, 16 May 1990 17:48:54 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: krb5-1.0-alpha2~548 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a22cb9fedb94bf1230de610c43400648101128e7;p=krb5.git *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@857 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/des/cbc_cksum.c b/src/lib/crypto/des/cbc_cksum.c index 655cf3562..a0fc70368 100644 --- a/src/lib/crypto/des/cbc_cksum.c +++ b/src/lib/crypto/des/cbc_cksum.c @@ -60,7 +60,7 @@ OLDDECLARG(krb5_checksum *, cksum) krb5_octet *contents; if (key_size != sizeof(des_cblock)) - return -1; + return KRB5_BAD_KEYSIZE; if (!(schedule = (struct des_ks_struct *) malloc(sizeof(des_key_schedule)))) return ENOMEM; @@ -81,10 +81,10 @@ OLDDECLARG(krb5_checksum *, cksum) ; } - if (!(contents = (krb5_octet *) malloc(sizeof(des_cblock)))) + if (!(contents = (krb5_octet *) malloc(sizeof(des_cblock)))) { + cleanup(); return ENOMEM; - -#define cleanup2() { free( (char *) schedule); } + } des_cbc_cksum((krb5_octet *)in, contents, in_length, schedule, (krb5_octet *)key); diff --git a/src/lib/crypto/des/string2key.c b/src/lib/crypto/des/string2key.c index 48d6daeb5..f1de4f40a 100644 --- a/src/lib/crypto/des/string2key.c +++ b/src/lib/crypto/des/string2key.c @@ -86,7 +86,7 @@ OLDDECLARG(krb5_principal, princ) if ( !(keyblock->contents = (krb5_octet *)malloc(sizeof(des_cblock))) ) return(ENOMEM); -#define cleanup() {memset(keyblock->contents, sizeof(des_cblock), 0);\ +#define cleanup() {bzero(keyblock->contents, sizeof(des_cblock));\ (void) free((char *) keyblock->contents);} keyblock->keytype = KEYTYPE_DES;