#49 [patch] conflicting types for `SHA256_CTX'

0.6 branch
closed
Compilation (8)
5
2009-01-09
2006-05-19
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

  • Dmitry Andrianov

    Logged In: YES
    user_id=851214

    Heh. As I said, the patch is really "theoretical" and
    untested. I forgot ".h" suffix for <sys/type> and also
    including this file unconditionally may be a bad idea.
    Probably something like

    #ifdef HAVE_SYS_TYPES_H
    #include <sys/types.h>
    #endif

    should be used

     
  • VANHULLEBUS Yvan

    Logged In: YES
    user_id=105392

    Reported in HEAD and for 0.6.7.

    Thanks for the patch.

     
  • Timo Teras

    Timo Teras - 2009-01-09
    • assigned_to: nobody --> fabled80
    • status: open --> closed
     
  • Timo Teras

    Timo Teras - 2009-01-09

    Closing, vanhu had committed this long ago.

     

Log in to post a comment.