summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2001-11-10 21:37:13 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2001-11-10 21:37:13 +0000
commit7d28c069875e58a0a6640684a379fe6d2aaf69b6 (patch)
treea2a01fdffbf4495fccd17a16f442d128e0bfe0cf /src
parentd4b8f2c7eea4246a6e2d1dee4118f0bd8ebd20e6 (diff)
downloadgnutls-7d28c069875e58a0a6640684a379fe6d2aaf69b6.tar.gz
several fixes.
Including: - max_record_header extension. - resume handshake sending wrong ssl version - Non blocking IO (not ready yet)
Diffstat (limited to 'src')
-rw-r--r--src/cli.c7
-rw-r--r--src/serv.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/cli.c b/src/cli.c
index 36e6c13145..0428f78ae6 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -29,8 +29,7 @@
#include <unistd.h>
#include "../lib/gnutls.h"
#include <sys/time.h>
-
-#include <dmalloc.h>
+#include <signal.h>
#ifndef SHUT_WR
# define SHUT_WR 1
@@ -174,6 +173,8 @@ int main(int argc, char** argv)
SRP_CLIENT_CREDENTIALS cred;
X509PKI_CLIENT_CREDENTIALS xcred;
+ signal( SIGPIPE, SIG_IGN);
+
if (argc!=3) {
fprintf(stderr, "Usage: cli [IP] [PORT]\n");
exit(1);
@@ -216,6 +217,8 @@ int main(int argc, char** argv)
#ifdef RESUME
gnutls_init(&state, GNUTLS_CLIENT);
+ gnutls_set_max_record_size( state, 512);
+
gnutls_set_protocol_priority( state, GNUTLS_TLS1, GNUTLS_SSL3, 0);
gnutls_set_cipher_priority( state, GNUTLS_3DES_CBC, GNUTLS_RIJNDAEL_CBC, 0);
gnutls_set_compression_priority( state, GNUTLS_ZLIB, GNUTLS_NULL_COMPRESSION, 0);
diff --git a/src/serv.c b/src/serv.c
index 93625797f3..9ed9ff355e 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -29,6 +29,7 @@
#include <unistd.h>
#include "../lib/gnutls.h"
#include <port.h>
+#include <signal.h>
#define KEYFILE "x509/key.pem"
#define CERTFILE "x509/cert.pem"
@@ -343,6 +344,8 @@ int main(int argc, char **argv)
int http = 0;
char name[256];
+ signal(SIGPIPE, SIG_IGN);
+
if (argc != 2) {
fprintf(stderr, "Usage: serv [-e] [-h]\n");
exit(1);
@@ -435,9 +438,11 @@ int main(int argc, char **argv)
ret = read_request(sd, state, buffer, MAX_BUF, (http==0)?1:2);
if (gnutls_is_fatal_error(ret) == 1 || ret == 0) {
+ fflush(stdout);
if (ret == 0) {
printf
("\n- Peer has closed the GNUTLS connection\n");
+ fflush(stdout);
break;
} else {
fprintf(stderr,
@@ -475,10 +480,12 @@ int main(int argc, char **argv)
} while( ret==GNUTLS_E_INTERRUPTED || ret==GNUTLS_E_AGAIN);
if (gnutls_get_last_alert(state)!=GNUTLS_NO_RENEGOTIATION) {
+ printf("* Requesting rehandshake.\n");
/* continue handshake proccess */
do {
ret = gnutls_handshake(sd, state);
} while( ret==GNUTLS_E_INTERRUPTED || ret==GNUTLS_E_AGAIN);
+ printf("* Rehandshake returned %d\n", ret);
}
}
#endif