--- src/utils/lib/stubs_c.c.orig	Tue Sep  6 22:03:39 2005
+++ src/utils/lib/stubs_c.c	Tue Sep  6 22:11:04 2005
@@ -515,11 +515,11 @@
     nread = os_read (fd, hash_buffer, max_nread); \
  \
     if(nread < 0) { \
-      unix_error(errno, "md4_safe_fd: Read", Nothing); \
+      unix_error(errno, "HASH_NAME##un_safe_fd: Read", Nothing); \
     } \
  \
     if(nread == 0){ \
-      HASH_FINISH (&context, digest); \
+      HASH_FINISH (digest, &context); \
  \
       return Val_unit; \
     } \
@@ -527,7 +527,7 @@
     HASH_APPEND (&context, hash_buffer, nread); \
     len -= nread; \
   } \
-  HASH_FINISH (&context, digest); \
+  HASH_FINISH (digest, &context); \
  \
   return Val_unit; \
 } \
@@ -541,7 +541,7 @@
  \
   HASH_INIT (&context); \
   HASH_APPEND (&context, string, len); \
-  HASH_FINISH (&context, digest); \
+  HASH_FINISH (digest, &context); \
   \
   return Val_unit; \
 } \
@@ -561,7 +561,7 @@
     HASH_INIT (&context); \
     while ((len = fread (hash_buffer, 1, HASH_BUFFER_LEN, file)) >0) \
       HASH_APPEND (&context, hash_buffer, len); \
-    HASH_FINISH (&context, digest); \
+    HASH_FINISH (digest, &context); \
  \
     fclose (file); \
   } \
@@ -569,13 +569,13 @@
 } \
 
 
-#include "md4.h"
-#include "md5.h"
-#include "sha1_c.h"
+#include <openssl/md4.h>
+#include <openssl/md5.h>
+#include <openssl/sha.h>
 
-ML_HASH(sha1,SHA1_CTX,sha1_begin,sha1_hash, sha1_end)
-ML_HASH(md5,md5_state_t,md5_init,md5_append,md5_finish)
-ML_HASH(md4,MD4_CTX,MD4Init,MD4Update,md4_finish)
+ML_HASH(sha1,SHA_CTX,SHA1_Init,SHA1_Update, SHA1_Final)
+ML_HASH(md5, MD5_CTX, MD5_Init, MD5_Update, MD5_Final)
+ML_HASH(md4, MD4_CTX, MD4_Init, MD4_Update, MD4_Final)
 
 /*******************************************************************
 
--- src/daemon/common/commonHasher_c.c.orig	Tue Sep  6 22:14:27 2005
+++ src/daemon/common/commonHasher_c.c	Tue Sep  6 22:19:35 2005
@@ -37,9 +37,9 @@
 #define JOB_HANDLER     5
 #define JOB_ERROR       6
 
-#include "../../utils/lib/md4.h"
-#include "../../utils/lib/md5.h"
-#include "../../utils/lib/sha1_c.h"
+#include <openssl/md4.h>
+#include <openssl/md5.h>
+#include <openssl/sha.h>
 #include "../../utils/lib/tiger.h"
 
 
@@ -68,7 +68,7 @@
         unix_error(errno, "HASH_NAME##unsafe64_fd_direct: Read", Nothing); \
     } \
     if(nread == 0){ \
-      HASH_FINISH (&context, digest); \
+      HASH_FINISH (digest, &context); \
  \
       return; \
     } \
@@ -76,12 +76,12 @@
     HASH_APPEND (&context, local_hash_buffer, nread); \
     len -= nread; \
   } \
-  HASH_FINISH (&context, digest); \
+  HASH_FINISH (digest, &context); \
 }
 
-COMPLETE_HASH(sha1,SHA1_CTX,sha1_begin,sha1_hash, sha1_end)
-COMPLETE_HASH(md5,md5_state_t,md5_init,md5_append,md5_finish)
-COMPLETE_HASH(md4,MD4_CTX,MD4Init,MD4Update,md4_finish)
+COMPLETE_HASH(sha1,SHA_CTX,SHA1_Init,SHA1_Update, SHA1_Final)
+COMPLETE_HASH(md5, MD5_CTX, MD5_Init, MD5_Update, MD5_Final)
+COMPLETE_HASH(md4, MD4_CTX, MD4_Init, MD4_Update, MD4_Final)
 
 static void tiger_tree_fd(OS_FD fd, long len, off_t pos, 
   int block_size, char *digest)
@@ -160,7 +160,7 @@
      \
     if(nread == 0){ \
       unsigned char *digest = String_val(Field(job_v, JOB_RESULT)); \
-      HASH_FINISH (&context, digest); \
+      HASH_FINISH (digest, &context); \
       job_finished = 1; \
       timer = 10; \
       return Val_true; \
@@ -173,7 +173,7 @@
    \
   if(job_len <= 0){ \
     unsigned char *digest = String_val(Field(job_v, JOB_RESULT));       \
-    HASH_FINISH (&context, digest); \
+    HASH_FINISH (digest, &context); \
     job_finished = 1; \
     timer = 10; \
     return Val_true; \
--- src/networks/fasttrack/fst_crypt.c.orig	Tue Sep  6 22:23:50 2005
+++ src/networks/fasttrack/fst_crypt.c	Tue Sep  6 22:26:34 2005
@@ -15,7 +15,8 @@
  * General Public License for more details.
  */
 
-#include "../../utils/lib/md5.h"
+#include <string.h>
+#include <openssl/md5.h>
 #include "fst_crypt.h"
 
 /*****************************************************************************/
@@ -106,14 +106,14 @@
 
 	if (enc_type & 0x08)
 	{
-		MD5Context ctx;
-		unsigned char md5[MD5_HASH_LEN];
+		MD5_CTX ctx;
+		unsigned char md5[MD5_DIGEST_LENGTH];
 
 		FST_HEAVY_DBG ("init_cipher: enc_type & 0x08");
 
-		MD5Init (&ctx);
-		MD5Update (&ctx, cipher->pad, sizeof(cipher->pad));
-		MD5Final (md5, &ctx);
+		MD5_Init (&ctx);
+		MD5_Update (&ctx, cipher->pad, sizeof(cipher->pad));
+		MD5_Final (md5, &ctx);
 
 		/* correct md5 byte order on big-endian since it's converted to (unsigned int*) below */
 		reverse_bytes ( (unsigned int*)&md5, 4);
