Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#50 [patch] conflicting types for `SHA256_CTX'

0.6 branch
closed-duplicate
nobody
Compilation (8)
5
2009-01-09
2006-05-19
Dmitry Andrianov
No

Hello.

ipsec-tools 0.6.5
FreeBSD 4.9-RELEASE-p2 #0
OpenSSL 0.9.8b 04 May 2006

when configure checks if sha2 is defined in the
openssl/sha.h it decides there is no sha2 because
test "program" fails to compile.

Since configure erroneously decides there is no sha2,
it activates (?) some internal implementation which
results in conflicts with openssl sha2 later during
compilation:

In file included from ./crypto_openssl.c:84:
../../src/racoon/missing/crypto/sha2/sha2.h:105:
conflicting types for `SHA256_CTX'
...

Actually during sha2 detection in openssl, the test
only fails because size_t is used in the
openssl/sha.h but no appropriate header file included.
(In my case required header was sys/types.h)

The patch below is "theoretical" and only gives you
idea where to fix. In reality I had to patch
configure not configure.ac because I have no autoconf

$ diff -u configure.ac.orig configure.ac
--- configure.ac.orig Fri May 19 19:42:08 2006
+++ configure.ac Fri May 19 19:42:41 2006
@@ -211,6 +211,7 @@
AC_CHECK_HEADER(openssl/sha2.h, [], [
AC_MSG_CHECKING(if sha2 is defined in
openssl/sha.h)
AC_TRY_COMPILE([
+ #include <sys/types>
#include <openssl/sha.h>
], [
SHA256_CTX ctx;

Discussion

  • Timo Teras
    Timo Teras
    2009-01-09

    • status: open --> closed-duplicate