From 6a2bc23f632d3f4bf90e65fc5a0b60dda4d6132f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 9 Oct 2014 15:33:13 +0200 Subject: [PATCH] Allow exchanges=0 in ssl_server2 Useful for testing with defensics with no data exchange --- programs/ssl/ssl_server2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index be9d07b287..330abbe5ae 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -869,7 +869,7 @@ int main( int argc, char *argv[] ) else if( strcmp( p, "exchanges" ) == 0 ) { opt.exchanges = atoi( q ); - if( opt.exchanges < 1 ) + if( opt.exchanges < 0 ) goto usage; } else if( strcmp( p, "min_version" ) == 0 ) @@ -1740,6 +1740,9 @@ reset: } #endif /* POLARSSL_X509_CRT_PARSE_C */ + if( opt.exchanges == 0 ) + goto close_notify; + exchanges = opt.exchanges; data_exchange: /*