Commit ee7e4fc1 authored by toddouska's avatar toddouska Committed by Daniel Stenberg
Browse files

cyassl: update to CyaSSL 2.0.x API

Modify configure.ac to test for new CyaSSL Init function and remove
default install path to system.  Change to CyaSSL OpenSSL header and
proper Init in code as well.

Note that this no longer detects or works with CyaSSL before v2
parent 02012805
Loading
Loading
Loading
Loading
+4 −9
Original line number Original line Diff line number Diff line
@@ -1957,7 +1957,7 @@ OPT_CYASSL=no
_cppflags=$CPPFLAGS
_cppflags=$CPPFLAGS
_ldflags=$LDFLAGS
_ldflags=$LDFLAGS
AC_ARG_WITH(cyassl,dnl
AC_ARG_WITH(cyassl,dnl
AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: /usr/local/cyassl)])
AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: system lib default)])
AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]),
AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]),
  OPT_CYASSL=$withval)
  OPT_CYASSL=$withval)


@@ -1970,14 +1970,9 @@ if test "$OPENSSL_ENABLED" != "1"; then
    fi
    fi


    if test -z "$OPT_CYASSL" ; then
    if test -z "$OPT_CYASSL" ; then
      dnl check for lib in default first
      dnl check for lib in system default first


      trycyassldir="/usr/local/cyassl"
      AC_CHECK_LIB(cyassl, CyaSSL_Init,

      LDFLAGS="$LDFLAGS -L$trycyassldir/lib"
      CPPFLAGS="$CPPFLAGS -I$trycyassldir/include"

      AC_CHECK_LIB(cyassl, InitCyaSSL,
      dnl libcyassl found, set the variable
      dnl libcyassl found, set the variable
       [
       [
         AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
         AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
@@ -1999,7 +1994,7 @@ if test "$OPENSSL_ENABLED" != "1"; then
         CPPFLAGS="$CPPFLAGS $addcflags"
         CPPFLAGS="$CPPFLAGS $addcflags"
      fi
      fi


      AC_CHECK_LIB(cyassl, InitCyaSSL,
      AC_CHECK_LIB(cyassl, CyaSSL_Init,
       [
       [
       AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
       AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
       AC_SUBST(USE_CYASSL, [1])
       AC_SUBST(USE_CYASSL, [1])
+1 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@ Portability
 libssh2      0.16
 libssh2      0.16
 c-ares       1.6.0
 c-ares       1.6.0
 libidn       0.4.1
 libidn       0.4.1
 cyassl       1.4.0
 cyassl       2.0.0
 openldap     2.0
 openldap     2.0
 MIT krb5 lib 1.2.4
 MIT krb5 lib 1.2.4
 qsossl       V5R2M0
 qsossl       V5R2M0
+3 −7
Original line number Original line Diff line number Diff line
@@ -404,14 +404,10 @@ size_t Curl_cyassl_version(char *buffer, size_t size)


int Curl_cyassl_init(void)
int Curl_cyassl_init(void)
{
{
#if (LIBCYASSL_VERSION_HEX >= 0x02000000)
  if(CyaSSL_Init() == 0)
  if(SSL_library_init() != SSL_SUCCESS)
    return 0;
#else
  InitCyaSSL();
#endif

    return 1;
    return 1;

  return -1;
}
}




+1 −1
Original line number Original line Diff line number Diff line
@@ -112,7 +112,7 @@
#endif
#endif


#ifdef USE_CYASSL
#ifdef USE_CYASSL
#include <openssl/ssl.h>
#include <cyassl/openssl/ssl.h>
#endif
#endif


#ifdef USE_NSS
#ifdef USE_NSS