gnutls-cli-debug: fix early break for no version supported check
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Mon, 2 Sep 2019 13:34:08 +0000 (16:34 +0300)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Mon, 2 Sep 2019 14:29:38 +0000 (17:29 +0300)
commit90ced0974a22afa30fe5d3217512033d91ca89dc
tree11bf1c402924cf59888367c4fee7f7922c8953b2
parent6522c27d70d29cdb67cbfe5864e2f02bdda69970
gnutls-cli-debug: fix early break for no version supported check

Currently gnutls-cli-debug code hardodes index of tests, after which it
will check if any known protocols (SSL 3.0/TLS1.[0123]) are supported by
the server. However this number is hardcoded and thus easy to break.
This is exactly what happened after adding %ALLOW_SMALL_RECORDS check.
Two tests were added in front of tests lists without updating this
index.

So let's make this check robust by adding another test which will return
fatal error if no known protocols are supported. While we are at it,
also simplify tests loop by removing internal loop completely and
controlling opening/closing a socket with a flag.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
src/cli-debug.c
src/tests.c
src/tests.h