[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU gnutls branch, master, updated. gnutls_3_1_0-52-g570b0bf
From: |
Nikos Mavrogiannopoulos |
Subject: |
[SCM] GNU gnutls branch, master, updated. gnutls_3_1_0-52-g570b0bf |
Date: |
Sun, 02 Sep 2012 09:01:10 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".
http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=570b0bfd8659d77785308adc991234fd4d1a1e91
The branch, master has been updated
via 570b0bfd8659d77785308adc991234fd4d1a1e91 (commit)
via ef9d0e356c191db966b7eb5ed8e55e7155b029c3 (commit)
via d0e149284182cbe95e344261bde6dac82b70f88a (commit)
via 43e14e8a5cef27f319316bb7ff0de8b86272ac99 (commit)
via 6fb9a10025a9453202a0836ead8e35e246d0213f (commit)
from cece3b49a562175c362d6495b2790e8759d258a1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 570b0bfd8659d77785308adc991234fd4d1a1e91
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Sun Sep 2 11:00:02 2012 +0200
increased timeouts
commit ef9d0e356c191db966b7eb5ed8e55e7155b029c3
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Sun Sep 2 10:59:16 2012 +0200
dump the errno received by select
commit d0e149284182cbe95e344261bde6dac82b70f88a
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Sun Sep 2 10:39:49 2012 +0200
removed unused code
commit 43e14e8a5cef27f319316bb7ff0de8b86272ac99
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Sun Sep 2 10:36:12 2012 +0200
use errno_to_gerr() in _gnutls_io_check_recv().
commit 6fb9a10025a9453202a0836ead8e35e246d0213f
Author: Nikos Mavrogiannopoulos <address@hidden>
Date: Sun Sep 2 10:25:52 2012 +0200
Do not repeatedly set timeout
-----------------------------------------------------------------------
Summary of changes:
lib/gnutls_buffers.c | 20 ++++++------------
lib/gnutls_handshake.c | 3 +-
lib/gnutls_state.c | 2 +
tests/mini-handshake-timeout.c | 43 ++++++++++++---------------------------
4 files changed, 24 insertions(+), 44 deletions(-)
diff --git a/lib/gnutls_buffers.c b/lib/gnutls_buffers.c
index c714519..ea7a77a 100644
--- a/lib/gnutls_buffers.c
+++ b/lib/gnutls_buffers.c
@@ -460,12 +460,6 @@ _gnutls_io_read_buffered (gnutls_session_t session, size_t
total,
return GNUTLS_E_INVALID_REQUEST;
}
- if (ret < 0)
- {
- gnutls_assert ();
- return ret;
- }
-
/* READ DATA
*/
if (readsize > 0)
@@ -663,13 +657,13 @@ _gnutls_io_check_recv (gnutls_session_t session, unsigned
int ms)
ret = session->internals.pull_timeout_func(fd, ms);
err = get_errno (session);
- if (ret == -1 && err == EINTR)
- return GNUTLS_E_INTERRUPTED;
- else if (ret == -1 && err == EAGAIN)
- return GNUTLS_E_AGAIN;
- else if (ret == -1)
- return gnutls_assert_val(GNUTLS_E_PULL_ERROR);
-
+ if (ret == -1)
+ {
+ _gnutls_read_log ("READ_TIMEOUT: %d returned from %p, errno=%d (timeout:
%u)\n",
+ (int) ret, fd, err, ms);
+ return errno_to_gerr(err);
+ }
+
if (ret > 0)
return 0;
else return GNUTLS_E_TIMEDOUT;
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 343cfb0..edb736b 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -2372,7 +2372,8 @@ gnutls_handshake (gnutls_session_t session)
if (session->internals.priorities.protocol.algorithms == 0)
return gnutls_assert_val(GNUTLS_E_NO_PRIORITIES_WERE_SET);
- if (session->internals.handshake_timeout_ms)
+ if (session->internals.handshake_timeout_ms &&
+ session->internals.handshake_endtime == 0)
session->internals.handshake_endtime = gnutls_time(0) +
session->internals.handshake_timeout_ms / 1000;
diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c
index 1009a8c..349bfa1 100644
--- a/lib/gnutls_state.c
+++ b/lib/gnutls_state.c
@@ -275,6 +275,8 @@ _gnutls_handshake_internal_state_clear (gnutls_session_t
session)
deinit_internal_params (session);
_gnutls_epoch_gc(session);
+
+ session->internals.handshake_endtime = 0;
}
#define MIN_DH_BITS 727
diff --git a/tests/mini-handshake-timeout.c b/tests/mini-handshake-timeout.c
index d6a1501..ee4541b 100644
--- a/tests/mini-handshake-timeout.c
+++ b/tests/mini-handshake-timeout.c
@@ -67,14 +67,12 @@ client_log_func (int level, const char *str)
/* A very basic TLS client, with anonymous authentication.
*/
-static int counter;
-gnutls_session_t session;
-
static void
client (int fd, int wait)
{
int ret;
gnutls_anon_client_credentials_t anoncred;
+ gnutls_session_t session;
/* Need to enable anonymous KX specifically. */
gnutls_global_init ();
@@ -90,7 +88,7 @@ client (int fd, int wait)
/* Initialize TLS session
*/
gnutls_init (&session, GNUTLS_CLIENT);
- gnutls_handshake_set_timeout( session, 10*1000);
+ gnutls_handshake_set_timeout( session, 20*1000);
/* Use default priorities */
gnutls_priority_set_direct (session, "NORMAL:+ANON-ECDH", NULL);
@@ -99,8 +97,6 @@ client (int fd, int wait)
*/
gnutls_credentials_set (session, GNUTLS_CRD_ANON, anoncred);
- counter = 0;
-
gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) fd);
/* Perform the TLS handshake
@@ -138,32 +134,24 @@ client (int fd, int wait)
exit(0);
}
-
-/* These are global */
-gnutls_anon_server_credentials_t anoncred;
-pid_t child;
-
-static gnutls_session_t
-initialize_tls_session (void)
+static void
+initialize_tls_session (gnutls_session_t * session)
{
- gnutls_session_t session;
-
- gnutls_init (&session, GNUTLS_SERVER);
+ gnutls_init (session, GNUTLS_SERVER);
/* avoid calling all the priority functions, since the defaults
* are adequate.
*/
- gnutls_priority_set_direct (session, "NORMAL:+ANON-ECDH", NULL);
-
- gnutls_credentials_set (session, GNUTLS_CRD_ANON, anoncred);
-
- return session;
+ gnutls_priority_set_direct (*session, "NORMAL:+ANON-ECDH", NULL);
}
static void
server (int fd, int wait)
{
int ret;
+gnutls_session_t session;
+gnutls_anon_server_credentials_t anoncred;
+
/* this must be called once in the program
*/
gnutls_global_init ();
@@ -176,13 +164,12 @@ int ret;
gnutls_anon_allocate_server_credentials (&anoncred);
- session = initialize_tls_session ();
-
- counter = 0;
+ initialize_tls_session (&session);
+ gnutls_credentials_set (session, GNUTLS_CRD_ANON, anoncred);
gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) fd);
- if (wait) sleep(15);
+ if (wait) sleep(25);
else do
{
ret = gnutls_handshake (session);
@@ -192,17 +179,13 @@ int ret;
gnutls_deinit (session);
gnutls_anon_free_server_credentials(anoncred);
gnutls_global_deinit();
-
- if (ret < 0)
- {
- return;
- }
}
static void start (int wait)
{
int fd[2];
int ret;
+ pid_t child;
if (debug && wait)
fprintf(stderr, "\nWill test timeout\n");
hooks/post-receive
--
GNU gnutls
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU gnutls branch, master, updated. gnutls_3_1_0-52-g570b0bf,
Nikos Mavrogiannopoulos <=