/* -*- Mode: C; c-file-style: "bsd" -*- */
-/*
+/*-
* easy-tls.c -- generic TLS proxy.
- * $Id: easy-tls.c,v 1.2 2001/09/24 07:54:09 bodo Exp $
+ * $Id: easy-tls.c,v 1.4 2002/03/05 09:07:16 bodo Exp $
*/
-/*
+/*-
(c) Copyright 1999 Bodo Moeller. All rights reserved.
This is free software; you can redistributed and/or modify it
or
- the following license:
*/
-/*
+/*-
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that each of the following
* conditions is met:
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*
+/*-
* Attribution for OpenSSL library:
*
* This product includes cryptographic software written by Eric Young
*/
static char const rcsid[] =
-"$Id: easy-tls.c,v 1.2 2001/09/24 07:54:09 bodo Exp $";
+"$Id: easy-tls.c,v 1.4 2002/03/05 09:07:16 bodo Exp $";
#include <assert.h>
#include <errno.h>
# include TLS_APP
#endif
-/* Applications can define:
+/*-
+ * Applications can define:
* TLS_APP_PROCESS_INIT -- void ...(int fd, int client_p, void *apparg)
* TLS_CUMULATE_ERRORS
* TLS_ERROR_BUFSIZ
return ret;
}
-/* Slice in TLS proxy process at fd.
+/*-
+ * Slice in TLS proxy process at fd.
* Return value:
* 0 ok (*pid is set to child's PID if pid != NULL),
* < 0 look at errno
return -1;
}
+#if OPENSSL_VERSION_NUMBER >= 0x00907000L
+static int
+verify_dont_fail_cb(X509_STORE_CTX *c, void *unused_arg)
+#else
static int
verify_dont_fail_cb(X509_STORE_CTX *c)
+#endif
{
int i;
return a > b ? a : b;
}
+/* timeout, -1 means no timeout */
static void
-tls_sockets_select(int read_select_1, int read_select_2, int write_select_1, int write_select_2, int seconds /* timeout, -1 means no timeout */)
+tls_sockets_select(int read_select_1, int read_select_2, int write_select_1, int write_select_2, int seconds)
{
int maxfd, n;
fd_set reads, writes;
/* loop finishes as soon as we detect that one side closed;
* when all (program and OS) buffers have enough space,
- * the data from the last succesful read in each direction is transferred
+ * the data from the last successful read in each direction is transferred
* before close */
do {
int clear_read_select = 0, clear_write_select = 0,