summaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-01-10 14:21:42 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-01-11 00:26:51 +0100
commit1a338cbaaeec11d958de8da4d1ae036979fccf3e (patch)
tree5f5341d38761f3acc5167ad38983023033b4a0e5 /src/cli.c
parent581718c927838474200c305587241ae15511cb82 (diff)
downloadgnutls-1a338cbaaeec11d958de8da4d1ae036979fccf3e.tar.gz
Added safe renegotiation patch from Steve Dispensa, modified to suit gnutls
code style and error checking. Modified to conform to draft-ietf-tls-renegotiation-03.txt. gnutls-cli will search input for **RENEGOTIATION** to perform a renegotiation and gnutls-serv will perform one if requested.
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cli.c b/src/cli.c
index 2aa2da4197..4e5bebe9d6 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -826,6 +826,17 @@ after_handshake:
continue;
}
+ if (strstr(buffer, "**REHANDSHAKE**") != NULL) {
+ fprintf (stderr, "*** Starting TLS rehandshake\n");
+ ret = do_handshake (&hd);
+ if (ret < 0)
+ {
+ fprintf (stderr, "*** Rehandshake has failed\n");
+ user_term = 1;
+ retval = 1;
+ break;
+ }
+ }
if (crlf != 0)
{
char *b = strchr (buffer, '\n');