Define MD5_K5BETA_COMPAT and MD5_K5BETA_COMP_DEF so that we continue
authorTheodore Tso <tytso@mit.edu>
Sat, 18 May 1996 05:55:59 +0000 (05:55 +0000)
committerTheodore Tso <tytso@mit.edu>
Sat, 18 May 1996 05:55:59 +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" MD5_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@8044 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/md5/ChangeLog
src/lib/crypto/md5/configure.in
src/lib/crypto/md5/md5crypto.c

index ffe7df271ea236d9000ad9a0b423c54be57c4fe5..ae09cdab7d1813ef0ae4825360dcd83b38713a38 100644 (file)
@@ -1,3 +1,16 @@
+Sat May 18 01:49:33 1996  Theodore Y. Ts'o  <tytso@mit.edu>
+
+       * md5crypto.c: Define MD5_K5BETA_COMPAT and MD5_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" MD5_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:32:51 1996  Richard Basch  <basch@lehman.com>
 
        * md5crypto.c md5glue.c:
index dd785bfab222125a534ed28e233c341ebab0d6af..7eff1bc8b9660aaf987e85d3eb16608bcb7c71f9 100644 (file)
@@ -1,6 +1,5 @@
 AC_INIT(configure.in)
 CONFIG_RULES
-AC_DEFINE(MD5_K5BETA_COMPAT)
 V5_SHARED_LIB_OBJS
 SubdirLibraryRule([${OBJS}])
 V5_AC_OUTPUT_MAKEFILE
index b22a3874819c95eb4ebfda40716a456f07201271..c37b8e658c60fc93585faa05f984c1f11a1d2f82 100644 (file)
@@ -12,6 +12,8 @@ krb5_error_code
 krb5_md5_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-MD5-DES implementation
  * did not follow RFC1510.  The folowing definitions control the compatibility
@@ -25,9 +27,11 @@ krb5_md5_crypto_verify_func PROTOTYPE((krb5_checksum FAR *cksum, krb5_pointer in
  * the compatible behaviour becomes the default.
  *
  */
+#define MD5_K5BETA_COMPAT
+#define MD5_K5BETA_COMPAT_DEF
 
 static void
-krb5_md5_calculate_cksum(md5ctx, in, in_length, confound, confound_length)
+krb5_md5_calculate_cksum(md5ctx, confound, confound_length, in, in_length)
     krb5_MD5_CTX               *md5ctx;
     krb5_pointer       in;
     size_t             in_length;
@@ -151,7 +155,7 @@ krb5_checksum FAR *outcksum;
                                 RSA_MD5_DES_CKSUM_LENGTH +
                                 RSA_MD5_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);
@@ -260,7 +264,7 @@ size_t seed_length;
                                         RSA_MD5_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);