James Kuszmaul | 82f6c04 | 2021-01-17 11:30:16 -0800 | [diff] [blame^] | 1 | /** |
| 2 | * @file openssl/tls.h TLS backend using OpenSSL (Internal API) |
| 3 | * |
| 4 | * Copyright (C) 2010 Creytiv.com |
| 5 | */ |
| 6 | |
| 7 | |
| 8 | /* |
| 9 | * Mapping of feature macros |
| 10 | */ |
| 11 | |
| 12 | #if OPENSSL_VERSION_NUMBER >= 0x10100000L |
| 13 | #define TLS_BIO_OPAQUE 1 |
| 14 | #endif |
| 15 | |
| 16 | #if defined (LIBRESSL_VERSION_NUMBER) |
| 17 | #undef TLS_BIO_OPAQUE |
| 18 | #endif |
| 19 | |
| 20 | |
| 21 | #if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ |
| 22 | !defined(LIBRESSL_VERSION_NUMBER) |
| 23 | #define SSL_state SSL_get_state |
| 24 | #define SSL_ST_OK TLS_ST_OK |
| 25 | #endif |
| 26 | |
| 27 | |
| 28 | struct tls { |
| 29 | SSL_CTX *ctx; |
| 30 | X509 *cert; |
| 31 | char *pass; /* password for private key */ |
| 32 | }; |
| 33 | |
| 34 | |
| 35 | void tls_flush_error(void); |