aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorTed Zlatanov2011-04-24 20:30:51 -0500
committerTed Zlatanov2011-04-24 20:30:51 -0500
commite061a11b5a59f02fac66184e991f01a433f6dc8d (patch)
treeccff6a6012dbc1ed4ce247b9e4e84a38c5eb34af /src/process.c
parent33630d51504adc5b2a0289f356c0a1a49f0bd10a (diff)
downloademacs-e061a11b5a59f02fac66184e991f01a433f6dc8d.tar.gz
emacs-e061a11b5a59f02fac66184e991f01a433f6dc8d.zip
Add GnuTLS support for W32 and certificate and hostname verification in GnuTLS.
* src/gnutls.c: Renamed global_initialized to gnutls_global_initialized. Added internals for the :verify-hostname-error, :verify-error, and :verify-flags parameters of `gnutls-boot' and documented those parameters in the docstring. Start callback support. (emacs_gnutls_handshake): Add Woe32 support. Retry handshake unless a fatal error occured. Call gnutls_alert_send_appropriate on error. Return error code. (emacs_gnutls_write): Call emacs_gnutls_handle_error. (emacs_gnutls_read): Likewise. (Fgnutls_boot): Return handshake error code. (emacs_gnutls_handle_error): New function. (wsaerror_to_errno): Likewise. * src/gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the callbacks stage. * src/w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32. (emacs_gnutls_push): Likewise. * src/w32.h (emacs_gnutls_pull): Add prototype. (emacs_gnutls_push): Likewise.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index d8851c56cf0..4253286196c 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4532,6 +4532,22 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd,
4532 &Available, 4532 &Available,
4533 (check_write ? &Writeok : (SELECT_TYPE *)0), 4533 (check_write ? &Writeok : (SELECT_TYPE *)0),
4534 (SELECT_TYPE *)0, &timeout); 4534 (SELECT_TYPE *)0, &timeout);
4535
4536#ifdef HAVE_GNUTLS
4537 /* GnuTLS buffers data internally. In lowat mode it leaves
4538 some data in the TCP buffers so that select works, but
4539 with custom pull/push functions we need to check if some
4540 data is available in the buffers manually. */
4541 if (nfds == 0 &&
4542 wait_proc && wait_proc->gnutls_p /* Check for valid process. */
4543 /* Do we have pending data? */
4544 && gnutls_record_check_pending (wait_proc->gnutls_state) > 0)
4545 {
4546 nfds = 1;
4547 /* Set to Available. */
4548 FD_SET (wait_proc->infd, &Available);
4549 }
4550#endif
4535 } 4551 }
4536 4552
4537 xerrno = errno; 4553 xerrno = errno;