mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-06 00:39:44 +01:00
Don't maintain SOCK_REPLY_FILE in non-debug mode
In client_simulation_sockets() and tls_sockets(), don't work to create a SOCK_REPLY_FILE that contains the entire server's response (in cases where the response was spread across multiple packets) unless $DEBUG is at least 1.
This commit is contained in:
parent
6bd1c26a14
commit
a8ef95c2cc
40
testssl.sh
40
testssl.sh
@ -3662,8 +3662,10 @@ client_simulation_sockets() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for(( 1 ; hello_done==1; 1 )); do
|
for(( 1 ; hello_done==1; 1 )); do
|
||||||
sock_reply_file2=${SOCK_REPLY_FILE}.2
|
if [[ $DEBUG -ge 1 ]]; then
|
||||||
mv "$SOCK_REPLY_FILE" "$sock_reply_file2"
|
sock_reply_file2=${SOCK_REPLY_FILE}.2
|
||||||
|
mv "$SOCK_REPLY_FILE" "$sock_reply_file2"
|
||||||
|
fi
|
||||||
|
|
||||||
debugme echo -n "requesting more server hello data... "
|
debugme echo -n "requesting more server hello data... "
|
||||||
socksend "" $USLEEP_SND
|
socksend "" $USLEEP_SND
|
||||||
@ -3676,15 +3678,17 @@ client_simulation_sockets() {
|
|||||||
# getting into an infinite loop if the server has nothing
|
# getting into an infinite loop if the server has nothing
|
||||||
# left to send and check_tls_serverhellodone doesn't
|
# left to send and check_tls_serverhellodone doesn't
|
||||||
# correctly catch it.
|
# correctly catch it.
|
||||||
mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
|
[[ $DEBUG -ge 1 ]] && mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
|
||||||
hello_done=0
|
hello_done=0
|
||||||
else
|
else
|
||||||
tls_hello_ascii+="$next_packet"
|
tls_hello_ascii+="$next_packet"
|
||||||
sock_reply_file3=${SOCK_REPLY_FILE}.3
|
if [[ $DEBUG -ge 1 ]]; then
|
||||||
mv "$SOCK_REPLY_FILE" "$sock_reply_file3" #FIXME: we moved that already
|
sock_reply_file3=${SOCK_REPLY_FILE}.3
|
||||||
mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
|
mv "$SOCK_REPLY_FILE" "$sock_reply_file3" #FIXME: we moved that already
|
||||||
cat "$sock_reply_file3" >> "$SOCK_REPLY_FILE"
|
mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
|
||||||
rm "$sock_reply_file3"
|
cat "$sock_reply_file3" >> "$SOCK_REPLY_FILE"
|
||||||
|
rm "$sock_reply_file3"
|
||||||
|
fi
|
||||||
|
|
||||||
check_tls_serverhellodone "$tls_hello_ascii" "ephemeralkey"
|
check_tls_serverhellodone "$tls_hello_ascii" "ephemeralkey"
|
||||||
hello_done=$?
|
hello_done=$?
|
||||||
@ -9631,8 +9635,10 @@ tls_sockets() {
|
|||||||
fi
|
fi
|
||||||
for (( 1 ; hello_done==1; 1 )); do
|
for (( 1 ; hello_done==1; 1 )); do
|
||||||
if ! "$skip"; then
|
if ! "$skip"; then
|
||||||
sock_reply_file2=$(mktemp $TEMPDIR/ddreply.XXXXXX) || return 7
|
if [[ $DEBUG -ge 1 ]]; then
|
||||||
mv "$SOCK_REPLY_FILE" "$sock_reply_file2"
|
sock_reply_file2=$(mktemp $TEMPDIR/ddreply.XXXXXX) || return 7
|
||||||
|
mv "$SOCK_REPLY_FILE" "$sock_reply_file2"
|
||||||
|
fi
|
||||||
|
|
||||||
debugme echo -n "requesting more server hello data... "
|
debugme echo -n "requesting more server hello data... "
|
||||||
socksend "" $USLEEP_SND
|
socksend "" $USLEEP_SND
|
||||||
@ -9646,16 +9652,18 @@ tls_sockets() {
|
|||||||
# getting into an infinite loop if the server has nothing
|
# getting into an infinite loop if the server has nothing
|
||||||
# left to send and check_tls_serverhellodone doesn't
|
# left to send and check_tls_serverhellodone doesn't
|
||||||
# correctly catch it.
|
# correctly catch it.
|
||||||
mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
|
[[ $DEBUG -ge 1 ]] && mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
|
||||||
hello_done=0
|
hello_done=0
|
||||||
else
|
else
|
||||||
tls_hello_ascii+="$next_packet"
|
tls_hello_ascii+="$next_packet"
|
||||||
|
|
||||||
sock_reply_file3=$(mktemp $TEMPDIR/ddreply.XXXXXX) || return 7
|
if [[ $DEBUG -ge 1 ]]; then
|
||||||
mv "$SOCK_REPLY_FILE" "$sock_reply_file3"
|
sock_reply_file3=$(mktemp $TEMPDIR/ddreply.XXXXXX) || return 7
|
||||||
mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
|
mv "$SOCK_REPLY_FILE" "$sock_reply_file3"
|
||||||
cat "$sock_reply_file3" >> "$SOCK_REPLY_FILE"
|
mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
|
||||||
rm "$sock_reply_file3"
|
cat "$sock_reply_file3" >> "$SOCK_REPLY_FILE"
|
||||||
|
rm "$sock_reply_file3"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
skip=false
|
skip=false
|
||||||
|
Loading…
Reference in New Issue
Block a user