2008-04-21 22:27:15 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* Copyright (C) 2008 by Lothar May *
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
|
***************************************************************************/
|
2008-05-16 18:47:44 +00:00
|
|
|
/* Wrapper for GnuTLS openssl include. Needed for Windows/MacOS compatibility. */
|
2008-04-21 22:27:15 +00:00
|
|
|
|
|
|
|
|
#ifndef _OPENSSL_WRAPPER_H_
|
|
|
|
|
#define _OPENSSL_WRAPPER_H_
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_SSIZE_T
|
2008-05-11 21:41:30 +00:00
|
|
|
#define HAVE_SSIZE_T
|
2008-04-21 22:27:15 +00:00
|
|
|
#include <sys/types.h>
|
2010-10-08 21:25:31 +00:00
|
|
|
#ifdef _WIN64 // This is only for Windows.
|
2008-04-25 14:52:19 +00:00
|
|
|
#ifndef _SSIZE_T_
|
2010-10-08 21:25:31 +00:00
|
|
|
typedef long long ssize_t;
|
|
|
|
|
#define _SSIZE_T_
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _PID_T_
|
|
|
|
|
typedef __int64 pid_t;
|
|
|
|
|
#define _PID_T_
|
|
|
|
|
#endif
|
|
|
|
|
#elif _WIN32
|
|
|
|
|
#ifndef _SSIZE_T_
|
|
|
|
|
typedef int ssize_t;
|
2008-04-25 14:52:19 +00:00
|
|
|
#define _SSIZE_T_
|
2008-04-24 22:11:43 +00:00
|
|
|
#endif
|
2008-04-25 14:52:19 +00:00
|
|
|
#ifndef _PID_T_
|
|
|
|
|
typedef int pid_t;
|
|
|
|
|
#define _PID_T_
|
2008-04-24 22:11:43 +00:00
|
|
|
#endif
|
2008-04-21 22:27:15 +00:00
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef X509_NAME
|
|
|
|
|
#undef X509_NAME // Again for Windows - conflict with WinCrypt.h.
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-02-16 20:14:12 +00:00
|
|
|
// For BSD-Systems, we assume that OpenSSL is part of the operating system.
|
2009-02-20 17:28:52 +00:00
|
|
|
//
|
|
|
|
|
// make sure you understood the following issue before defining this directive.
|
|
|
|
|
// "2. Can I use OpenSSL with GPL software?"
|
|
|
|
|
// http://www.openssl.org/support/faq.html#LEGAL2
|
2009-02-20 17:27:48 +00:00
|
|
|
//
|
2010-10-09 00:07:33 +00:00
|
|
|
#if defined(_WIN64) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
2009-02-16 20:14:12 +00:00
|
|
|
#define HAVE_OPENSSL
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENSSL
|
2008-05-16 18:54:00 +00:00
|
|
|
#include <openssl/ssl.h>
|
2008-05-16 18:47:44 +00:00
|
|
|
#include <openssl/md5.h>
|
2009-12-28 12:16:52 +00:00
|
|
|
#include <openssl/sha.h>
|
2009-12-28 17:29:21 +00:00
|
|
|
#include <openssl/hmac.h>
|
2008-05-16 18:47:44 +00:00
|
|
|
#include <openssl/rand.h>
|
2009-12-28 12:16:52 +00:00
|
|
|
#include <openssl/evp.h>
|
2008-05-16 18:47:44 +00:00
|
|
|
#else
|
|
|
|
|
// For all other systems, we use GnuTLS.
|
|
|
|
|
#include <gnutls/openssl.h>
|
2009-12-29 17:59:04 +00:00
|
|
|
#include <gcrypt.h>
|
2008-05-16 18:47:44 +00:00
|
|
|
#define PKTH_USE_GNUTLS
|
|
|
|
|
#endif
|
2008-04-21 22:27:15 +00:00
|
|
|
|
|
|
|
|
#endif
|