-
Notifications
You must be signed in to change notification settings - Fork 1
/
mktable.awk
80 lines (69 loc) · 1.55 KB
/
mktable.awk
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
# Create github markdown table for TLS results
# gawk -f mktable.awk mkr1010.txt esp32.txt esp8266_bearssl.txt esp8266_axtls.txt >table.md
BEGIN {
OFS="|";
print "Board", "TLS Version", "Rating", "Ephemeral keys supported", \
"Session ticket supported", "TLS compression supported", \
"Unknown cipher suite supported", "Beast vuln", \
"Able to detect n minus one splitting"
print "---", "---", "---", "---", "---", "---", "---", "---", "---"
}
/^TLS protocol:/ {
if (filename == "") filename = FILENAME;
if (filename != "" && filename != FILENAME) {
if (proto != "") {
sub(/\.txt$/, "", filename);
print filename, proto, rating, eph, sess, comp, unk, beast, nminus1;
}
filename = FILENAME;
}
proto = rightside($0);
rating = "";
eph = "";
sess = "";
comp = "";
unk = "";
beast = "";
nminus1 = "";
next;
}
/^Rating:/ {
rating = rightside($0);
next;
}
/^Ephemeral keys supported:/ {
eph = rightside($0);
next;
}
/^Session ticket supported/ {
sess = rightside($0);
next;
}
/^TLS compression supported:/ {
comp = rightside($0);
next;
}
/^Unknown cipher suite supported/ {
unk = rightside($0);
next;
}
/^Beast vuln:/ {
beast = rightside($0);
next;
}
/^Able to detect n minus one splitting:/ {
nminus1 = rightside($0);
next;
}
END {
if (proto != "") {
sub(/\.txt$/, "", filename);
print filename, proto, rating, eph, sess, comp, unk, beast, nminus1;
}
}
# s is a string like this "a b c: d e f". Return the
# substring to the right of the colon.
function rightside(s, fields) {
split(s, fields, ":");
return fields[2];
}