X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=tools%2Fsslio.c;h=7fc1d5395cc897c5022659c476b585a36b72ca90;hp=8d58ee943fb1864d8b5143f7534c298c72b4f417;hb=af9c79a0710a45361f9ae4313f8bb5bf738c3b7a;hpb=5f045c759957fdff8c85716e6af99e10901fdac0 diff --git a/tools/sslio.c b/tools/sslio.c index 8d58ee9..7fc1d53 100644 --- a/tools/sslio.c +++ b/tools/sslio.c @@ -266,7 +266,11 @@ run_ssl_engine(br_ssl_engine_context *cc, unsigned long fd, unsigned flags) * Print algorithm details. */ if (verbose) { + const char *rngname; + fprintf(stderr, "Algorithms:\n"); + br_prng_seeder_system(&rngname); + fprintf(stderr, " RNG: %s\n", rngname); if (cc->iaes_cbcenc != 0) { fprintf(stderr, " AES/CBC (enc): %s\n", get_algo_name(cc->iaes_cbcenc, 0)); @@ -671,7 +675,14 @@ run_ssl_engine(br_ssl_engine_context *cc, unsigned long fd, unsigned flags) buf = br_ssl_engine_recvrec_buf(cc, &len); rlen = recv(fd, buf, len, 0); - if (rlen <= 0) { + if (rlen == 0) { + if (verbose) { + fprintf(stderr, "socket closed...\n"); + } + retcode = -1; + goto engine_exit; + } + if (rlen < 0) { #ifdef _WIN32 int err; @@ -688,7 +699,7 @@ run_ssl_engine(br_ssl_engine_context *cc, unsigned long fd, unsigned flags) } #endif if (verbose) { - fprintf(stderr, "socket closed...\n"); + fprintf(stderr, "socket broke...\n"); } retcode = -1; goto engine_exit;