From 2b2e33773548aecf11f27e61e0414151e235cf1d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 26 Mar 2010 12:34:21 +0000 Subject: [PATCH] 2010-03-26 13:25 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbssl/ssl.c * contrib/hbssl/x509.c * contrib/hbssl/sslctx.c ! Attempt to fix compilation error using 0.9.8m and 1.0.0betas. * config/detect.mk + Enabled OpenSSL for bcc. I'm not exactly sure what is the factor here, it used to work once, then it didn't, now it works again. Maybe related to OpenSSL version. Now tested with 0.9.8m. + Enabled OpenSSL for watcom. Same as above, maybe 1.8 fixed it, maybe new OpenSSL version. Maybe someone will invest time to find out. ! Disabled OpenSSL for wce platform. Again, the exact circumstances are shady, but even 0.9.8m needs errno.h, which is not present in C compilers targeting WinCE. --- harbour/ChangeLog | 16 ++++++++++++++++ harbour/config/detect.mk | 4 ++-- harbour/contrib/hbssl/ssl.c | 9 +++++---- harbour/contrib/hbssl/sslctx.c | 5 +++++ harbour/contrib/hbssl/x509.c | 5 +++++ 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 55ca4bfb5d..731034dd76 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,22 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-26 13:25 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbssl/ssl.c + * contrib/hbssl/x509.c + * contrib/hbssl/sslctx.c + ! Attempt to fix compilation error using 0.9.8m and 1.0.0betas. + + * config/detect.mk + + Enabled OpenSSL for bcc. I'm not exactly sure what is the factor here, + it used to work once, then it didn't, now it works again. Maybe related + to OpenSSL version. Now tested with 0.9.8m. + + Enabled OpenSSL for watcom. Same as above, maybe 1.8 fixed it, maybe + new OpenSSL version. Maybe someone will invest time to find out. + ! Disabled OpenSSL for wce platform. Again, the exact circumstances + are shady, but even 0.9.8m needs errno.h, which is not present + in C compilers targeting WinCE. + 2010-03-26 10:52 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/gtwvg/gtwvg.c * contrib/gtwvg/gtwvg.h diff --git a/harbour/config/detect.mk b/harbour/config/detect.mk index 3c9d469584..d1ac6263ba 100644 --- a/harbour/config/detect.mk +++ b/harbour/config/detect.mk @@ -71,8 +71,8 @@ include $(TOP)$(ROOT)config/detfun.mk _DET_DSP_NAME := openssl _DET_VAR_INC_ := HB_INC_OPENSSL _DET_VAR_HAS_ := HB_HAS_OPENSSL -_DET_FLT_PLAT := -_DET_FLT_COMP := !watcom !bcc +_DET_FLT_PLAT := !wce +_DET_FLT_COMP := _DET_INC_DEFP := /usr/include /usr/local/include /usr/local/ssl/include /boot/common/include _DET_INC_HEAD := /openssl/ssl.h diff --git a/harbour/contrib/hbssl/ssl.c b/harbour/contrib/hbssl/ssl.c index e796ceac6c..6a178ebc33 100644 --- a/harbour/contrib/hbssl/ssl.c +++ b/harbour/contrib/hbssl/ssl.c @@ -55,6 +55,11 @@ #include "hbapiitm.h" #include "hbvm.h" +#if defined( HB_OS_WIN ) +# include +# include +#endif + #include "hbssl.h" HB_FUNC( SSL_INIT ) @@ -1368,7 +1373,6 @@ HB_FUNC( SSL_GET_CLIENT_CA_LIST ) if( ssl ) { -#if OPENSSL_VERSION_NUMBER < 0x10000000L /* TOFIX: Compilation error when tried with 1.0.0beta5 */ STACK_OF( X509_NAME ) * stack = SSL_get_client_CA_list( ssl ); int len = sk_X509_NAME_num( stack ); @@ -1383,7 +1387,6 @@ HB_FUNC( SSL_GET_CLIENT_CA_LIST ) hb_itemReturnRelease( pArray ); } else -#endif hb_reta( 0 ); } } @@ -1395,7 +1398,6 @@ HB_FUNC( SSL_LOAD_CLIENT_CA_FILE ) { if( HB_ISCHAR( 1 ) ) { -#if OPENSSL_VERSION_NUMBER < 0x10000000L /* TOFIX: Compilation error when tried with 1.0.0beta5 */ STACK_OF( X509_NAME ) * stack = SSL_load_client_CA_file( hb_parc( 1 ) ); int len = sk_X509_NAME_num( stack ); @@ -1410,7 +1412,6 @@ HB_FUNC( SSL_LOAD_CLIENT_CA_FILE ) hb_itemReturnRelease( pArray ); } else -#endif hb_reta( 0 ); } else diff --git a/harbour/contrib/hbssl/sslctx.c b/harbour/contrib/hbssl/sslctx.c index 600a74e4b3..5fb27a754c 100644 --- a/harbour/contrib/hbssl/sslctx.c +++ b/harbour/contrib/hbssl/sslctx.c @@ -54,6 +54,11 @@ #include "hbapierr.h" #include "hbapiitm.h" +#if defined( HB_OS_WIN ) +# include +# include +#endif + #include "hbssl.h" static HB_GARBAGE_FUNC( SSL_CTX_release ) diff --git a/harbour/contrib/hbssl/x509.c b/harbour/contrib/hbssl/x509.c index f30b40e37e..c650b756d0 100644 --- a/harbour/contrib/hbssl/x509.c +++ b/harbour/contrib/hbssl/x509.c @@ -53,6 +53,11 @@ #include "hbapi.h" #include "hbapierr.h" +#if defined( HB_OS_WIN ) +# include +# include +#endif + #include "hbssl.h" static HB_GARBAGE_FUNC( X509_release )