Changeset 62f781c in mod_gnutls for include/mod_gnutls.h.in
- Timestamp:
- Feb 21, 2014, 12:15:56 AM (7 years ago)
- Branches:
- debian/master, debian/stretch-backports, jessie-backports
- Children:
- 2d18ec2
- Parents:
- 1743114 (diff), ae29683 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/mod_gnutls.h.in
r1743114 r62f781c 16 16 */ 17 17 18 /* Apache Runtime Headers */ 18 19 #include "httpd.h" 19 20 #include "http_config.h" … … 27 28 #include "apr_tables.h" 28 29 #include "ap_release.h" 29 30 #include "apr_fnmatch.h" 31 /* GnuTLS Library Headers */ 30 32 #include <gnutls/gnutls.h> 33 #if GNUTLS_VERSION_MAJOR == 2 31 34 #include <gnutls/extra.h> 35 #endif 32 36 #include <gnutls/openpgp.h> 33 37 #include <gnutls/x509.h> … … 40 44 extern module AP_MODULE_DECLARE_DATA gnutls_module; 41 45 46 /* IO Filter names */ 42 47 #define GNUTLS_OUTPUT_FILTER_NAME "gnutls_output_filter" 43 48 #define GNUTLS_INPUT_FILTER_NAME "gnutls_input_filter" 44 49 /* GnuTLS Constants */ 45 50 #define GNUTLS_ENABLED_FALSE 0 46 51 #define GNUTLS_ENABLED_TRUE 1 47 52 #define GNUTLS_ENABLED_UNSET 2 53 /* Current module version */ 48 54 #define MOD_GNUTLS_VERSION "@MOD_GNUTLS_VERSION@" 49 55 56 /* Module Debug Mode */ 50 57 #define MOD_GNUTLS_DEBUG @OOO_MAINTAIN@ 51 58 52 /* Recent Versions of 2.1 renamed several hooks. This allows us to 53 compile on 2.0.xx */ 59 /* 60 * Recent Versions of 2.1 renamed several hooks. 61 * This allows us to compile on 2.0.xx 62 */ 54 63 #if AP_SERVER_MINORVERSION_NUMBER >= 2 || (AP_SERVER_MINORVERSION_NUMBER == 1 && AP_SERVER_PATCHLEVEL_NUMBER >= 3) 55 #define USING_2_1_RECENT 1 56 #endif 57 58 #ifndef USING_2_1_RECENT 59 #define USING_2_1_RECENT 0 64 #define USING_2_1_RECENT 1 65 #else 66 #define USING_2_1_RECENT 0 60 67 #endif 61 68 62 typedef enum 63 { 69 /* mod_gnutls Cache Types */ 70 typedef enum { 71 /* No Cache */ 64 72 mgs_cache_none, 73 /* Use Old Berkley DB */ 65 74 mgs_cache_dbm, 75 /* Use Gnu's version of Berkley DB */ 66 76 mgs_cache_gdbm, 67 77 #if HAVE_APR_MEMCACHE 68 mgs_cache_memcache 78 /* Use Memcache */ 79 mgs_cache_memcache, 69 80 #endif 81 mgs_cache_unset 70 82 } mgs_cache_e; 71 83 72 typedef struct 73 { 84 typedef enum { 85 mgs_cvm_unset, 86 mgs_cvm_cartel, 87 mgs_cvm_msva 88 } mgs_client_verification_method_e; 89 90 91 /* Directory Configuration Record */ 92 typedef struct { 74 93 int client_verify_mode; 75 94 const char* lua_bytecode; … … 78 97 79 98 80 /* The maximum number of certificates to send in a chain 81 */ 99 /* The maximum number of certificates to send in a chain */ 82 100 #define MAX_CHAIN_SIZE 8 83 84 typedef struct 85 { 101 /* The maximum number of SANs to read from a x509 certificate */ 102 #define MAX_CERT_SAN 5 103 104 /* Server Configuration Record */ 105 typedef struct { 106 /* x509 Certificate Structure */ 86 107 gnutls_certificate_credentials_t certs; 108 /* SRP Certificate Structure*/ 87 109 gnutls_srp_server_credentials_t srp_creds; 110 /* Annonymous Certificate Structure */ 88 111 gnutls_anon_server_credentials_t anon_creds; 112 /* Current x509 Certificate CN [Common Name] */ 89 113 char* cert_cn; 90 gnutls_x509_crt_t certs_x509[MAX_CHAIN_SIZE]; /* A certificate chain */ 91 unsigned int certs_x509_num; 114 /* Current x509 Certificate SAN [Subject Alternate Name]s*/ 115 char* cert_san[MAX_CERT_SAN]; 116 /* A x509 Certificate Chain */ 117 gnutls_x509_crt_t *certs_x509_chain; 118 /* Current x509 Certificate Private Key */ 92 119 gnutls_x509_privkey_t privkey_x509; 93 gnutls_openpgp_crt_t cert_pgp; /* A certificate chain */ 120 /* OpenPGP Certificate */ 121 gnutls_openpgp_crt_t cert_pgp; 122 /* OpenPGP Certificate Private Key */ 94 123 gnutls_openpgp_privkey_t privkey_pgp; 124 /* Number of Certificates in Chain */ 125 unsigned int certs_x509_chain_num; 126 /* Is the module enabled? */ 95 127 int enabled; 96 /* whether to send the PEM encoded certificates 97 * to CGIs 98 */ 128 /* Export full certificates to CGI environment: */ 99 129 int export_certificates_enabled; 130 /* GnuTLS Priorities */ 100 131 gnutls_priority_t priorities; 101 gnutls_rsa_params_t rsa_params; 132 /* GnuTLS DH Parameters */ 102 133 gnutls_dh_params_t dh_params; 134 /* Cache timeout value */ 103 135 int cache_timeout; 136 /* Chose Cache Type */ 104 137 mgs_cache_e cache_type; 105 138 const char* cache_config; 106 139 const char* srp_tpasswd_file; 107 140 const char* srp_tpasswd_conf_file; 141 /* A list of CA Certificates */ 108 142 gnutls_x509_crt_t *ca_list; 143 /* OpenPGP Key Ring */ 109 144 gnutls_openpgp_keyring_t pgp_list; 145 /* CA Certificate list size */ 110 146 unsigned int ca_list_size; 147 /* Client Certificate Verification Mode */ 111 148 int client_verify_mode; 149 /* Client Certificate Verification Method */ 150 mgs_client_verification_method_e client_verify_method; 151 /* Last Cache timestamp */ 112 152 apr_time_t last_cache_check; 113 int tickets; /* whether session tickets are allowed */ 153 /* GnuTLS uses Session Tickets */ 154 int tickets; 155 /* Is mod_proxy enabled? */ 156 int proxy_enabled; 157 /* A Plain HTTP request */ 158 int non_ssl_request; 114 159 } mgs_srvconf_rec; 115 160 161 /* Character Buffer */ 116 162 typedef struct { 117 163 int length; … … 119 165 } mgs_char_buffer_t; 120 166 121 typedef struct 122 { 167 /* GnuTLS Handle */ 168 typedef struct { 169 /* Server configuration record */ 123 170 mgs_srvconf_rec *sc; 171 /* Connection record */ 124 172 conn_rec* c; 173 /* GnuTLS Session handle */ 125 174 gnutls_session_t session; 126 175 /* module input status */ 127 176 apr_status_t input_rc; 177 /* Input filter */ 128 178 ap_filter_t *input_filter; 179 /* Input Bucket Brigade */ 129 180 apr_bucket_brigade *input_bb; 181 /* Input Read Type */ 130 182 apr_read_type_e input_block; 183 /* Input Mode */ 131 184 ap_input_mode_t input_mode; 185 /* Input Character Buffer */ 132 186 mgs_char_buffer_t input_cbuf; 187 /* Input Character Array */ 133 188 char input_buffer[AP_IOBUFSIZE]; 134 189 /* module Output status */ 135 190 apr_status_t output_rc; 191 /* Output filter */ 136 192 ap_filter_t *output_filter; 193 /* Output Bucket Brigade */ 137 194 apr_bucket_brigade *output_bb; 195 /* Output character array */ 138 196 char output_buffer[AP_IOBUFSIZE]; 197 /* Output buffer length */ 139 198 apr_size_t output_blen; 199 /* Output length */ 140 200 apr_size_t output_length; 141 201 /* General Status */ 142 202 int status; 143 int non_https;144 203 } mgs_handle_t; 145 204 205 206 146 207 /** Functions in gnutls_io.c **/ 147 208 148 /** 149 * write_flush will flush data 150 */ 151 static ssize_t write_flush(mgs_handle_t * ctxt); 209 /* apr_signal_block() for blocking SIGPIPE */ 210 apr_status_t apr_signal_block(int signum); 211 212 /* Proxy Support */ 213 /* An optional function which returns non-zero if the given connection 214 is using SSL/TLS. */ 215 APR_DECLARE_OPTIONAL_FN(int, ssl_is_https, (conn_rec *)); 216 /* The ssl_proxy_enable() and ssl_engine_disable() optional functions 217 * are used by mod_proxy to enable use of SSL for outgoing 218 * connections. */ 219 APR_DECLARE_OPTIONAL_FN(int, ssl_proxy_enable, (conn_rec *)); 220 APR_DECLARE_OPTIONAL_FN(int, ssl_engine_disable, (conn_rec *)); 221 int ssl_is_https(conn_rec *c); 222 int ssl_proxy_enable(conn_rec *c); 223 int ssl_engine_disable(conn_rec *c); 224 const char *mgs_set_proxy_engine(cmd_parms * parms, void *dummy, 225 const char *arg); 226 apr_status_t mgs_cleanup_pre_config(void *data); 152 227 153 228 /** … … 180 255 181 256 /** 182 * mgs_transport_read is called from GnuTLS to provide encrypted 257 * mgs_transport_read is called from GnuTLS to provide encrypted 183 258 * data from the client. 184 259 * … … 192 267 193 268 /** 194 * mgs_transport_write is called from GnuTLS to 269 * mgs_transport_write is called from GnuTLS to 195 270 * write data to the client. 196 271 * … … 211 286 * Init the Cache after Configuration is done 212 287 */ 213 int mgs_cache_post_config(apr_pool_t *p, server_rec *s, 288 int mgs_cache_post_config(apr_pool_t *p, server_rec *s, 214 289 mgs_srvconf_rec *sc); 215 290 /** 216 291 * Init the Cache inside each Process 217 292 */ 218 int mgs_cache_child_init(apr_pool_t *p, server_rec *s, 293 int mgs_cache_child_init(apr_pool_t *p, server_rec *s, 219 294 mgs_srvconf_rec *sc); 220 295 /** … … 225 300 #define GNUTLS_SESSION_ID_STRING_LEN \ 226 301 ((GNUTLS_MAX_SESSION_ID + 1) * 2) 227 302 228 303 /** 229 304 * Convert a SSL Session ID into a Null Terminated Hex Encoded String … … 253 328 const char *mgs_set_dh_file(cmd_parms * parms, void *dummy, 254 329 const char *arg); 255 const char *mgs_set_rsa_export_file(cmd_parms * parms, void *dummy,256 const char *arg);257 330 const char *mgs_set_cert_file(cmd_parms * parms, void *dummy, 258 331 const char *arg); … … 275 348 const char *mgs_set_client_verify(cmd_parms * parms, void *dummy, 276 349 const char *arg); 350 351 const char *mgs_set_client_verify_method(cmd_parms * parms, void *dummy, 352 const char *arg); 277 353 278 354 const char *mgs_set_client_ca_file(cmd_parms * parms, void *dummy, … … 290 366 const char *mgs_set_tickets(cmd_parms * parms, void *dummy, 291 367 const char *arg); 292 293 const char *mgs_set_require_section(cmd_parms *cmd, 368 369 const char *mgs_set_require_section(cmd_parms *cmd, 294 370 void *mconfig, const char *arg); 295 371 void *mgs_config_server_create(apr_pool_t * p, server_rec * s); 372 void *mgs_config_server_merge(apr_pool_t *p, void *BASE, void *ADD); 296 373 297 374 void *mgs_config_dir_merge(apr_pool_t *p, void *basev, void *addv); … … 299 376 void *mgs_config_dir_create(apr_pool_t *p, char *dir); 300 377 301 const char *mgs_set_require_bytecode(cmd_parms *cmd, 378 const char *mgs_set_require_bytecode(cmd_parms *cmd, 302 379 void *mconfig, const char *arg); 303 380 … … 325 402 int mgs_hook_authz(request_rec *r); 326 403 327 int mgs_authz_lua(request_rec* r);328 329 404 #endif /* __mod_gnutls_h_inc */
Note: See TracChangeset
for help on using the changeset viewer.