mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-03 23:39:45 +01:00
- FIX: regression for wc -l w/o cat (3x)
- removal of unneccessary waitpid, inline
This commit is contained in:
parent
fbd383f345
commit
655944bd4d
28
testssl.sh
28
testssl.sh
@ -390,7 +390,7 @@ EOF
|
|||||||
pid=$!
|
pid=$!
|
||||||
if wait_kill $pid $HEADER_MAXSLEEP; then
|
if wait_kill $pid $HEADER_MAXSLEEP; then
|
||||||
if ! egrep -iq "XML|HTML|DOCTYPE|HTTP|Connection" $HEADERFILE; then
|
if ! egrep -iq "XML|HTML|DOCTYPE|HTTP|Connection" $HEADERFILE; then
|
||||||
pr_litemagenta "likely HTTP header requests failed (#lines: $(wc -l $HEADERFILE))."
|
pr_litemagenta "likely HTTP header requests failed (#lines: $(wc -l < $HEADERFILE))."
|
||||||
outln "Rerun with DEBUG=1 and inspect \"http_header.txt\"\n"
|
outln "Rerun with DEBUG=1 and inspect \"http_header.txt\"\n"
|
||||||
debugme cat $HEADERFILE
|
debugme cat $HEADERFILE
|
||||||
ret=7
|
ret=7
|
||||||
@ -563,7 +563,7 @@ cookieflags() { # ARG1: Path, ARG2: path
|
|||||||
pr_bold " Cookie(s) "
|
pr_bold " Cookie(s) "
|
||||||
grep -ai '^Set-Cookie' $HEADERFILE >$TMPFILE
|
grep -ai '^Set-Cookie' $HEADERFILE >$TMPFILE
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
nr_cookies=$(wc -l $TMPFILE)
|
nr_cookies=$(wc -l < $TMPFILE)
|
||||||
out "$nr_cookies issued: "
|
out "$nr_cookies issued: "
|
||||||
if [ $nr_cookies -gt 1 ] ; then
|
if [ $nr_cookies -gt 1 ] ; then
|
||||||
negative_word="NONE"
|
negative_word="NONE"
|
||||||
@ -710,24 +710,10 @@ sockread() {
|
|||||||
ddreply=$(mktemp /tmp/ddreply.XXXXXX) || exit 7
|
ddreply=$(mktemp /tmp/ddreply.XXXXXX) || exit 7
|
||||||
dd bs=$1 of=$ddreply count=1 <&5 2>/dev/null &
|
dd bs=$1 of=$ddreply count=1 <&5 2>/dev/null &
|
||||||
pid=$!
|
pid=$!
|
||||||
|
|
||||||
while true; do
|
|
||||||
if ! ps $pid >/dev/null ; then
|
|
||||||
break # didn't reach maxsleep yet
|
|
||||||
kill $pid >&2 2>/dev/null
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
maxsleep=$(($maxsleep - 1))
|
|
||||||
test $maxsleep -eq 0 && break
|
|
||||||
done
|
|
||||||
#FIXME: cleanup, we have extra function for this now
|
|
||||||
|
|
||||||
if ps $pid >/dev/null ; then
|
wait_kill $pid $maxsleep
|
||||||
# time's up and dd is still alive --> timeout
|
ret=$?
|
||||||
kill $pid
|
|
||||||
wait $pid 2>/dev/null
|
|
||||||
ret=3 # means killed
|
|
||||||
fi
|
|
||||||
SOCKREPLY=$(cat $ddreply)
|
SOCKREPLY=$(cat $ddreply)
|
||||||
rm $ddreply
|
rm $ddreply
|
||||||
|
|
||||||
@ -1269,7 +1255,7 @@ pfs() {
|
|||||||
|
|
||||||
$OPENSSL ciphers -V "$PFSOK" >$TMPFILE 2>/dev/null
|
$OPENSSL ciphers -V "$PFSOK" >$TMPFILE 2>/dev/null
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
number_pfs=$(wc -l $TMPFILE | awk '{ print $1 }')
|
number_pfs=$(wc -l < $TMPFILE)
|
||||||
if [ "$number_pfs" -le "$CLIENT_MIN_PFS" ] ; then
|
if [ "$number_pfs" -le "$CLIENT_MIN_PFS" ] ; then
|
||||||
outln
|
outln
|
||||||
pr_magentaln " Local problem: you have only $number_pfs client side PFS ciphers "
|
pr_magentaln " Local problem: you have only $number_pfs client side PFS ciphers "
|
||||||
@ -3007,6 +2993,6 @@ case "$1" in
|
|||||||
exit $ret ;;
|
exit $ret ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# $Id: testssl.sh,v 1.205 2015/03/15 09:18:36 dirkw Exp $
|
# $Id: testssl.sh,v 1.206 2015/03/15 13:41:33 dirkw Exp $
|
||||||
# vim:ts=5:sw=5
|
# vim:ts=5:sw=5
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user