Changeset 3e94bd3 in mod_gnutls for include/mod_gnutls.h.in


Ignore:
Timestamp:
Jan 11, 2013, 12:54:56 AM (8 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, upstream
Children:
1c87791, 70c2d86
Parents:
8eb6ccd
Message:

Imported Upstream version 0.2.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/mod_gnutls.h.in

    r8eb6ccd r3e94bd3  
    2828#include "ap_release.h"
    2929
     30#include <gcrypt.h>
     31#include <gnutls/gnutls.h>
     32#include <gnutls/x509.h>
     33
    3034#ifndef __mod_gnutls_h_inc
    3135#define __mod_gnutls_h_inc
    3236
    3337#define HAVE_APR_MEMCACHE    @have_apr_memcache@
    34 
    35 #include <gcrypt.h>
    36 #include <gnutls/gnutls.h>
    3738
    3839module AP_MODULE_DECLARE_DATA gnutls_module;
     
    6263typedef enum
    6364{
    64     mod_gnutls_cache_none,
    65     mod_gnutls_cache_dbm,
     65    mgs_cache_none,
     66    mgs_cache_dbm,
    6667#if HAVE_APR_MEMCACHE
    67     mod_gnutls_cache_memcache
     68    mgs_cache_memcache
    6869#endif
    69 } mod_gnutls_cache_e;
     70} mgs_cache_e;
    7071
    7172typedef struct
    7273{
     74    int client_verify_mode;
     75} mgs_dirconf_rec;
     76
     77typedef struct
     78{
    7379    gnutls_certificate_credentials_t certs;
    74     char *key_file;
    75     char *cert_file;
     80    char* cert_cn;
     81    gnutls_x509_crt_t cert_x509;
     82    gnutls_x509_privkey_t privkey_x509;
    7683    int enabled;
    7784    int ciphers[16];
     
    8289    int cert_types[16];
    8390    apr_time_t cache_timeout;
    84     mod_gnutls_cache_e cache_type;
     91    mgs_cache_e cache_type;
    8592    const char* cache_config;
    8693    const char* rsa_params_file;
    8794    const char* dh_params_file;
    88 } mod_gnutls_srvconf_rec;
     95    int client_verify_mode;
     96} mgs_srvconf_rec;
    8997
    9098typedef struct {
    9199    int length;
    92100    char *value;
    93 } mod_gnutls_char_buffer_t;
     101} mgs_char_buffer_t;
    94102
    95103typedef struct
    96104{
    97     mod_gnutls_srvconf_rec *sc;
     105    mgs_srvconf_rec *sc;
    98106    conn_rec* c;
    99107    gnutls_session_t session;
     
    104112    apr_read_type_e input_block;
    105113    ap_input_mode_t input_mode;
    106     mod_gnutls_char_buffer_t input_cbuf;
     114    mgs_char_buffer_t input_cbuf;
    107115    char input_buffer[AP_IOBUFSIZE];
    108116
     
    116124    int status;
    117125    int non_https;
    118 } mod_gnutls_handle_t;
     126} mgs_handle_t;
    119127
    120128/** Functions in gnutls_io.c **/
    121129
    122130/**
    123  * mod_gnutls_filter_input will filter the input data
     131 * mgs_filter_input will filter the input data
    124132 * by decrypting it using GnuTLS and passes it cleartext.
    125133 *
     
    130138 * @return result status
    131139 */
    132 apr_status_t mod_gnutls_filter_input(ap_filter_t * f,
     140apr_status_t mgs_filter_input(ap_filter_t * f,
    133141                                     apr_bucket_brigade * bb,
    134142                                     ap_input_mode_t mode,
     
    137145
    138146/**
    139  * mod_gnutls_filter_output will filter the encrypt
     147 * mgs_filter_output will filter the encrypt
    140148 * the incoming bucket using GnuTLS and passes it onto the next filter.
    141149 *
     
    144152 * @return result status
    145153 */
    146 apr_status_t mod_gnutls_filter_output(ap_filter_t * f,
     154apr_status_t mgs_filter_output(ap_filter_t * f,
    147155                                      apr_bucket_brigade * bb);
    148156
    149157
    150158/**
    151  * mod_gnutls_transport_read is called from GnuTLS to provide encrypted
     159 * mgs_transport_read is called from GnuTLS to provide encrypted
    152160 * data from the client.
    153161 *
     
    157165 * @return size   length of the data stored in buffer
    158166 */
    159 ssize_t mod_gnutls_transport_read(gnutls_transport_ptr_t ptr,
     167ssize_t mgs_transport_read(gnutls_transport_ptr_t ptr,
    160168                                  void *buffer, size_t len);
    161169
    162170/**
    163  * mod_gnutls_transport_write is called from GnuTLS to
     171 * mgs_transport_write is called from GnuTLS to
    164172 * write data to the client.
    165173 *
     
    169177 * @return size   length of the data written
    170178 */
    171 ssize_t mod_gnutls_transport_write(gnutls_transport_ptr_t ptr,
     179ssize_t mgs_transport_write(gnutls_transport_ptr_t ptr,
    172180                                   const void *buffer, size_t len);
    173181
    174182
     183int mgs_rehandshake(mgs_handle_t * ctxt);
     184
     185
     186
    175187/**
    176188 * Init the Cache after Configuration is done
    177189 */
    178 int mod_gnutls_cache_post_config(apr_pool_t *p, server_rec *s,
    179                                  mod_gnutls_srvconf_rec *sc);
     190int mgs_cache_post_config(apr_pool_t *p, server_rec *s,
     191                                 mgs_srvconf_rec *sc);
    180192/**
    181193 * Init the Cache inside each Process
    182194 */
    183 int mod_gnutls_cache_child_init(apr_pool_t *p, server_rec *s,
    184                                 mod_gnutls_srvconf_rec *sc);
     195int mgs_cache_child_init(apr_pool_t *p, server_rec *s,
     196                                mgs_srvconf_rec *sc);
    185197/**
    186198 * Setup the Session Caching
    187199 */
    188 int mod_gnutls_cache_session_init(mod_gnutls_handle_t *ctxt);
     200int mgs_cache_session_init(mgs_handle_t *ctxt);
    189201
    190202#define GNUTLS_SESSION_ID_STRING_LEN \
     
    198210 * @param strsize The Maximum Length that can be stored in str
    199211 */
    200 char *mod_gnutls_session_id2sz(unsigned char *id, int idlen,
     212char *mgs_session_id2sz(unsigned char *id, int idlen,
    201213                                char *str, int strsize);
    202214
     215
     216/* Configuration Functions */
     217
     218const char *mgs_set_cert_file(cmd_parms * parms, void *dummy,
     219                                        const char *arg);
     220
     221const char *mgs_set_key_file(cmd_parms * parms, void *dummy,
     222                             const char *arg);
     223
     224const char *mgs_set_cache(cmd_parms * parms, void *dummy,
     225                          const char *type, const char* arg);
     226
     227const char *mgs_set_cache_timeout(cmd_parms * parms, void *dummy,
     228                                  const char *arg);
     229
     230const char *mgs_set_client_verify(cmd_parms * parms, void *dummy,
     231                                  const char *arg);
     232
     233const char *mgs_set_client_ca_file(cmd_parms * parms, void *dummy,
     234                                   const char *arg);
     235
     236const char *mgs_set_enabled(cmd_parms * parms, void *dummy,
     237                            const char *arg);
     238
     239void *mgs_config_server_create(apr_pool_t * p, server_rec * s);
     240
     241void *mgs_config_dir_create(apr_pool_t *p, char *dir);
     242
     243mgs_srvconf_rec* mgs_find_sni_server(gnutls_session_t session);
     244
     245/* mod_gnutls Hooks. */
     246
     247int mgs_hook_pre_config(apr_pool_t * pconf,
     248                        apr_pool_t * plog, apr_pool_t * ptemp);
     249
     250int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog,
     251                         apr_pool_t * ptemp,
     252                         server_rec * base_server);
     253
     254void mgs_hook_child_init(apr_pool_t *p, server_rec *s);
     255
     256const char *mgs_hook_http_scheme(const request_rec * r);
     257
     258apr_port_t mgs_hook_default_port(const request_rec * r);
     259
     260int mgs_hook_pre_connection(conn_rec * c, void *csd);
     261
     262int mgs_hook_fixups(request_rec *r);
     263
     264int mgs_hook_authz(request_rec *r);
     265
    203266#endif /*  __mod_gnutls_h_inc */
Note: See TracChangeset for help on using the changeset viewer.