-
Notifications
You must be signed in to change notification settings - Fork 1
/
archtesterd_tlsver
executable file
·80 lines (73 loc) · 1.46 KB
/
archtesterd_tlsver
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
#
# Initialize ---------------------------------------------------------
#
debug=0
resultfile=/dev/tty
tmpresultfile=/tmp/archtesterd_tlsver.out
domain="google.com youtube.com facebook.com baidu.com wikipedia.com reddit.com yahoo.com google.co.in amazon.com twitter.com"
#domain=www.google.com
#domain=tls13.crypto.mozilla.org
#
# Main program -------------------------------------------------------
#
#
# Parse arguments
#
while [ $# -gt 0 ]
do
case x$1 in
x-debug)
shift
debug=1;;
x-quiet)
shift
debug=0;;
x-output)
shift
resultfile=$1
shift;;
*)
echo "archtesterd_tlds: unexpected argument: $1"
exit 1;;
esac
done
#
# Actual measurement -------------------------------------------------------
#
if tlsver -rfc -quiet $domain > $tmpresultfile
then
ver=`cat $tmpresultfile`
if [ "x$ver" = xunknown -o "x$ver" = x ]
then
echo search:0.0 > $resultfile
else
majorver=`cut -f1 -d. $tmpresultfile`
minorver=`cut -f2 -d. $tmpresultfile`
if [ "$majorver" -gt 1 ]
then
verdict=good
else
year=`date +%Y`
if [ "$year" -gt 2018 ]
then
if [ "$minorver" -gt 2500 ]
then
verdict=good
else
verdict=bad
fi
else
if [ "$minorver" -gt 2000 ]
then
verdict=good
else
verdict=bad
fi
fi
fi
echo $verdict:$ver > $resultfile
fi
else
echo search:0 > $resultfile
fi