[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

heimdal and OpenSSL



The crypto APIs in Heimdal's libdes appear different from those
in OpenSSL, e.g. MD5Init versus MD5_Init.  Could I suggest the
following for hiemdal-0.3e?

Once this is done, then Heimdal can be built against OpenSSL 0.9.6 or
later (which now has an MD4 implementation).  Or one can continue to
build it against the included libdes.

  perl -i -p -e 's/(SHA1|MD5|MD4)(Init|Update|Final)/$$1_$$2/g;' \
        -e 's/SHA1_CTX/SHA_CTX/g; \
        lib/des/fcrypt.c lib/des/md4.c lib/des/md4.h \
        lib/des/md5.c lib/des/md5.h lib/des/mdtest.c \
        lib/des/sha.c lib/des/sha.h lib/gssapi/8003.c \
        lib/gssapi/get_mic.c lib/gssapi/unwrap.c \
        lib/gssapi/verify_mic.c lib/gssapi/wrap.c \
        lib/krb5/crypto.c lib/krb5/replay.c lib/otp/otp_md.c

... and this patch:

--- lib/otp/otp_md.c.orig       Tue Jul 11 19:26:43 2000
+++ lib/otp/otp_md.c    Thu Jan  4 09:38:17 2001
@@ -212,7 +212,7 @@
  */
 
 static void
-SHA1Final_little_endian (void *res, struct sha1 *m)
+SHA1Final_little_endian (void *res, SHA_CTX *m)
 {
   unsigned char tmp[20];
   unsigned char *p = res;
@@ -231,7 +231,7 @@
 otp_sha_init (OtpKey key, const char *pwd, const char *seed)
 {
   unsigned char res[20];
-  struct sha1 sha1;
+  SHA_CTX sha1;
 
   return otp_md_init (key, pwd, seed, 
                      (void (*)(void *))SHA1Init, 
@@ -245,7 +245,7 @@
              size_t len,
              unsigned char *res)
 {
-  struct sha1 sha1;
+  SHA_CTX sha1;
 
   return otp_md_hash (data, len,
                      (void (*)(void *))SHA1Init,
@@ -258,7 +258,7 @@
 otp_sha_next (OtpKey key)
 {
   unsigned char res[20];
-  struct sha1 sha1;
+  SHA_CTX sha1;
 
   return otp_md_next (key, 
                      (void (*)(void *))SHA1Init, 



Cheers,
-- 
Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org