]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
remove the input bounds check
authorMarc Horowitz <marc@mit.edu>
Thu, 13 Aug 1998 03:17:03 +0000 (03:17 +0000)
committerMarc Horowitz <marc@mit.edu>
Thu, 13 Aug 1998 03:17:03 +0000 (03:17 +0000)
fix the stupid brainos.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/marc-3des@10811 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/keyhash_provider/k5_md4des.c

index 8da442e4703a81e1b0b67b4dfc1ffe85491a09b5..4d4a9baff8a8e49310e27487517b2a052de0f95d 100644 (file)
@@ -32,8 +32,6 @@ k5_md4des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec,
 
     if (key->length != 8)
        return(KRB5_BAD_KEYSIZE);
-    if ((input->length%8) != 0)
-       return(KRB5_BAD_MSIZE);
     if (ivec)
        return(KRB5_CRYPTO_INTERNAL);
     if (output->length != (CONFLENGTH+RSA_MD4_CKSUM_LENGTH))
@@ -48,7 +46,7 @@ k5_md4des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec,
 
     /* create and schedule the encryption key */
 
-    memcpy(xorkey, key->contents, sizeof(key->length));
+    memcpy(xorkey, key->contents, sizeof(xorkey));
     for (i=0; i<sizeof(xorkey); i++)
        xorkey[i] ^= 0xf0;
     
@@ -96,8 +94,6 @@ k5_md4des_verify(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec,
 
     if (key->length != 8)
        return(KRB5_BAD_KEYSIZE);
-    if ((input->length%8) != 0)
-       return(KRB5_BAD_MSIZE);
     if (ivec)
        return(KRB5_CRYPTO_INTERNAL);
     if (hash->length != (CONFLENGTH+RSA_MD4_CKSUM_LENGTH))
@@ -105,7 +101,7 @@ k5_md4des_verify(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec,
 
     /* create and schedule the encryption key */
 
-    memcpy(xorkey, key->contents, sizeof(key->length));
+    memcpy(xorkey, key->contents, sizeof(xorkey));
     for (i=0; i<sizeof(xorkey); i++)
        xorkey[i] ^= 0xf0;
     
@@ -118,7 +114,7 @@ k5_md4des_verify(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec,
 
     /* decrypt it.  this has a return value, but it's always zero.  */
 
-    mit_des_cbc_encrypt((krb5_pointer) input->data,
+    mit_des_cbc_encrypt((krb5_pointer) hash->data,
                        (krb5_pointer) plaintext, sizeof(plaintext),
                        schedule, (char *) mit_des_zeroblock, 0);