People,
I have some patches to make curl work with CyaSSL.
CyaSSL <http://www.yassl.com/> is a small footprint SSL stack, meant
for embedded systems and such. This is not to be confused with yassl,
the C++ version of SSL stack from same folks -- this has a more
complete openssl compatibility layer, and works with curl as of now.
CyaSSL is even smaller.
I've been sitting on these set of patches for a while now, for which I
would like to apologize to Daniel Steinberg, Larry Stefonic and Todd A
Ouska who had offered help much earlier. Sorry about delaying this
for so long!
It is not perfect either, things are likely broken or dysfunctional.
But I figured that posting them anyway and asking for help is better
than putting it off forever. When I started this work, I took and
patched curl 7.18.2; but curl CVS seems to have moved from there
since, especially the SSL interfaces.
In order to build curl with cyassl support, you should:
* download and build cyassl from yassl.com;
* apply the attached patches to curl;
* run "./buildconf"
* run "./configure --without-ssl --with-cyassl=/path/to/cyassl/build"
* run "make"
I have tested builing curl only with cyassl build directory, not
install roots. To test without installing things, you will have to
set LD_LIBRARY_PATH to point to directories where libcyassl.so and the
newly built libcurl.so are.
Issues I could think of rightaway:
* I have only tested buidling it with cyassl build directory.
Consequently configure.ac patch isn't pretty. Please help there.
* Certificate verification is broken; you have to run "curl -k" for
now. According to documentation, CyaSSL takes a different route to
certificate checking, but I have not figured out that yet. Please
help there as well.
* I have only tested https. On some tests (https://login.yahoo.com
gives an error, for example), I found that increasing CyaSSL'S
MAX_RECORD_SIZE to a larger value works. Clearly even https needs
further testing.
* I have tested these specific set of patches only with with 32-bit
x86, Linux and GCC. It was written originally for a small MIPS box
running Linux, I do not have access to those right now. If folks
running other embedded systems architecture are interested, help is
much welcomed.
* Regarding the copyright notice: can we simply copy and paste it
from elsewhere in curl? cyassl.c is heavily based on example source
code budled with cyassl, so I think cyassl authors also have to be
credited.
Clearly this is not the highest quality patches I should be offering,
all feedback/help/review are much appreciated.
Hope I haven't missed anything... :)
Thanks,
Sajith.
--
9DB8FF06 : CB80 0BA6 7D13 B10A 6FBB D43E B4D2 28AD 9DB8 FF06
/*
* cyassl.c
*
* Cyassl <http://www.cyassl.org> support for curl. Cyassl is small
* footprint SSL stack, primarily meant for embedded systems and such.
*
* Almost everything is adopted from cyassl/examples/client/client.c
* and other existing SSL implementations within curl.
*/
#include "setup.h"
#ifdef USE_CYASSL
/*
* cyassl abuse alert: always keep NON_BLOCKING 1 -- everything else
* (NON_BLOCKING undefined and CYASSL_CALLBACKS) is untested.
*/
#define NON_BLOCKING 1
#define CURL_CYASSL_DEBUG 1
#include <unistd.h>
#include <fcntl.h>
#include <openssl/ssl.h>
#include "urldata.h"
#include "sendf.h"
#include "cyassl.h"
static inline int tcp_set_nonblocking(int* sockfd)
{
int flags = 0;
flags = fcntl(*sockfd, F_GETFL, 0);
return fcntl(*sockfd, F_SETFL, flags | O_NONBLOCK);
}
static int NonBlockingSSL_Connect(SSL* ssl)
{
int ret, error;
ret = SSL_connect(ssl);
error = SSL_get_error(ssl, 0);
while (ret != SSL_SUCCESS && (error == SSL_ERROR_WANT_READ ||
error == SSL_ERROR_WANT_WRITE)) {
#if (CURL_CYASSL_DEBUG == 1)
if (error == SSL_ERROR_WANT_READ)
printf("... client would read block\n");
else
printf("... client would write block\n");
#endif
/* this ought to be good enough for more data to show up?. */
usleep(300);
ret = SSL_connect(ssl);
error = SSL_get_error(ssl, 0);
}
if (ret != SSL_SUCCESS)
return -1;
return ret;
}
int Curl_cyassl_init(void)
{
#if (CURL_CYASSL_DEBUG == 1)
CyaSSL_Debugging_ON();
#endif
return 1;
}
int Curl_cyassl_cleanup(void)
{
#if (CURL_CYASSL_DEBUG == 1)
printf(stderr, "Curl_cyassl_cleanup()\n");
#endif
return 1;
}
static int do_file_type(const char *type)
{
if(!type || !type[0])
return SSL_FILETYPE_PEM;
if(curl_strequal(type, "PEM"))
return SSL_FILETYPE_PEM;
if(curl_strequal(type, "DER"))
return SSL_FILETYPE_ASN1;
return -1;
}
/*
* Mostly copied from ssluse.c -- what's unimplemented in cyassl has
* simply been removed.
*/
static int cert_stuff(struct connectdata *conn,
SSL_CTX* ctx,
char *cert_file,
const char *cert_type,
char *key_file,
const char *key_type)
{
struct SessionHandle *data = conn->data;
int file_type;
if(cert_file) {
if(data->set.str[STRING_KEY_PASSWD]) {
/*
* SSL_CTX_set_default_passwd_cb_userdata() and
* SSL_CTX_set_default_passwd_cb(ctx, passwd_callback) are not
* available yet. We'll just fail.
*/
failf(conn->data, "cyassl can't handle key passwords yet.\n");
return 0;
}
file_type = do_file_type(cert_type);
switch(file_type) {
case SSL_FILETYPE_PEM:
if(SSL_CTX_use_certificate_chain_file(ctx,
cert_file) != SSL_SUCCESS) {
failf(data, "unable to use client certificate\n");
return 0;
}
break;
case SSL_FILETYPE_ASN1:
/* SSL_CTX_use_certificate_file() works with either PEM or ASN1, but
we use the case above for PEM so this can only be performed with
ASN1 files. */
if(SSL_CTX_use_certificate_file(ctx,
cert_file,
file_type) != SSL_SUCCESS) {
failf(data, "unable to use client certificate\n");
return 0;
}
break;
default:
failf(data, "Unknown/unimplemented certificate type (%s)\n", cert_type);
return 0;
}
/*
* X509_get_pubkey(), EVP_PKEY_copy_parameters(), EVP_PKEY_free(),
* SSL_CTX_check_private_key() etc are not implemented in cyassl.
* Just pretend that we've done something, for now.
*/
}
if (key_file) {
file_type = do_file_type(key_type);
if (SSL_CTX_use_PrivateKey_file(ctx,
key_file,
file_type) != SSL_SUCCESS) {
failf(data, "can't load client key file");
return 0;
}
}
/*
* Apparently there's no way to deal with STRING_KEY_PASSWD. In any
* case I could not find any.
*/
return 1;
}
CURLcode Curl_cyassl_connect(struct connectdata *conn, int sockindex)
{
curl_socket_t sockfd = 0;
struct SessionHandle* data = 0;
SSL_METHOD* method = 0;
#if (CURL_CYASSL_DEBUG == 1)
infof(conn->data, "Curl_cyassl_connect()\n");
#endif
sockfd = conn->sock[sockindex];
data = conn->data;
#ifndef NO_TLS
infof(data, "TLSv1_client_method\n");
method = TLSv1_client_method();
#else
infof(data, "SSLv3_client_method\n");
method = SSLv3_client_method();
#endif
conn->ssl[sockindex].ctx = SSL_CTX_new(method);
/* SSL_get_certificate() not available in cyassl. */
if(data->set.str[STRING_CERT]) {
if(!cert_stuff(conn,
conn->ssl[sockindex].ctx,
data->set.str[STRING_CERT],
data->set.str[STRING_CERT_TYPE],
data->set.str[STRING_KEY],
data->set.str[STRING_KEY_TYPE])) {
return CURLE_SSL_CERTPROBLEM;
}
}
if(data->set.str[STRING_SSL_CIPHER_LIST]) {
if(!SSL_CTX_set_cipher_list(conn->ssl[sockindex].ctx,
data->set.str[STRING_SSL_CIPHER_LIST])) {
failf(data, "failed setting cipher list");
return CURLE_SSL_CIPHER;
}
}
infof(data, "data->set.ssl.verifypeer=%d\n", data->set.ssl.verifypeer);
if (data->set.str[STRING_SSL_CAFILE] || data->set.str[STRING_SSL_CAPATH]) {
if (SSL_CTX_load_verify_locations(
conn->ssl[sockindex].ctx,
data->set.str[STRING_SSL_CAFILE],
data->set.str[STRING_SSL_CAPATH]) != SSL_SUCCESS) {
if(data->set.ssl.verifypeer) {
/* Fail if we insist on successfully verifying the server. */
failf(data,"error setting certificate verify locations:\n"
" CAfile: %s\n CApath: %s\n",
data->set.str[STRING_SSL_CAFILE]?
data->set.str[STRING_SSL_CAFILE]: "none",
data->set.str[STRING_SSL_CAPATH]?
data->set.str[STRING_SSL_CAPATH] : "none");
return CURLE_SSL_CACERT_BADFILE;
}
else {
/* Just continue with a warning if no strict certificate
verification is required. */
infof(data, "error setting certificate verify locations,"
" continuing anyway:\n");
}
}
else {
/* Everything is fine. */
infof(data, "successfully set certificate verify locations:\n");
}
infof(data,
" CAfile: %s\n"
" CApath: %s\n",
data->set.str[STRING_SSL_CAFILE] ? data->set.str[STRING_SSL_CAFILE]:
"none",
data->set.str[STRING_SSL_CAPATH] ? data->set.str[STRING_SSL_CAPATH]:
"none");
}
/*
* The last argument is a verify callback, which isn't called per
* the current implementation anyway.
*
* SSL_get_verify_result() isn't implemented either, so I do not
* have a clear idea how to proceed here. Just use "-k" switch to
* cul for now.
*/
SSL_CTX_set_verify(conn->ssl[sockindex].ctx,
data->set.ssl.verifypeer ? SSL_VERIFY_PEER : SSL_VERIFY_NONE,
0);
conn->ssl[sockindex].handle = SSL_new(conn->ssl[sockindex].ctx);
SSL_set_fd(conn->ssl[sockindex].handle, sockfd);
tcp_set_nonblocking(&sockfd);
if (SSL_SUCCESS == NonBlockingSSL_Connect(conn->ssl[sockindex].handle)) {
infof(data, "SSL connection complete.\n");
conn->ssl[sockindex].state = ssl_connection_complete;
} else {
failf(data, "Connect error (%d)\n", CURLE_SSL_CONNECT_ERROR);
return CURLE_SSL_CONNECT_ERROR;
}
return CURLE_OK;
}
void Curl_cyassl_close_all(struct SessionHandle *data)
{
#if (CURL_CYASSL_DEBUG == 1)
infof(data, "Curl_cyassl_close_all()\n");
#endif
/*
* ERR_remove_state() requires cyassl built with OPENSSL_EXTRA. It
* doesn't do anything as of cyassl-0.9.9. Leaving as is, it might
* serve as a reminder that something ought to be done when these
* are available.
*/
/* ERR_remove_state(0); */
(void)data;
}
/*
* Straight from Curl_ossl_close().
*/
void Curl_cyassl_close(struct connectdata *conn, int sockindex)
{
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
#if (CURL_CYASSL_DEBUG == 1)
infof(conn->data, "Curl_cyassl_close()\n");
#endif
if(connssl->handle) {
(void)SSL_shutdown(connssl->handle);
/*
* SSL_set_connect_state() is not available in cyassl; but why is
* it called in Curl_ossl_close() at the time of closing?
*/
/* SSL_set_connect_state(connssl->handle); */
SSL_free(connssl->handle);
connssl->handle = NULL;
}
if(connssl->ctx) {
SSL_CTX_free (connssl->ctx);
connssl->ctx = NULL;
}
close(conn->sock[sockindex]);
}
ssize_t Curl_cyassl_send(struct connectdata *conn, int sockindex,
const void *mem, size_t len)
{
int nwrote = 0;
char error_buffer[120];
unsigned long sslerror;
#if (CURL_CYASSL_DEBUG == 1)
infof(conn->data, "Curl_cyassl_send()\n");
#endif
nwrote = SSL_write(conn->ssl[sockindex].handle, mem, len);
#if (CURL_CYASSL_DEBUG == 1)
infof(conn->data, "SSL_write(ssl=%p, mem=%p, len=%d) = %d\n",
(void *)conn->ssl[sockindex].handle, mem, len, nwrote);
#endif
if (nwrote < 0) {
int err = SSL_get_error(conn->ssl[sockindex].handle, nwrote);
switch (err) {
case SSL_ERROR_WANT_READ:
case SSL_ERROR_WANT_WRITE:
/* call us again */
return 0;
default:
/* In order to be able to use ERR_get_error(), cyassl should be
* compiled with SSL_EXTRAS. Currently (as of cyassl 0.9.9) it
* simply returns 0 anyhow.
*/
/* sslerror = ERR_get_error(); */
failf(conn->data, "SSL_write() error: %s (%d)",
ERR_error_string(sslerror, error_buffer), err);
return -1;
}
}
return nwrote;
}
ssize_t Curl_cyassl_recv(struct connectdata *conn, int sockindex,
char *buf, size_t bufsiz, bool *wouldblock)
{
int nread = 0;
char error_buffer[120];
unsigned long sslerror;
nread = SSL_read(conn->ssl[sockindex].handle, buf, bufsiz);
#if (CURL_CYASSL_DEBUG == 1)
infof(conn->data, "Curl_cyassl_recv(), nread=%d\n", nread);
#endif
if (nread < 0) {
int err = SSL_get_error(conn->ssl[sockindex].handle, (int)nread);
switch (err) {
case SSL_ERROR_WANT_READ:
case SSL_ERROR_WANT_WRITE:
/* there's data pending, re-invoke SSL_read() */
*wouldblock = TRUE;
return -1; /* basically EWOULDBLOCK */
default:
/* See comment about ERR_get_error() in Curl_cyassl_send()
* above. */
/* sslerror = ERR_get_error(); */
failf(conn->data, "SSL_read() error: %s (%d)",
ERR_error_string(sslerror, error_buffer),
err);
/* I'm not sure this is the right thing to do.. */
return -1;
}
}
return nread;
}
size_t Curl_cyassl_version(char *buffer, size_t size)
{
/* cyassl doesn't seem to provide a way to query its version
*/
return snprintf(buffer, size, "cyassl/unknown");
}
int Curl_cyassl_shutdown(struct connectdata *conn, int sockindex)
{
return 0;
}
void Curl_cyassl_session_free(void *ptr)
{
/* there's no SSL_SESSION_free in CyaSSL. */
}
#endif /* USE_CYASSL */
#ifndef __CYASSL_H
#define __CYASSL_H
#include "config.h"
#ifdef USE_CYASSL
int Curl_cyassl_init(void);
int Curl_cyassl_cleanup(void);
CURLcode Curl_cyassl_connect(struct connectdata *conn, int sockindex);
void Curl_cyassl_close_all(struct SessionHandle *data);
void Curl_cyassl_close(struct connectdata *conn, int sockindex);
ssize_t Curl_cyassl_send(struct connectdata *conn, int sockindex,
const void *mem, size_t len);
ssize_t Curl_cyassl_recv(struct connectdata *conn, int sockindex,
char *buf, size_t buffersize, bool *wouldblock);
void Curl_cyassl_session_free(void *ptr);
size_t Curl_cyassl_version(char *buffer, size_t size);
int Curl_cyassl_shutdown(struct connectdata *conn, int sockindex);
/* API setup for CyaSSL */
#define curlssl_init Curl_cyassl_init
#define curlssl_cleanup Curl_cyassl_cleanup
#define curlssl_connect Curl_cyassl_connect
#define curlssl_session_free(x) Curl_cyassl_session_free(x)
#define curlssl_close_all Curl_cyassl_close_all
#define curlssl_close Curl_cyassl_close
#define curlssl_shutdown(x,y) Curl_cyassl_shutdown(x,y)
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_FAILED_INIT)
#define curlssl_set_engine_default(x) (x=x, CURLE_FAILED_INIT)
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
#define curlssl_send Curl_cyassl_send
#define curlssl_recv Curl_cyassl_recv
#define curlssl_version Curl_cyassl_version
#define curlssl_check_cxn(x) (x=x, -1)
#define curlssl_data_pending(x,y) (x=x, y=y, 0)
#endif /* USE_CYASSL */
#endif /* __CYASSL_H */
Index: configure.ac
===================================================================
RCS file: /cvsroot/curl/curl/configure.ac,v
retrieving revision 1.395
diff -u -r1.395 configure.ac
--- configure.ac 13 Mar 2009 09:58:15 -0000 1.395
+++ configure.ac 30 Mar 2009 18:23:04 -0000
@@ -109,7 +109,7 @@
dnl
dnl initialize all the info variables
- curl_ssl_msg="no (--with-ssl / --with-gnutls)"
+ curl_ssl_msg="no (--with-ssl / --with-gnutls / --with-cyassl)"
curl_ssh_msg="no (--with-libssh2)"
curl_zlib_msg="no (--with-zlib)"
curl_krb4_msg="no (--with-krb4*)"
@@ -1716,7 +1716,61 @@
fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
+dnl -----------------------------------------------------------------
+dnl CyaSSL. Only check if GnuTLS, OpenSSL and NSS are not enabled
+dnl -----------------------------------------------------------------
+
+OPT_CYASSL=no
+
+AC_ARG_WITH(cyassl,dnl
+AC_HELP_STRING([--with-cyassl=PATH],[where to look for cyassl, PATH points to the build root])
+AC_HELP_STRING([--without-cyassl], [disable cyassl detection]),
+ OPT_CYASSL=$withval)
+
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED" = "x"; then
+
+ CLEANLIBS="$LIBS"
+ CLEANCPPFLAGS="$CPPFLAGS"
+
+ if test X"$OPT_CYASSL" != Xno; then
+ if test "x$OPT_CYASSL" = "xyes"; then
+ echo "ERROR: Not using cyassl"
+ echo "ERROR: We need full path to cyassl build directory"
+ else
+ addldflags="-L$OPT_CYASSL/src/.libs -R$OPT_CYASSL/src/.libs"
+ addlib="-lcyassl -lm"
+ addcflags="-I$OPT_CYASSL/include -I$OPT_CYASSL/ctaocrypt/include"
+ dnl version="unknown"
+ cyasslprofix=$OPT_CYASSL
+ if test -z "$version"; then
+ version="unknown"
+ fi
+ CYASSL_ENABLED=1
+ curl_ssl_msg="enabled (CyaSSL)"
+ AC_DEFINE(USE_CYASSL, 1, [if cyassl is enabled])
+ AC_SUBST(USE_CYASSL, [1])
+
+ AC_MSG_NOTICE([CYASSL_ENABLED = $CYASSL_ENABLED])
+ AC_MSG_NOTICE([USE_CYASSL = $USE_CYASSL])
+ fi
+ fi
+
+ if test "x$CYASSL_ENABLED" = "x1"; then
+ if test "$addcflags" != "-I/usr/include"; then
+ CPPFLAGS="$CPPFLAGS $addcflags"
+ AC_MSG_NOTICE([Added $addcflags to CPPFLAGS])
+ fi
+ LDFLAGS="$LDFLAGS $addldflags"
+ AC_MSG_NOTICE([Added $addldflags to LDFLAGS])
+ LIBS="$LIBS $addlib"
+ AC_MSG_NOTICE([Added $addlib to LIBS])
+ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OPT_CYASSL/src/.libs"
+ AC_MSG_NOTICE([Added $OPT_CYASSL/src/.libs to LD_LIBRARY_PATH])
+ fi
+
+fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1 -a NSS_ENABLED != 1
+
+if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$CYASSL_ENABLED" = "x"; then
AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
AC_MSG_WARN([Use --with-ssl, --with-gnutls or --with-nss to address this.])
else
@@ -2036,7 +2090,6 @@
CURL_CHECK_FUNC_IOCTLSOCKET
CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
CURL_CHECK_FUNC_LOCALTIME_R
-CURL_CHECK_FUNC_POLL
CURL_CHECK_FUNC_SETSOCKOPT
CURL_CHECK_FUNC_SIGACTION
CURL_CHECK_FUNC_SIGINTERRUPT
@@ -2082,6 +2135,7 @@
inet_addr \
perror \
pipe \
+ poll \
setlocale \
setmode \
setrlimit \
@@ -2138,6 +2192,45 @@
CURL_CHECK_NI_WITHSCOPEID
fi
+AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
+disable_poll=no
+case $host in
+ *-*-darwin*)
+ disable_poll="yes";
+ ;;
+ *)
+ ;;
+esac
+AC_MSG_RESULT($disable_poll)
+
+if test "$disable_poll" = "no"; then
+
+ dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
+ dnl to find out we make an extra check here!
+ if test "$ac_cv_func_poll" = "yes"; then
+ AC_MSG_CHECKING([if poll works with NULL inputs])
+ AC_RUN_IFELSE([
+#ifdef HAVE_SYS_POLL_H
+#include <sys/poll.h>
+#elif defined(HAVE_POLL_H)
+#include <poll.h>
+#endif
+
+ int main(void)
+ {
+ /* make this return 0 == timeout since there's nothing to read from */
+ return poll((void *)0, 0, 10 /*ms*/);
+ }
+],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]),
+ AC_MSG_RESULT(no),
+ AC_MSG_RESULT(cross-compiling assumes yes)
+ AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll])
+ ) dnl end of AC_RUN_IFELSE
+ fi dnl poll() was found
+fi dnl poll()-check is not disabled
+
dnl ************************************************************
dnl enable non-blocking communications
dnl
@@ -2472,7 +2565,7 @@
if test "x$USE_WINDOWS_SSPI" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
fi
-if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" -o "x$GNUTLS_ENABLED" = "x1"; then
+if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
fi
Index: lib/http.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/http.c,v
retrieving revision 1.412
diff -u -r1.412 http.c
--- lib/http.c 24 Feb 2009 08:30:09 -0000 1.412
+++ lib/http.c 30 Mar 2009 18:29:42 -0000
@@ -1890,6 +1890,18 @@
(void)numsocks;
return GETSOCK_BLANK;
}
+#else
+#ifdef USE_CYASSL
+static int https_getsock(struct connectdata *conn,
+ curl_socket_t *socks,
+ int numsocks)
+{
+ (void)conn;
+ (void)socks;
+ (void)numsocks;
+ return GETSOCK_BLANK;
+}
+#endif
#endif
#endif
#endif
Index: lib/Makefile.inc
===================================================================
RCS file: /cvsroot/curl/curl/lib/Makefile.inc,v
retrieving revision 1.27
diff -u -r1.27 Makefile.inc
--- lib/Makefile.inc 9 Mar 2009 12:21:47 -0000 1.27
+++ lib/Makefile.inc 30 Mar 2009 18:28:41 -0000
@@ -10,7 +10,7 @@
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c \
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \
- socks_gssapi.c socks_sspi.c curl_sspi.c slist.c
+ socks_gssapi.c socks_sspi.c curl_sspi.c slist.c cyassl.c
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
@@ -21,4 +21,4 @@
strtoofft.h strerror.h inet_ntop.h curlx.h memory.h setup.h \
transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \
tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \
- curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h
+ curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h cyassl.h
Index: lib/sslgen.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/sslgen.c,v
retrieving revision 1.45
diff -u -r1.45 sslgen.c
--- lib/sslgen.c 25 Feb 2009 12:51:39 -0000 1.45
+++ lib/sslgen.c 30 Mar 2009 18:34:50 -0000
@@ -56,6 +56,7 @@
#include "gtls.h" /* GnuTLS versions */
#include "nssg.h" /* NSS versions */
#include "qssl.h" /* QSOSSL versions */
+#include "cyassl.h"
#include "sendf.h"
#include "rawstr.h"
#include "url.h"
Index: lib/urldata.h
===================================================================
RCS file: /cvsroot/curl/curl/lib/urldata.h,v
retrieving revision 1.409
diff -u -r1.409 urldata.h
--- lib/urldata.h 2 Mar 2009 23:05:31 -0000 1.409
+++ lib/urldata.h 30 Mar 2009 18:35:49 -0000
@@ -99,6 +99,11 @@
#include <qsossl.h>
#endif
+#ifdef USE_CYASSL
+/* This header in fact belongs to cyassl's openssl compat layer */
+#include <openssl/ssl.h>
+#endif /* USE_CYASSL */
+
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
@@ -214,6 +219,10 @@
#ifdef USE_QSOSSL
SSLHandle *handle;
#endif /* USE_QSOSSL */
+#ifdef USE_CYASSL
+ SSL* handle;
+ SSL_CTX* ctx;
+#endif /* USE_CYASSL */
};
struct ssl_config_data {
Index: lib/setup.h
===================================================================
RCS file: /cvsroot/curl/curl/lib/setup.h,v
retrieving revision 1.163
diff -u -r1.163 setup.h
--- lib/setup.h 12 Feb 2009 20:48:44 -0000 1.163
+++ lib/setup.h 30 Mar 2009 18:31:03 -0000
@@ -450,7 +450,7 @@
#define LIBIDN_REQUIRED_VERSION "0.4.1"
-#if defined(USE_GNUTLS) || defined(USE_SSLEAY) || defined(USE_NSS) || defined(USE_QSOSSL)
+#if defined(USE_GNUTLS) || defined(USE_SSLEAY) || defined(USE_NSS) || defined(USE_QSOSSL) || defined(USE_CYASSL)
#define USE_SSL /* SSL support has been enabled */
#endif