mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-03 23:39:45 +01:00
- for seldom cases of two hsts header we don't throw an error but take the first one
This commit is contained in:
parent
e06251a1d3
commit
4ae510650d
@ -292,10 +292,11 @@ hsts() {
|
|||||||
bold " HSTS "
|
bold " HSTS "
|
||||||
grep -i '^Strict-Transport-Security' $HEADERFILE >$TMPFILE
|
grep -i '^Strict-Transport-Security' $HEADERFILE >$TMPFILE
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
AGE_SEC=`sed -e 's/[^0-9]*//g' $TMPFILE`
|
grep -c '^Strict-Transport-Security' $HEADERFILE | egrep -wq "1" || out "(two HSTS header, using 1st one) "
|
||||||
|
AGE_SEC=`sed -e 's/[^0-9]*//g' $TMPFILE | head -1`
|
||||||
AGE_DAYS=`expr $AGE_SEC \/ 86400`
|
AGE_DAYS=`expr $AGE_SEC \/ 86400`
|
||||||
if [ $AGE_DAYS -gt $HSTS_MIN ]; then
|
if [ $AGE_DAYS -gt $HSTS_MIN ]; then
|
||||||
litegreen "$AGE_DAYS days \c" ; outln "($AGE_SEC s)"
|
litegreen "$AGE_DAYS days \c" ; out "($AGE_SEC s)"
|
||||||
else
|
else
|
||||||
brown "$AGE_DAYS days (<$HSTS_MIN is not good enough)"
|
brown "$AGE_DAYS days (<$HSTS_MIN is not good enough)"
|
||||||
fi
|
fi
|
||||||
@ -1644,7 +1645,7 @@ get_dns_entries() {
|
|||||||
if [ -z "$IP4" ] ; then
|
if [ -z "$IP4" ] ; then
|
||||||
IP4=`host -t a $NODE | grep -v alias | sed 's/^.*address //'`
|
IP4=`host -t a $NODE | grep -v alias | sed 's/^.*address //'`
|
||||||
if echo "$IP4" | grep -q NXDOMAIN ; then
|
if echo "$IP4" | grep -q NXDOMAIN ; then
|
||||||
magenta "Can't proceed: No IP resultion from \"$NODE\""; outln "\n"
|
magenta "Can't proceed: No DNS resolution from \"$NODE\""; outln "\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -1880,7 +1881,7 @@ case "$1" in
|
|||||||
exit $ret ;;
|
exit $ret ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# $Id: testssl.sh,v 1.119 2014/10/07 10:03:47 dirkw Exp $
|
# $Id: testssl.sh,v 1.120 2014/10/07 23:02:32 dirkw Exp $
|
||||||
# vim:ts=5:sw=5
|
# vim:ts=5:sw=5
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user