diff options
Diffstat (limited to 'include/mod_gnutls.h')
-rw-r--r-- | include/mod_gnutls.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/include/mod_gnutls.h b/include/mod_gnutls.h index 70e641f..b1abd52 100644 --- a/include/mod_gnutls.h +++ b/include/mod_gnutls.h | |||
@@ -40,6 +40,21 @@ module AP_MODULE_DECLARE_DATA gnutls_module; | |||
40 | #define GNUTLS_ENABLED_TRUE 1 | 40 | #define GNUTLS_ENABLED_TRUE 1 |
41 | 41 | ||
42 | 42 | ||
43 | /** | ||
44 | * GnuTLS changed the names of several structures between 1.0.X and 1.1.X | ||
45 | * This is just a simple hack so we can compile with both versions. | ||
46 | * There is a full list in <gnutls/compat.h>, But I am just | ||
47 | * doing this for a few types we use. | ||
48 | */ | ||
49 | #ifndef gnutls_certificate_credentials_t | ||
50 | #define gnutls_certificate_credentials_t gnutls_certificate_credentials | ||
51 | #define gnutls_anon_server_credentials_t gnutls_anon_server_credentials | ||
52 | #define gnutls_session_t gnutls_session | ||
53 | #define gnutls_transport_ptr_t gnutls_transport_ptr | ||
54 | #define gnutls_dh_params_t gnutls_dh_params | ||
55 | #define gnutls_rsa_params_t gnutls_rsa_params | ||
56 | #endif | ||
57 | |||
43 | typedef struct | 58 | typedef struct |
44 | { | 59 | { |
45 | gnutls_certificate_credentials_t certs; | 60 | gnutls_certificate_credentials_t certs; |
@@ -52,19 +67,18 @@ typedef struct | |||
52 | int macs[16]; | 67 | int macs[16]; |
53 | int protocol[16]; | 68 | int protocol[16]; |
54 | int compression[16]; | 69 | int compression[16]; |
55 | } gnutls_srvconf_rec; | 70 | } mod_gnutls_srvconf_rec; |
56 | 71 | ||
57 | typedef struct gnutls_handle_t gnutls_handle_t; | 72 | typedef struct |
58 | struct gnutls_handle_t | ||
59 | { | 73 | { |
60 | gnutls_srvconf_rec *sc; | 74 | mod_gnutls_srvconf_rec *sc; |
61 | gnutls_session_t session; | 75 | gnutls_session_t session; |
62 | ap_filter_t *input_filter; | 76 | ap_filter_t *input_filter; |
63 | apr_bucket_brigade *input_bb; | 77 | apr_bucket_brigade *input_bb; |
64 | apr_read_type_e input_block; | 78 | apr_read_type_e input_block; |
65 | int status; | 79 | int status; |
66 | int non_https; | 80 | int non_https; |
67 | }; | 81 | } mod_gnutls_handle_t; |
68 | 82 | ||
69 | /** Functions in gnutls_io.c **/ | 83 | /** Functions in gnutls_io.c **/ |
70 | 84 | ||
@@ -79,9 +93,10 @@ struct gnutls_handle_t | |||
79 | * @return result status | 93 | * @return result status |
80 | */ | 94 | */ |
81 | apr_status_t mod_gnutls_filter_input(ap_filter_t * f, | 95 | apr_status_t mod_gnutls_filter_input(ap_filter_t * f, |
82 | apr_bucket_brigade * bb, | 96 | apr_bucket_brigade * bb, |
83 | ap_input_mode_t mode, | 97 | ap_input_mode_t mode, |
84 | apr_read_type_e block, apr_off_t readbytes); | 98 | apr_read_type_e block, |
99 | apr_off_t readbytes); | ||
85 | 100 | ||
86 | /** | 101 | /** |
87 | * mod_gnutls_filter_output will filter the encrypt | 102 | * mod_gnutls_filter_output will filter the encrypt |
@@ -91,7 +106,8 @@ apr_status_t mod_gnutls_filter_input(ap_filter_t * f, | |||
91 | * @param bb the bucket brigade, where to store the result to | 106 | * @param bb the bucket brigade, where to store the result to |
92 | * @return result status | 107 | * @return result status |
93 | */ | 108 | */ |
94 | apr_status_t mod_gnutls_filter_output(ap_filter_t * f, apr_bucket_brigade * bb); | 109 | apr_status_t mod_gnutls_filter_output(ap_filter_t * f, |
110 | apr_bucket_brigade * bb); | ||
95 | 111 | ||
96 | 112 | ||
97 | /** | 113 | /** |
@@ -104,7 +120,7 @@ apr_status_t mod_gnutls_filter_output(ap_filter_t * f, apr_bucket_brigade * bb); | |||
104 | * @return size length of the data stored in buffer | 120 | * @return size length of the data stored in buffer |
105 | */ | 121 | */ |
106 | ssize_t mod_gnutls_transport_read(gnutls_transport_ptr_t ptr, | 122 | ssize_t mod_gnutls_transport_read(gnutls_transport_ptr_t ptr, |
107 | void *buffer, size_t len); | 123 | void *buffer, size_t len); |
108 | 124 | ||
109 | /** | 125 | /** |
110 | * mod_gnutls_transport_write is called from GnuTLS to | 126 | * mod_gnutls_transport_write is called from GnuTLS to |
@@ -116,7 +132,7 @@ ssize_t mod_gnutls_transport_read(gnutls_transport_ptr_t ptr, | |||
116 | * @return size length of the data written | 132 | * @return size length of the data written |
117 | */ | 133 | */ |
118 | ssize_t mod_gnutls_transport_write(gnutls_transport_ptr_t ptr, | 134 | ssize_t mod_gnutls_transport_write(gnutls_transport_ptr_t ptr, |
119 | const void *buffer, size_t len); | 135 | const void *buffer, size_t len); |
120 | 136 | ||
121 | 137 | ||
122 | #endif /* __mod_gnutls_h_inc */ | 138 | #endif /* __mod_gnutls_h_inc */ |