Changeset 259e835 in mod_gnutls for src


Ignore:
Timestamp:
Apr 4, 2015, 4:57:10 PM (5 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
c4a015b
Parents:
1d9cfaf (diff), c32240f (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.
git-author:
Thomas Klute <thomas2.klute@…> (04/04/15 16:54:45)
git-committer:
Thomas Klute <thomas2.klute@…> (04/04/15 16:57:10)
Message:

Merge branch 'master' into new-gnutls-api

Branch 'master' at this point represents the upstream mod_gnutls
repository. Merging that first should make it easier to merge with my
changes later.

The result compiles, but OpenPGP authentication does not work.

Resolved conflicts in:

src/gnutls_config.c
src/gnutls_hooks.c

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_config.c

    r1d9cfaf r259e835  
    2828#endif
    2929
    30 static 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)
     30static 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)
    3334{
    3435    mgs_srvconf_rec *sc = user;
     
    174175            goto cleanup;
    175176        }
    176 
    177177
    178178        ret =
     
    574574
    575575const char *mgs_set_pgpcert_file(cmd_parms * parms, void *dummy __attribute__((unused)),
    576         const char *arg) {
     576        const char *arg)
     577{
    577578    mgs_srvconf_rec *sc =
    578579        (mgs_srvconf_rec *) ap_get_module_config(parms->server->
     
    839840}
    840841
    841 const char *mgs_set_priorities(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg) {
    842 
     842const char *mgs_set_priorities(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg)
     843{
    843844    mgs_srvconf_rec *sc = (mgs_srvconf_rec *)
    844845        ap_get_module_config(parms->server->module_config, &gnutls_module);
     
    849850}
    850851
    851 const char *mgs_set_pin(cmd_parms * parms, void *dummy, const char *arg)
     852const char *mgs_set_pin(cmd_parms * parms, void *dummy __attribute__((unused)),
     853                        const char *arg)
    852854{
    853855
     
    860862}
    861863
    862 const char *mgs_set_srk_pin(cmd_parms * parms, void *dummy, const char *arg)
     864const char *mgs_set_srk_pin(cmd_parms * parms,
     865                            void *dummy __attribute__((unused)),
     866                            const char *arg)
    863867{
    864868
     
    872876
    873877static mgs_srvconf_rec *_mgs_config_server_create(apr_pool_t * p,
    874                                                   char **err)
     878                                                  char **err __attribute__((unused)))
    875879{
    876880    mgs_srvconf_rec *sc = apr_pcalloc(p, sizeof(*sc));
  • src/gnutls_hooks.c

    r1d9cfaf r259e835  
    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, int export_cert_size);
    47 static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, int export_cert_size);
     46static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, size_t export_cert_size);
     47static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, size_t export_cert_size);
     48static int mgs_status_hook(request_rec *r, int flags);
     49#ifdef ENABLE_MSVA
    4850static const char* mgs_x509_construct_uid(request_rec * pool, gnutls_x509_crt_t cert);
    49 static int mgs_status_hook(request_rec *r, int flags);
     51#endif
    5052
    5153/* Pool Cleanup Function */
    52 apr_status_t mgs_cleanup_pre_config(void *data) {
     54apr_status_t mgs_cleanup_pre_config(void *data __attribute__((unused))) {
    5355        /* Free all session data */
    5456    gnutls_free(session_ticket_key.data);
     
    8385
    8486/* Pre-Configuration HOOK: Runs First */
    85 int mgs_hook_pre_config(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t * ptemp) {
     87int mgs_hook_pre_config(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t * ptemp __attribute__((unused))) {
    8688
    8789/* Maintainer Logging */
     
    169171
    170172static int cert_retrieve_fn(gnutls_session_t session,
    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,
     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,
    174179                            gnutls_privkey_t *privkey)
    175180{
     
    284289}
    285290
    286 int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog, apr_pool_t * ptemp, server_rec * base_server) {
     291int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog __attribute__((unused)), apr_pool_t * ptemp __attribute__((unused)), server_rec * base_server) {
    287292
    288293    int rv;
     
    535540}
    536541
    537 static int vhost_cb(void *baton, conn_rec * conn, server_rec * s) {
     542static int vhost_cb(void *baton, conn_rec * conn __attribute__((unused)), server_rec * s) {
    538543    mgs_srvconf_rec *tsc;
    539544    vhost_cb_rec *x = baton;
     
    675680}
    676681
    677 int mgs_hook_pre_connection(conn_rec * c, void *csd) {
     682int mgs_hook_pre_connection(conn_rec * c, void *csd __attribute__((unused))) {
    678683    mgs_srvconf_rec *sc;
    679684
     
    847852#define MGS_SIDE(suffix) ((side==0) ? "SSL_SERVER" suffix : "SSL_CLIENT" suffix)
    848853
    849 static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, int export_cert_size) {
     854static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, size_t export_cert_size) {
    850855    unsigned char sbuf[64]; /* buffer to hold serials */
    851856    char buf[AP_IOBUFSIZE];
     
    966971 * to use for the PEM-encoded certificate (0 means do not export)
    967972 */
    968 static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, int export_cert_size) {
     973static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, size_t export_cert_size) {
    969974
    970975        unsigned char sbuf[64]; /* buffer to hold serials */
     
    12821287exit:
    12831288    if (gnutls_certificate_type_get(ctxt->session) == GNUTLS_CRT_X509) {
    1284         int i;
     1289        unsigned int i;
    12851290        for (i = 0; i < ch_size; i++) {
    12861291            gnutls_x509_crt_deinit(cert.x509[i]);
     
    12941299}
    12951300
     1301#ifdef ENABLE_MSVA
     1302/* this section of code is used only when trying to talk to the MSVA */
    12961303static const char* mgs_x509_leaf_oid_from_dn(apr_pool_t *pool, const char* oid, gnutls_x509_crt_t cert) {
    12971304    int rv=GNUTLS_E_SUCCESS, i;
     
    13301337            data = apr_palloc(pool, sz);
    13311338            rv = gnutls_x509_crt_get_subject_alt_name2(cert, i, data, &sz, &thistype, NULL);
    1332             if (rv == target)
     1339            if (rv >=0 && (thistype == target))
    13331340                return data;
    13341341        }
     
    13371344    return NULL;
    13381345}
     1346
    13391347
    13401348/* Create a string representing a candidate User ID from an X.509
     
    14521460    return ret;
    14531461}
    1454 
    1455 static int mgs_status_hook(request_rec *r, int flags)
     1462#endif /* ENABLE_MSVA */
     1463
     1464static int mgs_status_hook(request_rec *r, int flags __attribute__((unused)))
    14561465{
    14571466    mgs_srvconf_rec *sc;
  • src/gnutls_io.c

    r1d9cfaf r259e835  
    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        }
    512516        /* Err. This is bad. readbytes *can* be a 64bit int! len.. is NOT */
    513         if (readbytes < len) {
     517        if ((apr_size_t) readbytes < len) {
    514518            len = (apr_size_t) readbytes;
    515519        }
     
    573577
    574578apr_status_t mgs_filter_output(ap_filter_t * f, apr_bucket_brigade * bb) {
    575     apr_size_t ret;
     579    int ret;
    576580    mgs_handle_t *ctxt = (mgs_handle_t *) f->ctx;
    577581    apr_status_t status = APR_SUCCESS;
     
    672676                        return ctxt->output_rc;
    673677                    }
    674                 } else if (ret != len) {
     678                } else if ((apr_size_t)(ret) != len) {
     679                    /* we know the above cast is OK because len > 0 and ret >= 0 */
    675680                    /* Not able to send the entire bucket,
    676681                       split it and send it again. */
  • src/mod_gnutls.c

    r1d9cfaf r259e835  
    2020#include "mod_gnutls.h"
    2121
    22 static void gnutls_hooks(apr_pool_t * p) {
     22static void gnutls_hooks(apr_pool_t * p __attribute__((unused))) {
    2323
    2424    /* Try Run Post-Config Hook After mod_proxy */
Note: See TracChangeset for help on using the changeset viewer.