Add code for testing client-initiated renegotiation

This commit is contained in:
Manuel Pégourié-Gonnard 2013-10-29 18:16:38 +01:00
parent 6edcd41c0a
commit 53b3e0603b

View file

@ -71,6 +71,9 @@
* longer paquets (for fragmentation purposes) */
#define GET_REQUEST "GET %s HTTP/1.0\r\n" /* LONG_HEADER */ "\r\n"
/* Temporary, should become a runtime option later */
// #define TEST_RENEGO
/*
* global options
*/
@ -792,6 +795,24 @@ int main( int argc, char *argv[] )
}
#endif /* POLARSSL_X509_CRT_PARSE_C */
#ifdef TEST_RENEGO
/*
* Perform renegotiation (this must be done when the server is waiting
* for input from our side).
*/
printf( " . Performing renegotiation..." );
fflush( stdout );
while( ( ret = ssl_renegotiate( &ssl ) ) != 0 )
{
if( ret != POLARSSL_ERR_NET_WANT_READ && ret != POLARSSL_ERR_NET_WANT_WRITE )
{
printf( " failed\n ! ssl_renegotiate returned %d\n\n", ret );
goto exit;
}
}
printf( " ok\n" );
#endif
/*
* 6. Write the GET request
*/