Changes in / [259e835:1d9cfaf] in mod_gnutls


Ignore:
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r259e835 r1d9cfaf  
    1010AM_MAINTAINER_MODE
    1111AC_CANONICAL_TARGET
    12 AM_INIT_AUTOMAKE
     12AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
    1313AM_CONFIG_HEADER(include/mod_gnutls_config.h:config.in)
    1414
     
    4242fi
    4343
    44 AC_ARG_ENABLE(strict,
    45        AS_HELP_STRING([--disable-strict],
    46                [Avoid strict compiler warnings and errors]),
    47        use_strict=$enableval, use_strict=yes)
    48 
    49 STRICT_CFLAGS=""
    50 if test "$use_strict" != "no"; then
    51         STRICT_CFLAGS="-Wall -Werror -Wextra"
    52 fi
    53 
    5444AC_MSG_CHECKING([whether to enable SRP functionality])
    5545AC_MSG_RESULT($use_srp)
     
    7666AC_SUBST(have_apr_memcache)
    7767
    78 MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS}"
     68MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES}"
    7969MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}"
    8070
  • src/gnutls_config.c

    r259e835 r1d9cfaf  
    2828#endif
    2929
    30 static int pin_callback(void *user, int attempt __attribute__((unused)),
    31                         const char *token_url __attribute__((unused)),
    32                         const char *token_label, unsigned int flags,
    33                         char *pin, size_t pin_max)
     30static int pin_callback(void *user, int attempt, const char *token_url,
     31                        const char *token_label, unsigned int flags,
     32                        char *pin, size_t pin_max)
    3433{
    3534    mgs_srvconf_rec *sc = user;
     
    175174            goto cleanup;
    176175        }
     176
    177177
    178178        ret =
     
    574574
    575575const char *mgs_set_pgpcert_file(cmd_parms * parms, void *dummy __attribute__((unused)),
    576         const char *arg)
    577 {
     576        const char *arg) {
    578577    mgs_srvconf_rec *sc =
    579578        (mgs_srvconf_rec *) ap_get_module_config(parms->server->
     
    840839}
    841840
    842 const char *mgs_set_priorities(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg)
    843 {
     841const char *mgs_set_priorities(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg) {
     842
    844843    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
    845844        ap_get_module_config(parms->server->module_config, &gnutls_module);
     
    850849}
    851850
    852 const char *mgs_set_pin(cmd_parms * parms, void *dummy __attribute__((unused)),
    853                         const char *arg)
     851const char *mgs_set_pin(cmd_parms * parms, void *dummy, const char *arg)
    854852{
    855853
     
    862860}
    863861
    864 const char *mgs_set_srk_pin(cmd_parms * parms,
    865                             void *dummy __attribute__((unused)),
    866                             const char *arg)
     862const char *mgs_set_srk_pin(cmd_parms * parms, void *dummy, const char *arg)
    867863{
    868864
     
    876872
    877873static mgs_srvconf_rec *_mgs_config_server_create(apr_pool_t * p,
    878                                                   char **err __attribute__((unused)))
     874                                                  char **err)
    879875{
    880876    mgs_srvconf_rec *sc = apr_pcalloc(p, sizeof(*sc));
  • src/gnutls_hooks.c

    r259e835 r1d9cfaf  
    4444static int mgs_cert_verify(request_rec * r, mgs_handle_t * ctxt);
    4545/* use side==0 for server and side==1 for client */
    46 static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, size_t export_cert_size);
    47 static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, size_t export_cert_size);
     46static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, int export_cert_size);
     47static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, int export_cert_size);
     48static const char* mgs_x509_construct_uid(request_rec * pool, gnutls_x509_crt_t cert);
    4849static int mgs_status_hook(request_rec *r, int flags);
    49 #ifdef ENABLE_MSVA
    50 static const char* mgs_x509_construct_uid(request_rec * pool, gnutls_x509_crt_t cert);
    51 #endif
    5250
    5351/* Pool Cleanup Function */
    54 apr_status_t mgs_cleanup_pre_config(void *data __attribute__((unused))) {
     52apr_status_t mgs_cleanup_pre_config(void *data) {
    5553        /* Free all session data */
    5654    gnutls_free(session_ticket_key.data);
     
    8583
    8684/* Pre-Configuration HOOK: Runs First */
    87 int mgs_hook_pre_config(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t * ptemp __attribute__((unused))) {
     85int mgs_hook_pre_config(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t * ptemp) {
    8886
    8987/* Maintainer Logging */
     
    171169
    172170static int cert_retrieve_fn(gnutls_session_t session,
    173                             const gnutls_datum_t * req_ca_rdn __attribute__((unused)),
    174                             int nreqs __attribute__((unused)),
    175                             const gnutls_pk_algorithm_t * pk_algos __attribute__((unused)),
    176                             int pk_algos_length __attribute__((unused)),
    177                             gnutls_pcert_st **pcerts,
    178                             unsigned int *pcert_length,
     171                            const gnutls_datum_t * req_ca_rdn, int nreqs,
     172                            const gnutls_pk_algorithm_t * pk_algos, int pk_algos_length,
     173                            gnutls_pcert_st **pcerts, unsigned int *pcert_length,
    179174                            gnutls_privkey_t *privkey)
    180175{
     
    289284}
    290285
    291 int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog __attribute__((unused)), apr_pool_t * ptemp __attribute__((unused)), server_rec * base_server) {
     286int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog, apr_pool_t * ptemp, server_rec * base_server) {
    292287
    293288    int rv;
     
    540535}
    541536
    542 static int vhost_cb(void *baton, conn_rec * conn __attribute__((unused)), server_rec * s) {
     537static int vhost_cb(void *baton, conn_rec * conn, server_rec * s) {
    543538    mgs_srvconf_rec *tsc;
    544539    vhost_cb_rec *x = baton;
     
    680675}
    681676
    682 int mgs_hook_pre_connection(conn_rec * c, void *csd __attribute__((unused))) {
     677int mgs_hook_pre_connection(conn_rec * c, void *csd) {
    683678    mgs_srvconf_rec *sc;
    684679
     
    852847#define MGS_SIDE(suffix) ((side==0) ? "SSL_SERVER" suffix : "SSL_CLIENT" suffix)
    853848
    854 static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, size_t export_cert_size) {
     849static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, int export_cert_size) {
    855850    unsigned char sbuf[64]; /* buffer to hold serials */
    856851    char buf[AP_IOBUFSIZE];
     
    971966 * to use for the PEM-encoded certificate (0 means do not export)
    972967 */
    973 static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, size_t export_cert_size) {
     968static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, int export_cert_size) {
    974969
    975970        unsigned char sbuf[64]; /* buffer to hold serials */
     
    12871282exit:
    12881283    if (gnutls_certificate_type_get(ctxt->session) == GNUTLS_CRT_X509) {
    1289         unsigned int i;
     1284        int i;
    12901285        for (i = 0; i < ch_size; i++) {
    12911286            gnutls_x509_crt_deinit(cert.x509[i]);
     
    12991294}
    13001295
    1301 #ifdef ENABLE_MSVA
    1302 /* this section of code is used only when trying to talk to the MSVA */
    13031296static const char* mgs_x509_leaf_oid_from_dn(apr_pool_t *pool, const char* oid, gnutls_x509_crt_t cert) {
    13041297    int rv=GNUTLS_E_SUCCESS, i;
     
    13371330            data = apr_palloc(pool, sz);
    13381331            rv = gnutls_x509_crt_get_subject_alt_name2(cert, i, data, &sz, &thistype, NULL);
    1339             if (rv >=0 && (thistype == target))
     1332            if (rv == target)
    13401333                return data;
    13411334        }
     
    13441337    return NULL;
    13451338}
    1346 
    13471339
    13481340/* Create a string representing a candidate User ID from an X.509
     
    14601452    return ret;
    14611453}
    1462 #endif /* ENABLE_MSVA */
    1463 
    1464 static int mgs_status_hook(request_rec *r, int flags __attribute__((unused)))
     1454
     1455static int mgs_status_hook(request_rec *r, int flags)
    14651456{
    14661457    mgs_srvconf_rec *sc;
  • src/gnutls_io.c

    r259e835 r1d9cfaf  
    510510    if (ctxt->input_mode == AP_MODE_READBYTES ||
    511511            ctxt->input_mode == AP_MODE_SPECULATIVE) {
    512         if (readbytes < 0) {
    513             /* you're asking us to speculatively read a negative number of bytes! */
    514             return APR_ENOTIMPL;
    515         }
    516512        /* Err. This is bad. readbytes *can* be a 64bit int! len.. is NOT */
    517         if ((apr_size_t) readbytes < len) {
     513        if (readbytes < len) {
    518514            len = (apr_size_t) readbytes;
    519515        }
     
    577573
    578574apr_status_t mgs_filter_output(ap_filter_t * f, apr_bucket_brigade * bb) {
    579     int ret;
     575    apr_size_t ret;
    580576    mgs_handle_t *ctxt = (mgs_handle_t *) f->ctx;
    581577    apr_status_t status = APR_SUCCESS;
     
    676672                        return ctxt->output_rc;
    677673                    }
    678                 } else if ((apr_size_t)(ret) != len) {
    679                     /* we know the above cast is OK because len > 0 and ret >= 0 */
     674                } else if (ret != len) {
    680675                    /* Not able to send the entire bucket,
    681676                       split it and send it again. */
  • src/mod_gnutls.c

    r259e835 r1d9cfaf  
    2020#include "mod_gnutls.h"
    2121
    22 static void gnutls_hooks(apr_pool_t * p __attribute__((unused))) {
     22static void gnutls_hooks(apr_pool_t * p) {
    2323
    2424    /* Try Run Post-Config Hook After mod_proxy */
  • t/Makefile

    r259e835 r1d9cfaf  
    6262# special cases for the authorities' root certs:
    6363authority/x509.pem: authority.template authority/secret.key
    64         certtool --generate-self-signed --load-privkey authority/secret.key --template authority.template > $@
     64        certtool --generate-self-signed --load-privkey=authority/secret.key --template=authority.template > $@
    6565rogueca/x509.pem: rogueca.template rogueca/secret.key
    66         certtool --generate-self-signed --load-privkey rogueca/secret.key --template rogueca.template > $@
     66        certtool --generate-self-signed --load-privkey=rogueca/secret.key --template=rogueca.template > $@
    6767
    6868%/cert-request: %.template %/secret.key
    69         certtool --generate-request --load-privkey $(dir $@)secret.key --template $< > $@
     69        certtool --generate-request --load-privkey=$(dir $@)secret.key --template=$< > $@
    7070
    7171%/x509.pem: %.template %/cert-request authority/secret.key authority/x509.pem
    72         certtool --generate-certificate --load-ca-certificate authority/x509.pem --load-ca-privkey authority/secret.key --load-request $(dir $@)cert-request --template $< > $@
     72        certtool --generate-certificate --load-ca-certificate=authority/x509.pem --load-ca-privkey=authority/secret.key --load-request=$(dir $@)cert-request --template=$< > $@
    7373
    7474msva.gnupghome/trustdb.gpg: authority/minimal.pgp client/cert.pgp
  • t/setup

    r259e835 r1d9cfaf  
    3838genkey "$PWD/client" "Test User <test0@modgnutls.test>"
    3939
    40 certtool -q --load-privkey server/secret.key  --template server.template > server/server.req
     40certtool -q --load-privkey=server/secret.key  --template=server.template > server/server.req
    4141
    4242
Note: See TracChangeset for help on using the changeset viewer.