Define MD4_K5BETA_COMPAT and MD4_K5BETA_COMP_DEF so that we continue
authorTheodore Tso <tytso@mit.edu>
Sat, 18 May 1996 05:55:25 +0000 (05:55 +0000)
committerTheodore Tso <tytso@mit.edu>
Sat, 18 May 1996 05:55:25 +0000 (05:55 +0000)
doing things the wrong (broken) way.  All hail backwards
compatibility....  The code now generates the old checksum, but it
will verify both the old and the correct checksum formats.

Also fixed two bugs in the "correct" MD4_CRYPTO implementation; use a
zero initialization vector, and calculate the confounder at the
beginning of the message, not at the end.

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

src/lib/crypto/md4/ChangeLog
src/lib/crypto/md4/configure.in
src/lib/crypto/md4/md4crypto.c

index 06783a21dc02c5aa3ad464f4878c7981706372a0..8d3ca2ee5ab8598a72b5447096709d31a2cf29e8 100644 (file)
@@ -1,3 +1,16 @@
+Sat May 18 01:49:33 1996  Theodore Y. Ts'o  <tytso@mit.edu>
+
+       * md4crypto.c: Define MD4_K5BETA_COMPAT and MD4_K5BETA_COMP_DEF so
+               that we continue doing things the wrong (broken) way.  All
+               hail backwards compatibility....  The code now generates
+               the old checksum, but it will verify both the old and the
+               correct checksum formats.
+
+               Also fixed two bugs in the "correct" MD4_CRYPTO
+               implementation; use a zero initialization vector, and
+               calculate the confounder at the beginning of the message,
+               not at the end.  
+
 Tue May 14 19:31:58 1996  Richard Basch  <basch@lehman.com>
 
        * md4crypto.c md4glue.c:
index 7e467a202a0fb85910cb85789043b29269e6df8f..7eff1bc8b9660aaf987e85d3eb16608bcb7c71f9 100644 (file)
@@ -1,6 +1,5 @@
 AC_INIT(configure.in)
 CONFIG_RULES
-AC_DEFINE(MD4_K5BETA_COMPAT)
 V5_SHARED_LIB_OBJS
 SubdirLibraryRule([${OBJS}])
 V5_AC_OUTPUT_MAKEFILE
index b6c2f94737fe60266e417ec5cc801a4690c63a7c..a0b7fc626070cdc3c46c64bf88fb8c07367ba7c6 100644 (file)
@@ -38,6 +38,8 @@ krb5_error_code
 krb5_md4_crypto_verify_func PROTOTYPE((krb5_checksum FAR *cksum, krb5_pointer in,
        size_t in_length, krb5_pointer seed, size_t seed_length));
 
+static mit_des_cblock zero_ivec = { 0 };
+
 /*
  * In Kerberos V5 Beta 5 and previous releases the RSA-MD4-DES implementation
  * did not follow RFC1510.  The folowing definitions control the compatibility
@@ -51,14 +53,16 @@ krb5_md4_crypto_verify_func PROTOTYPE((krb5_checksum FAR *cksum, krb5_pointer in
  * the compatible behaviour becomes the default.
  *
  */
+#define MD4_K5BETA_COMPAT
+#define MD4_K5BETA_COMPAT_DEF
 
 static void
-krb5_md4_calculate_cksum(md4ctx, in, in_length, confound, confound_length)
+krb5_md4_calculate_cksum(md4ctx, confound, confound_length, in, in_length)
     krb5_MD4_CTX               *md4ctx;
-    krb5_pointer       in;
-    size_t             in_length;
     krb5_pointer       confound;
     size_t             confound_length;
+    krb5_pointer       in;
+    size_t             in_length;
 {
     krb5_MD4Init(md4ctx);
     if (confound && confound_length)
@@ -184,7 +188,7 @@ krb5_checksum FAR *outcksum;
                                 RSA_MD4_DES_CKSUM_LENGTH +
                                 RSA_MD4_DES_CONFOUND_LENGTH,
                                 (struct mit_des_ks_struct *)eblock.priv,
-                                keyblock.contents,
+                                zero_ivec,
                                 MIT_DES_ENCRYPT);
     if (retval) {
        (void) mit_des_finish_key(&eblock);
@@ -293,7 +297,7 @@ size_t seed_length;
                                         RSA_MD4_DES_CONFOUND_LENGTH,
                                         (struct mit_des_ks_struct *)
                                                eblock.priv,
-                                        keyblock.contents,
+                                        zero_ivec,
                                         MIT_DES_DECRYPT);
            if (retval) {
                (void) mit_des_finish_key(&eblock);