* old_decrypt.c (krb5_old_decrypt): Initialize the ivec to the key
authorTom Yu <tlyu@mit.edu>
Wed, 16 Dec 1998 21:16:33 +0000 (21:16 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 16 Dec 1998 21:16:33 +0000 (21:16 +0000)
  if we're using DES_CBC_CRC, for backwards compatibility.  We
  weren't noticing this before because it only trashes the first
  block, which is the confounder, which we weren't actually
  verifying because checksum was unconditionally succeeding prior to
  the other patch.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11092 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/old/ChangeLog
src/lib/crypto/old/old_decrypt.c

index 088c5961780b79ad55d69d0be2b1b7ae78cb162a..699aaebaa398b037e6a7e98438248d7ce17b7031 100644 (file)
@@ -1,3 +1,12 @@
+Wed Dec 16 16:14:02 1998  Tom Yu  <tlyu@mit.edu>
+
+       * old_decrypt.c (krb5_old_decrypt): Initialize the ivec to the key
+       if we're using DES_CBC_CRC, for backwards compatibility.  We
+       weren't noticing this before because it only trashes the first
+       block, which is the confounder, which we weren't actually
+       verifying because checksum was unconditionally succeeding prior to
+       the other patch.
+
 Thu Dec 10 22:16:14 1998  Tom Yu  <tlyu@mit.edu>
 
        * old_decrypt.c (krb5_old_decrypt): Actually compare the
index ad0b39ebf07d7bdc25ca2165563e986e06486489..26019e1644d5ee826058b6500fadb4ca0057c356 100644 (file)
@@ -40,7 +40,7 @@ krb5_old_decrypt(enc, hash, key, usage, ivec, input, arg_output)
     krb5_error_code ret;
     size_t blocksize, hashsize, plainsize;
     unsigned char *plaintext, *cksumdata;
-    krb5_data output, cksum;
+    krb5_data output, cksum, crcivec;
     int alloced;
 
     (*(enc->block_size))(&blocksize);
@@ -76,6 +76,13 @@ krb5_old_decrypt(enc, hash, key, usage, ivec, input, arg_output)
 
     /* decrypt it */
 
+    /* XXX this is gross, but I don't have much choice */
+    if ((key->enctype == ENCTYPE_DES_CBC_CRC) && (ivec == 0)) {
+       crcivec.length = key->length;
+       crcivec.data = key->contents;
+       ivec = &crcivec;
+    }
+
     if (ret = ((*(enc->decrypt))(key, ivec, input, &output)))
        goto cleanup;