]>
Commit | Line | Data |
---|---|---|
c25aa7cd PP |
1 | /* |
2 | * Copyright (C) the libgit2 contributors. All rights reserved. | |
3 | * | |
4 | * This file is part of libgit2, distributed under the GNU GPL v2 with | |
5 | * a Linking Exception. For full terms see the included COPYING file. | |
6 | */ | |
7 | #ifndef INCLUDE_streams_openssl_legacy_h__ | |
8 | #define INCLUDE_streams_openssl_legacy_h__ | |
9 | ||
10 | #include "streams/openssl_dynamic.h" | |
11 | ||
12 | #if defined(GIT_OPENSSL) && !defined(GIT_OPENSSL_DYNAMIC) | |
13 | # include <openssl/ssl.h> | |
14 | # include <openssl/err.h> | |
15 | # include <openssl/x509v3.h> | |
16 | # include <openssl/bio.h> | |
17 | ||
18 | # if (defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L) || \ | |
19 | (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) | |
20 | # define GIT_OPENSSL_LEGACY | |
21 | # endif | |
22 | #endif | |
23 | ||
24 | #if defined(GIT_OPENSSL_LEGACY) && !defined(GIT_OPENSSL_DYNAMIC) | |
25 | # define OPENSSL_init_ssl OPENSSL_init_ssl__legacy | |
26 | # define BIO_meth_new BIO_meth_new__legacy | |
27 | # define BIO_meth_free BIO_meth_free__legacy | |
28 | # define BIO_meth_set_write BIO_meth_set_write__legacy | |
29 | # define BIO_meth_set_read BIO_meth_set_read__legacy | |
30 | # define BIO_meth_set_puts BIO_meth_set_puts__legacy | |
31 | # define BIO_meth_set_gets BIO_meth_set_gets__legacy | |
32 | # define BIO_meth_set_ctrl BIO_meth_set_ctrl__legacy | |
33 | # define BIO_meth_set_create BIO_meth_set_create__legacy | |
34 | # define BIO_meth_set_destroy BIO_meth_set_destroy__legacy | |
35 | # define BIO_get_new_index BIO_get_new_index__legacy | |
36 | # define BIO_set_data BIO_set_data__legacy | |
37 | # define BIO_set_init BIO_set_init__legacy | |
38 | # define BIO_get_data BIO_get_data__legacy | |
39 | # define ASN1_STRING_get0_data ASN1_STRING_get0_data__legacy | |
40 | #endif | |
41 | ||
42 | #if defined(GIT_OPENSSL_LEGACY) || defined(GIT_OPENSSL_DYNAMIC) | |
43 | ||
44 | extern int OPENSSL_init_ssl__legacy(uint64_t opts, const void *settings); | |
45 | extern BIO_METHOD *BIO_meth_new__legacy(int type, const char *name); | |
46 | extern void BIO_meth_free__legacy(BIO_METHOD *biom); | |
47 | extern int BIO_meth_set_write__legacy(BIO_METHOD *biom, int (*write) (BIO *, const char *, int)); | |
48 | extern int BIO_meth_set_read__legacy(BIO_METHOD *biom, int (*read) (BIO *, char *, int)); | |
49 | extern int BIO_meth_set_puts__legacy(BIO_METHOD *biom, int (*puts) (BIO *, const char *)); | |
50 | extern int BIO_meth_set_gets__legacy(BIO_METHOD *biom, int (*gets) (BIO *, char *, int)); | |
51 | extern int BIO_meth_set_ctrl__legacy(BIO_METHOD *biom, long (*ctrl) (BIO *, int, long, void *)); | |
52 | extern int BIO_meth_set_create__legacy(BIO_METHOD *biom, int (*create) (BIO *)); | |
53 | extern int BIO_meth_set_destroy__legacy(BIO_METHOD *biom, int (*destroy) (BIO *)); | |
54 | extern int BIO_get_new_index__legacy(void); | |
55 | extern void BIO_set_data__legacy(BIO *a, void *ptr); | |
56 | extern void BIO_set_init__legacy(BIO *b, int init); | |
57 | extern void *BIO_get_data__legacy(BIO *a); | |
58 | extern const unsigned char *ASN1_STRING_get0_data__legacy(const ASN1_STRING *x); | |
59 | extern long SSL_CTX_set_options__legacy(SSL_CTX *ctx, long op); | |
60 | ||
61 | #endif | |
62 | ||
63 | #endif |