Debian Codegraph @

WWW/Library/Implementation/HTTLS.h

raw
1 /*
2 * $LynxId: HTTLS.h,v 1.1 2025/07/22 00:19:55 tom Exp $
3 *
4 * Macros for HTTLS.c
5 */
6
7 #ifndef HTTLS_H
8 #define HTTLS_H
9
10 #include <HTUtils.h>
11
12 #ifdef USE_SSL
13
14 #define free_func free__func
15
16 #if defined(USE_OPENSSL_INCL)
17
18 #include <openssl/ssl.h>
19 #include <openssl/crypto.h>
20 #include <openssl/rand.h>
21 #include <openssl/err.h>
22
23 #elif defined(USE_GNUTLS_INCL)
24
25 #include <tidy_tls.h>
26
27 #else
28
29 #include <ssl.h>
30 #include <crypto.h>
31 #include <rand.h>
32 #include <err.h>
33
34 #endif /* USE_OPENSSL_INCL */
35
36 #undef free_func
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 extern SSL *SSL_handle;
42
43 extern SSL *HTGetSSLHandle(void);
44 extern SSL *HTSSLConnect(int fd, const char *url,
45 int min_version, int max_version);
46 extern void HTSSLInitPRNG(void);
47 extern int HTGetSSLCharacter(void *handle);
48
49 /* TLS version number macros for HTSSLConnect */
50 #define HTTLS_ANY_VERSION 0 /* Don't configure a specific min/max version,
51 just allow the lowest/highest version
52 available */
53
54 /* Version number polyfills. The libssl TLS version number macros are 2 bit
55 * unsigned integers, so by setting these to negative numbers we can detect
56 * versions of TLS that libssl doesn't support, and create a consistent API.
57 * */
58 #ifndef SSL3_VERSION
59 #define SSL3_VERSION -1
60 #endif
61 #ifndef TLS1_VERSION
62 #define TLS1_VERSION -2
63 #endif
64 #ifndef TLS1_1_VERSION
65 #define TLS1_1_VERSION -3
66 #endif
67 #ifndef TLS1_2_VERSION
68 #define TLS1_2_VERSION -4
69 #endif
70 #ifndef TLS1_3_VERSION
71 #define TLS1_3_VERSION -5
72 #endif
73
74 #define HTSSL_MAX_VERSION SSL3_VERSION /* The highest SSL version. This can be
75 used to disable TLS support on a
76 connection. */
77
78 #ifdef __cplusplus
79 }
80 #endif
81 #endif /* USE_SSL */
82 #endif /* HTTLS_H */