mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-01 06:27:24 +00:00
ssl_server2.c: Flush stdout to improve logs timeliness
Signed-off-by: Ronald Cron <[email protected]>
This commit is contained in:
@@ -3490,6 +3490,7 @@ handshake:
|
|||||||
* 5. Verify the client certificate
|
* 5. Verify the client certificate
|
||||||
*/
|
*/
|
||||||
mbedtls_printf(" . Verifying peer X.509 certificate...");
|
mbedtls_printf(" . Verifying peer X.509 certificate...");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
if ((flags = mbedtls_ssl_get_verify_result(&ssl)) != 0) {
|
if ((flags = mbedtls_ssl_get_verify_result(&ssl)) != 0) {
|
||||||
char vrfy_buf[512];
|
char vrfy_buf[512];
|
||||||
@@ -3507,6 +3508,7 @@ handshake:
|
|||||||
char crt_buf[512];
|
char crt_buf[512];
|
||||||
|
|
||||||
mbedtls_printf(" . Peer certificate information ...\n");
|
mbedtls_printf(" . Peer certificate information ...\n");
|
||||||
|
fflush(stdout);
|
||||||
mbedtls_x509_crt_info(crt_buf, sizeof(crt_buf), " ",
|
mbedtls_x509_crt_info(crt_buf, sizeof(crt_buf), " ",
|
||||||
mbedtls_ssl_get_peer_cert(&ssl));
|
mbedtls_ssl_get_peer_cert(&ssl));
|
||||||
mbedtls_printf("%s\n", crt_buf);
|
mbedtls_printf("%s\n", crt_buf);
|
||||||
@@ -3959,6 +3961,7 @@ data_exchange:
|
|||||||
size_t buf_len;
|
size_t buf_len;
|
||||||
|
|
||||||
mbedtls_printf(" . Serializing live connection...");
|
mbedtls_printf(" . Serializing live connection...");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
ret = mbedtls_ssl_context_save(&ssl, NULL, 0, &buf_len);
|
ret = mbedtls_ssl_context_save(&ssl, NULL, 0, &buf_len);
|
||||||
if (ret != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL) {
|
if (ret != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL) {
|
||||||
@@ -3993,6 +3996,7 @@ data_exchange:
|
|||||||
size_t b64_len;
|
size_t b64_len;
|
||||||
|
|
||||||
mbedtls_printf(" . Save serialized context to a file... ");
|
mbedtls_printf(" . Save serialized context to a file... ");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
mbedtls_base64_encode(NULL, 0, &b64_len, context_buf, buf_len);
|
mbedtls_base64_encode(NULL, 0, &b64_len, context_buf, buf_len);
|
||||||
|
|
||||||
@@ -4041,6 +4045,7 @@ data_exchange:
|
|||||||
if (opt.serialize == 1) {
|
if (opt.serialize == 1) {
|
||||||
/* nothing to do here, done by context_save() already */
|
/* nothing to do here, done by context_save() already */
|
||||||
mbedtls_printf(" . Context has been reset... ok\n");
|
mbedtls_printf(" . Context has been reset... ok\n");
|
||||||
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -4053,6 +4058,7 @@ data_exchange:
|
|||||||
*/
|
*/
|
||||||
if (opt.serialize == 2) {
|
if (opt.serialize == 2) {
|
||||||
mbedtls_printf(" . Freeing and reinitializing context...");
|
mbedtls_printf(" . Freeing and reinitializing context...");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
mbedtls_ssl_free(&ssl);
|
mbedtls_ssl_free(&ssl);
|
||||||
|
|
||||||
@@ -4089,6 +4095,7 @@ data_exchange:
|
|||||||
}
|
}
|
||||||
|
|
||||||
mbedtls_printf(" . Deserializing connection...");
|
mbedtls_printf(" . Deserializing connection...");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
if ((ret = mbedtls_ssl_context_load(&ssl, context_buf,
|
if ((ret = mbedtls_ssl_context_load(&ssl, context_buf,
|
||||||
buf_len)) != 0) {
|
buf_len)) != 0) {
|
||||||
@@ -4118,6 +4125,7 @@ data_exchange:
|
|||||||
*/
|
*/
|
||||||
close_notify:
|
close_notify:
|
||||||
mbedtls_printf(" . Closing the connection...");
|
mbedtls_printf(" . Closing the connection...");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
/* No error checking, the connection might be closed already */
|
/* No error checking, the connection might be closed already */
|
||||||
do {
|
do {
|
||||||
|
|||||||
Reference in New Issue
Block a user