Andy Dougherty wrote:
On Sat, 15 Mar 2008, James Keenan via RT wrote:

On Sat Mar 15 10:50:04 2008, doughera wrote:

Ah, I think this one is easy:  If I recall correctly, the SHA256_CTX
stuff was added in openssl version 0.9.8; I'll bet your system has
0.9.7.

Yes.

OpenSSL> version
OpenSSL 0.9.7l 28 Sep 2006


Two reasonable fixes:

1.  (Easy)  Change the test program that Configure.pl runs to use
SHA256_CTX.  That way, the test program will actually test what parrot
will be using.

2.  (Hard)  Have parts of the "crypto" support conditionally included,
depending on whether or not the user has that specific functionality
available.


with r26441, I add conditional compilation in mdx.pmc. So, all PMC (md2, md4, md5, ripemd160, sha, sha1, sha256, sha512) must compile even if not supported by old version of libssl.
I hope this commit allows to revert the r26405 one.

François.

While (1) is something that François, who wrote the step class, could
probably do, I suspect that (2) is a discussion the project will have to
have.

Why wait for someone else? This trivial patch (untested, but it really should be this easy) ought to implement (1). This way you can proceed without waiting for any broader discussion.

diff -u -r parrot-svn/config/auto/crypto/crypto.in 
parrot-andy/config/auto/crypto/crypto.in
--- parrot-svn/config/auto/crypto/crypto.in     Fri Mar 14 11:23:37 2008
+++ parrot-andy/config/auto/crypto/crypto.in    Sat Mar 15 18:43:58 2008
@@ -4,10 +4,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <openssl/opensslv.h>
+#include <openssl/sha.h> /* For SHA256_CTX */
 #include <openssl/err.h>
int main(int argc, char *argv[])
 {
+    SHA256_CTX c; /* Only available in 0.9.8 and later */
     unsigned long dummy = ERR_get_error();
printf ("%s\n", OPENSSL_VERSION_TEXT);



Reply via email to