Imported Upstream version 2.72.alpha
[platform/upstream/glib-networking.git] / tls / openssl / openssl-include.h
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * gtlscertificate-openssl.h
4  *
5  * Copyright (C) 2015 NICE s.r.l.
6  *
7  * This file is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This file is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * In addition, when the library is used with OpenSSL, a special
21  * exception applies. Refer to the LICENSE_EXCEPTION file for details.
22  *
23  * Authors: Ignacio Casal Quinteiro
24  *          Christoph Reiter
25  */
26
27 #pragma once
28
29 /* Due to name clashes between Windows and openssl headers we have to
30  * make sure windows.h is included before openssl and that we undef the
31  * clashing macros. We also need `struct timeval` for DTLSv1_get_timeout(),
32  * and the following header also covers it for Windows.
33  */
34 #include <gio/gnetworking.h>
35 #ifdef G_OS_WIN32
36 /* These are defined by the Windows headers, but clash with openssl */
37 #undef X509_NAME
38 #undef X509_CERT_PAIR
39 #undef X509_EXTENSIONS
40 #undef OCSP_REQUEST
41 #undef OCSP_RESPONSE
42 #else
43 /* Need `struct timeval` for DTLSv1_get_timeout() */
44 #include <sys/time.h>
45 #endif
46
47 #include <openssl/ssl.h>
48 #include <openssl/bio.h>
49 #include <openssl/err.h>
50 #include <openssl/x509.h>
51 #include <openssl/x509_vfy.h>
52 #include <openssl/x509v3.h>
53 #include <openssl/crypto.h>
54 #include <openssl/ocsp.h>