Changeset 9180a60 in mod_gnutls


Ignore:
Timestamp:
Sep 25, 2011, 9:15:02 PM (12 years ago)
Author:
Dash Shendy <neuromancer@…>
Branches:
asyncio, debian/master, debian/stretch-backports, jessie-backports, main, master, msva, proxy-ticket, upstream
Children:
fb26be5
Parents:
84e07cc
Message:

Applied New Functions Patch from Nikos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_hooks.c

    r84e07cc r9180a60  
    2222#include "ap_mpm.h"
    2323
    24 #if APR_HAS_THREADS
    25 #if GNUTLS_VERSION_MAJOR <= 2 && GNUTLS_VERSION_MINOR < 11
    26 #include <gcrypt.h>
    27 GCRY_THREAD_OPTION_PTHREAD_IMPL;
    28 #endif
    29 #endif
    3024
    3125#if !USING_2_1_RECENT
     
    3731#endif
    3832
    39 static int mpm_is_threaded;
    4033static gnutls_datum session_ticket_key = {NULL, 0};
    4134
     
    8780#endif
    8881
    89 #if APR_HAS_THREADS
    90     ap_mpm_query(AP_MPMQ_IS_THREADED, &mpm_is_threaded);
    91 #if (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR < 11) || GNUTLS_VERSION_MAJOR < 2
    92     if (mpm_is_threaded) {
    93         gcry_control(GCRYCTL_SET_THREAD_CBS,
    94                 &gcry_threads_pthread);
    95     }
    96 #endif
    97 #else
    98     mpm_is_threaded = 0;
    99 #endif
    100 
    101 
    10282    if (gnutls_check_version(LIBGNUTLS_VERSION) == NULL) {
    10383        _gnutls_log(debug_log_fp,
     
    131111    mgs_handle_t *ctxt;
    132112    mgs_srvconf_rec *tsc;
    133     int ret;
    134     int cprio[2];
     113    int ret = 0;
    135114
    136115    _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__);
     
    171150    ret = gnutls_priority_set(session, ctxt->sc->priorities);
    172151    /* actually it shouldn't fail since we have checked at startup */
    173     if (ret < 0)
    174         return ret;
    175 
    176     /* If both certificate types are not present disallow them from
    177      * being negotiated.
    178      */
    179     if (ctxt->sc->certs_x509[0] != NULL && ctxt->sc->cert_pgp == NULL) {
    180         cprio[0] = GNUTLS_CRT_X509;
    181         cprio[1] = 0;
    182         gnutls_certificate_type_set_priority(session, cprio);
    183     } else if (ctxt->sc->cert_pgp != NULL
    184             && ctxt->sc->certs_x509[0] == NULL) {
    185         cprio[0] = GNUTLS_CRT_OPENPGP;
    186         cprio[1] = 0;
    187         gnutls_certificate_type_set_priority(session, cprio);
    188     }
    189 
    190     return 0;
     152    return ret;
    191153}
    192154
     
    201163
    202164    if (gnutls_certificate_type_get(session) == GNUTLS_CRT_X509) {
    203         ret->type = GNUTLS_CRT_X509;
     165        ret->cert_type = GNUTLS_CRT_X509;
     166        ret->key_type = GNUTLS_PRIVKEY_X509;
    204167        ret->ncerts = ctxt->sc->certs_x509_num;
    205168        ret->deinit_all = 0;
     
    209172
    210173        return 0;
    211     } else if (gnutls_certificate_type_get(session) ==
    212             GNUTLS_CRT_OPENPGP) {
    213         ret->type = GNUTLS_CRT_OPENPGP;
     174    } else if (gnutls_certificate_type_get(session) == GNUTLS_CRT_OPENPGP) {
     175        ret->cert_type = GNUTLS_CRT_OPENPGP;
     176        ret->key_type = GNUTLS_PRIVKEY_OPENPGP;       
    214177        ret->ncerts = 1;
    215178        ret->deinit_all = 0;
     
    709672     * gnutls to be able to read packets.
    710673     */
    711     gnutls_protocol_set_priority(ctxt->session, protocol_priority);
     674    gnutls_set_default_priority(ctxt->session);
    712675
    713676    gnutls_handshake_set_post_client_hello_function(ctxt->session,
Note: See TracChangeset for help on using the changeset viewer.