Changeset 259e835 in mod_gnutls for src/gnutls_hooks.c


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.