*** empty log message ***
authoredg <edg@mit.edu>
Wed, 16 May 1990 17:48:54 +0000 (17:48 +0000)
committeredg <edg@mit.edu>
Wed, 16 May 1990 17:48:54 +0000 (17:48 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@857 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/des/cbc_cksum.c
src/lib/crypto/des/string2key.c

index 655cf35624b59024fe00795b1e6338f732032a71..a0fc703688d51136526d12fbb7ad156a0cb76b46 100644 (file)
@@ -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);
index 48d6daeb5972001e8af5e039c49f4c2a509d4f74..f1de4f40ada805c108de284bc074763e84a40f54 100644 (file)
@@ -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;