configure: add --with-amissl

AmiSSL is an Amiga native library which provides a wrapper over OpenSSL.
It also requires all programs using it to use bsdsocket.library
directly, rather than accessing socket functions through clib, which
libcurl was not necessarily doing previously. Configure will now check
for the headers and ensure they are included if found.

Closes #3677
This commit is contained in:
Chris Young 2019-03-08 00:06:59 +00:00 committed by Daniel Stenberg
parent 76a9d8df0e
commit 1e853653d2
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
8 changed files with 194 additions and 21 deletions

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -22,17 +22,26 @@
#include "curl_setup.h"
#if defined(__AMIGA__) && !defined(__ixemul__)
#ifdef __AMIGA__
# include "amigaos.h"
# if defined(HAVE_PROTO_BSDSOCKET_H) && !defined(USE_AMISSL)
# include <amitcp/socketbasetags.h>
# endif
# ifdef __libnix__
# include <stabs.h>
# endif
#endif
#include <amitcp/socketbasetags.h>
#include "amigaos.h"
/* The last #include files should be: */
#include "curl_memory.h"
#include "memdebug.h"
#ifdef __AMIGA__
#if defined(HAVE_PROTO_BSDSOCKET_H) && !defined(USE_AMISSL)
struct Library *SocketBase = NULL;
extern int errno, h_errno;
#ifdef __libnix__
#include <stabs.h>
void __request(const char *msg);
#else
# define __request(msg) Printf(msg "\n\a")
@ -74,4 +83,13 @@ bool Curl_amiga_init()
ADD2EXIT(Curl_amiga_cleanup, -50);
#endif
#endif /* __AMIGA__ && ! __ixemul__ */
#endif /* HAVE_PROTO_BSDSOCKET_H */
#ifdef USE_AMISSL
void Curl_amiga_X509_free(X509 *a)
{
X509_free(a);
}
#endif /* USE_AMISSL */
#endif /* __AMIGA__ */

View file

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -23,7 +23,7 @@
***************************************************************************/
#include "curl_setup.h"
#if defined(__AMIGA__) && !defined(__ixemul__)
#if defined(__AMIGA__) && defined(HAVE_BSDSOCKET_H) && !defined(USE_AMISSL)
bool Curl_amiga_init();
void Curl_amiga_cleanup();
@ -35,4 +35,10 @@ void Curl_amiga_cleanup();
#endif
#ifdef USE_AMISSL
#include <openssl/x509v3.h>
void Curl_amiga_X509_free(X509 *a);
#endif /* USE_AMISSL */
#endif /* HEADER_CURL_AMIGAOS_H */

View file

@ -310,11 +310,12 @@
#endif
#ifdef __AMIGA__
# ifndef __ixemul__
# include <exec/types.h>
# include <exec/execbase.h>
# include <proto/exec.h>
# include <proto/dos.h>
# include <exec/types.h>
# include <exec/execbase.h>
# include <proto/exec.h>
# include <proto/dos.h>
# ifdef HAVE_PROTO_BSDSOCKET_H
# include <proto/bsdsocket.h> /* ensure bsdsocket.library use */
# define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
# endif
#endif

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -83,7 +83,7 @@ static void MD5_Final(unsigned char digest[16], MD5_CTX * ctx)
gcry_md_close(*ctx);
}
#elif defined(USE_OPENSSL)
#elif defined(USE_OPENSSL) && !defined(USE_AMISSL)
/* When OpenSSL is available we use the MD5-function from OpenSSL */
#include <openssl/md5.h>
#include "curl_memory.h"

View file

@ -65,6 +65,10 @@
#include <openssl/buffer.h>
#include <openssl/pkcs12.h>
#ifdef USE_AMISSL
#include "amigaos.h"
#endif
#if (OPENSSL_VERSION_NUMBER >= 0x0090808fL) && !defined(OPENSSL_NO_OCSP)
#include <openssl/ocsp.h>
#endif
@ -820,8 +824,11 @@ int cert_stuff(struct connectdata *conn,
fail:
EVP_PKEY_free(pri);
X509_free(x509);
#ifdef USE_AMISSL
sk_X509_pop_free(ca, Curl_amiga_X509_free);
#else
sk_X509_pop_free(ca, X509_free);
#endif
if(!cert_done)
return 0; /* failure! */
break;