Changeset 9180a60 in mod_gnutls
- Timestamp:
- Sep 25, 2011, 9:15:02 PM (12 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, jessie-backports, main, master, msva, proxy-ticket, upstream
- Children:
- fb26be5
- Parents:
- 84e07cc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_hooks.c
r84e07cc r9180a60 22 22 #include "ap_mpm.h" 23 23 24 #if APR_HAS_THREADS25 #if GNUTLS_VERSION_MAJOR <= 2 && GNUTLS_VERSION_MINOR < 1126 #include <gcrypt.h>27 GCRY_THREAD_OPTION_PTHREAD_IMPL;28 #endif29 #endif30 24 31 25 #if !USING_2_1_RECENT … … 37 31 #endif 38 32 39 static int mpm_is_threaded;40 33 static gnutls_datum session_ticket_key = {NULL, 0}; 41 34 … … 87 80 #endif 88 81 89 #if APR_HAS_THREADS90 ap_mpm_query(AP_MPMQ_IS_THREADED, &mpm_is_threaded);91 #if (GNUTLS_VERSION_MAJOR == 2 && GNUTLS_VERSION_MINOR < 11) || GNUTLS_VERSION_MAJOR < 292 if (mpm_is_threaded) {93 gcry_control(GCRYCTL_SET_THREAD_CBS,94 &gcry_threads_pthread);95 }96 #endif97 #else98 mpm_is_threaded = 0;99 #endif100 101 102 82 if (gnutls_check_version(LIBGNUTLS_VERSION) == NULL) { 103 83 _gnutls_log(debug_log_fp, … … 131 111 mgs_handle_t *ctxt; 132 112 mgs_srvconf_rec *tsc; 133 int ret; 134 int cprio[2]; 113 int ret = 0; 135 114 136 115 _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__); … … 171 150 ret = gnutls_priority_set(session, ctxt->sc->priorities); 172 151 /* 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; 191 153 } 192 154 … … 201 163 202 164 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; 204 167 ret->ncerts = ctxt->sc->certs_x509_num; 205 168 ret->deinit_all = 0; … … 209 172 210 173 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; 214 177 ret->ncerts = 1; 215 178 ret->deinit_all = 0; … … 709 672 * gnutls to be able to read packets. 710 673 */ 711 gnutls_ protocol_set_priority(ctxt->session, protocol_priority);674 gnutls_set_default_priority(ctxt->session); 712 675 713 676 gnutls_handshake_set_post_client_hello_function(ctxt->session,
Note: See TracChangeset
for help on using the changeset viewer.