- Timestamp:
- Dec 9, 2004, 2:52:31 AM (18 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, jessie-backports, main, master, msva, proxy-ticket, upstream
- Children:
- 76bd3bf
- Parents:
- 0314deb
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gnutls_cache.c
r0314deb r32f2e60 22 22 * 23 23 */ 24 /* 25 #include "memcache.h" 24 26 25 #include "libmemcache/memcache.h" 27 int mod_gnutls_cache_init() 28 { 29 return 0; 30 } 31 static int cache_store((void* baton, gnutls_datum_t key, gnutls_datum_t data) 32 { 33 mc_set(struct memcache *mc, 34 key->data, key->size, 35 data->data, data->size, 36 3600, 0); 37 return 0; 38 } 39 40 static int cache_fetch(void* baton, gnutls_datum_t key) 41 { 42 mod_gnutls_handle_t *ctxt = baton; 43 return 0; 44 } 45 46 static int cache_delete(void* baton, gnutls_datum_t key) 47 { 48 mod_gnutls_handle_t *ctxt = baton; 49 return 0; 50 } 51 52 int mod_gnutls_cache_session_init(mod_gnutls_handle_t *ctxt) 53 { 54 gnutls_db_set_cache_expiration 55 gnutls_db_set_retrieve_function(session, cache_fetch); 56 gnutls_db_set_remove_function(session, cache_delete); 57 gnutls_db_set_store_function(session, cache_store); 58 gnutls_db_set_ptr(session, NULL); 59 return 0; 60 } 61 */ -
src/gnutls_io.c
r0314deb r32f2e60 333 333 334 334 335 #define GNUTLS_HANDSHAKE_ATTEMPTS 10336 337 335 static void gnutls_do_handshake(mod_gnutls_handle_t * ctxt) 338 336 { 339 int i,ret;337 int ret; 340 338 341 339 if (ctxt->status != 0) 342 340 return; 343 #if 0344 345 for (i = GNUTLS_HANDSHAKE_ATTEMPTS; i > 0; i--) {346 ret = gnutls_handshake(ctxt->session);347 if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) {348 continue;349 }350 351 if (ret < 0) {352 if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED353 || ret == GNUTLS_E_FATAL_ALERT_RECEIVED) {354 ret = gnutls_alert_get(ctxt->session);355 ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctxt->c->base_server,356 "GnuTLS: Hanshake Alert (%d) '%s'.\n", ret,357 gnutls_alert_get_name(ret));358 }359 360 gnutls_deinit(ctxt->session);361 ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctxt->c->base_server,362 "GnuTLS: Handshake Failed (%d) '%s'", ret,363 gnutls_strerror(ret));364 ctxt->status = -1;365 return;366 }367 else {368 ctxt->status = 1;369 return; /* all done with the handshake */370 }371 }372 ctxt->status = -1;373 return;374 #else375 341 ret = gnutls_handshake(ctxt->session); 376 342 if (ret < 0) { … … 394 360 return; /* all done with the handshake */ 395 361 } 396 397 #endif398 362 } 399 363 … … 466 430 apr_bucket_brigade * bb) 467 431 { 468 int ret;432 apr_size_t ret; 469 433 mod_gnutls_handle_t *ctxt = (mod_gnutls_handle_t *) f->ctx; 470 434 apr_status_t status = APR_SUCCESS; … … 514 478 } 515 479 else { 516 517 480 /* filter output */ 518 481 const char *data; … … 547 510 } 548 511 } 549 else if ((apr_size_t) ret != len) { 550 //apr_bucket_split(bucket, ret); 551 //APR_BUCKET_REMOVE(bucket); 552 /* not all of the data was sent. */ 553 /* mod_ssl basicly errors out here.. this doesn't seem right? */ 554 ap_log_error(APLOG_MARK, APLOG_INFO, ctxt->output_rc, 555 ctxt->c->base_server, 556 "GnuTLS: failed to write %" APR_SSIZE_T_FMT 557 " of %" APR_SIZE_T_FMT " bytes.", 558 len - (apr_size_t) ret, len); 559 //continue; 560 if (ctxt->output_rc == APR_SUCCESS) { 561 ctxt->output_rc = APR_EGENERAL; 562 } 512 else if (ret != len) { 513 /* Not able to send the entire bucket, 514 split it and send it again. */ 515 apr_bucket_split(bucket, ret); 563 516 } 564 517 -
src/mod_gnutls.c
r0314deb r32f2e60 45 45 46 46 #define DH_BITS 1024 47 #ifdef USE_RSA 47 48 #define RSA_BITS 512 48 49 #endif 49 50 static int mod_gnutls_hook_post_config(apr_pool_t * p, apr_pool_t * plog, 50 51 apr_pool_t * ptemp, … … 54 55 server_rec *s; 55 56 gnutls_dh_params_t dh_params; 57 #ifdef USE_RSA 56 58 gnutls_rsa_params_t rsa_params; 57 59 #endif 58 60 59 61 /* TODO: Should we regenerate these after X requests / X time ? */ 60 62 gnutls_dh_params_init(&dh_params); 61 63 gnutls_dh_params_generate2(dh_params, DH_BITS); 62 // gnutls_rsa_params_init(&rsa_params); 63 // gnutls_rsa_params_generate2(rsa_params, RSA_BITS); 64 64 #ifdef USE_RSA 65 gnutls_rsa_params_init(&rsa_params); 66 gnutls_rsa_params_generate2(rsa_params, RSA_BITS); 67 #endif 65 68 for (s = base_server; s; s = s->next) { 66 69 sc = (mod_gnutls_srvconf_rec *) ap_get_module_config(s->module_config, … … 70 73 sc->key_file, 71 74 GNUTLS_X509_FMT_PEM); 72 // gnutls_certificate_set_rsa_export_params(sc->certs, rsa_params); 75 #ifdef USE_RSA 76 gnutls_certificate_set_rsa_export_params(sc->certs, rsa_params); 77 #endif 73 78 gnutls_certificate_set_dh_params(sc->certs, dh_params); 74 79 }
Note: See TracChangeset
for help on using the changeset viewer.