mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 17:55:37 +01:00
Add code for testing client-initiated renegotiation
This commit is contained in:
parent
6edcd41c0a
commit
53b3e0603b
@ -71,6 +71,9 @@
|
|||||||
* longer paquets (for fragmentation purposes) */
|
* longer paquets (for fragmentation purposes) */
|
||||||
#define GET_REQUEST "GET %s HTTP/1.0\r\n" /* LONG_HEADER */ "\r\n"
|
#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
|
* global options
|
||||||
*/
|
*/
|
||||||
@ -792,6 +795,24 @@ int main( int argc, char *argv[] )
|
|||||||
}
|
}
|
||||||
#endif /* POLARSSL_X509_CRT_PARSE_C */
|
#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
|
* 6. Write the GET request
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user