List,

I encountered a problem (as well as the odd warning or two) when
compiling last night's snapshot on VC-NT.

Basically, EVP_Digest now takes an additional ENGINE*, which is not
present in the MD() macros defined in crypto/rand/rand_lcl.h.

I'm not entirely sure how best to solve this. I think the attached patch
tries to look up the correct engine given the digest in question but I
might well be:

a) wrong, or

b) overdoing things.

So I would really appreciate it if someone could comment on the patch
below. The tests all pass correctly if that's any consolation. :-)

Best regards,

//oscar

--- rand_lcl.h.org      Tue Oct 16 04:02:03 2001
+++ rand_lcl.h  Wed Oct 24 15:18:01 2001
@@ -130,28 +130,29 @@
 #endif

 #include <openssl/evp.h>
+#include <openssl/engine.h>
 #define MD_Update(a,b,c)       EVP_DigestUpdate(a,b,c)
 #define        MD_Final(a,b)           EVP_DigestFinal_ex(a,b,NULL)
 #if defined(USE_MD5_RAND)
 #include <openssl/md5.h>
 #define MD_DIGEST_LENGTH       MD5_DIGEST_LENGTH
 #define MD_Init(a)             EVP_DigestInit_ex(a,EVP_md5(), NULL)
-#define        MD(a,b,c)               EVP_Digest(a,b,c,NULL,EVP_md5())
+#define        MD(a,b,c)              EVP_Digest(a,b,c,NULL,EVP_md5(),
ENGINE_get_digest_engine(NID_md5))
 #elif defined(USE_SHA1_RAND)
 #include <openssl/sha.h>
 #define MD_DIGEST_LENGTH       SHA_DIGEST_LENGTH
 #define MD_Init(a)             EVP_DigestInit_ex(a,EVP_sha1(), NULL)
-#define        MD(a,b,c)              
EVP_Digest(a,b,c,NULL,EVP_sha1())
+#define        MD(a,b,c)              
EVP_Digest(a,b,c,NULL,EVP_sha1(), ENGINE_get_digest_engine(NID_sha1))
 #elif defined(USE_MDC2_RAND)
 #include <openssl/mdc2.h>
 #define MD_DIGEST_LENGTH       MDC2_DIGEST_LENGTH
 #define MD_Init(a)             EVP_DigestInit_ex(a,EVP_mdc2(), NULL)
-#define        MD(a,b,c)              
EVP_Digest(a,b,c,NULL,EVP_mdc2())
+#define        MD(a,b,c)              
EVP_Digest(a,b,c,NULL,EVP_mdc2(), ENGINE_get_digest_engine(NID_mdc2))
 #elif defined(USE_MD2_RAND)
 #include <openssl/md2.h>
 #define MD_DIGEST_LENGTH       MD2_DIGEST_LENGTH
 #define MD_Init(a)             EVP_DigestInit_ex(a,EVP_md2(), NULL)
-#define        MD(a,b,c)               EVP_Digest(a,b,c,NULL,EVP_md2())
+#define        MD(a,b,c)               EVP_Digest(a,b,c,NULL,EVP_md2(),
ENGINE_get_digest_engine(NID_md2))
 #endif
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to