mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-10 18:50:58 +01:00
Fixed startssl protocol errors. count_lines function always returns at least 1
For now I fixed this with a wc -l command, I hope @drwetter can fix the count_lines function for me
This commit is contained in:
parent
69d244748f
commit
06b1a12b3b
@ -17,9 +17,9 @@ my $socketout = `./testssl.sh -c -t smtp --jsonfile tmp.json --color 0 smtp-rela
|
|||||||
my $socket = json('tmp.json');
|
my $socket = json('tmp.json');
|
||||||
like($socketout, qr/Running client simulations via sockets/, "Tests ran via sockets"); $tests++;
|
like($socketout, qr/Running client simulations via sockets/, "Tests ran via sockets"); $tests++;
|
||||||
|
|
||||||
my $i = 0;
|
my $i = 1; # Need to start counting at 1
|
||||||
foreach my $o ( @$openssl ) {
|
foreach my $s ( @$socket ) {
|
||||||
my $s = $$socket[$i];
|
my $o = $$openssl[$i];
|
||||||
if ( $o->{id} =~ /^client_/ ) {
|
if ( $o->{id} =~ /^client_/ ) {
|
||||||
pass("Comparing $o->{id}"); $tests++;
|
pass("Comparing $o->{id}"); $tests++;
|
||||||
cmp_ok($o->{id}, "eq", $s->{id}, "Id's match"); $tests++;
|
cmp_ok($o->{id}, "eq", $s->{id}, "Id's match"); $tests++;
|
||||||
|
10
testssl.sh
10
testssl.sh
@ -2042,12 +2042,12 @@ run_client_simulation() {
|
|||||||
|
|
||||||
outln
|
outln
|
||||||
if "$using_sockets"; then
|
if "$using_sockets"; then
|
||||||
pr_headlineln " Running client simulations via sockets "
|
pr_headlineln " Running client simulations via sockets (experimental) "
|
||||||
else
|
else
|
||||||
pr_headlineln " Running client simulations (experimental) "
|
pr_headlineln " Running client simulations via openssl (experimental) "
|
||||||
outln
|
outln
|
||||||
pr_warningln " Depending on your openssl client and the server side this may yield to false values"
|
pr_warningln " Depending on your openssl client and the server side this may yield to false values"
|
||||||
fileout "client_simulation" "WARNING" "Depending on your openssl client and the server side this may yield to false values"
|
fileout "client_simulation_openssl" "WARNING" "Running simulations via openssl, depending on your openssl client and the server side this may yield to false values"
|
||||||
fi
|
fi
|
||||||
outln
|
outln
|
||||||
|
|
||||||
@ -2055,7 +2055,9 @@ run_client_simulation() {
|
|||||||
for name in "${short[@]}"; do
|
for name in "${short[@]}"; do
|
||||||
# Make sure we run client simulations for those clients that support it
|
# Make sure we run client simulations for those clients that support it
|
||||||
if $do_all_simulations || ${current[i]} ; then
|
if $do_all_simulations || ${current[i]} ; then
|
||||||
if $do_all_simulations || [[ $(count_lines "$(echo "${service[i]}" | grep "$client_service")") -eq 1 || "${service[i]}" == "ANY" ]]; then
|
# if $do_all_simulations || [[ $(count_lines "$(echo "${service[i]}" | grep "$client_service")") -eq 1 || "${service[i]}" == "ANY" ]]; then
|
||||||
|
# I know @drwetter hates wc -l, but in this case wc -l and count_lines give different results
|
||||||
|
if $do_all_simulations || [[ $(echo "${service[i]}" | grep "$client_service" |wc -l ) -eq 1 || "${service[i]}" == "ANY" ]]; then
|
||||||
#FIXME: printf formatting would look better, especially if we want a wide option here
|
#FIXME: printf formatting would look better, especially if we want a wide option here
|
||||||
out " ${names[i]} "
|
out " ${names[i]} "
|
||||||
if $using_sockets && [[ -n "${handshakebytes[i]}" ]]; then
|
if $using_sockets && [[ -n "${handshakebytes[i]}" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user