Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit e61627e

Browse files
committed
v1.1.0
1 parent 0fe3a07 commit e61627e

20 files changed

+1216
-33
lines changed

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
tls-map (1.0.0)
4+
tls-map (1.1.0)
55
docopt (~> 0.6)
66
paint (~> 2.2)
77

bin/tls-map

+26-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ doc = <<~DOCOPT
1414
TLS map
1515
1616
Usage:
17-
tls-map search <critera> <term> [-o <output> --force] [--no-color --debug]
17+
tls-map search <critera> <term> [-o <output> --force -e -a] [--no-color --debug]
1818
tls-map export <filename> <format> [--force] [--debug]
1919
tls-map update [--debug]
2020
tls-map -h | --help
@@ -24,6 +24,8 @@ doc = <<~DOCOPT
2424
<critera> The type of term. Accepted values: codepoint, iana, openssl, gnutls, nss.
2525
<term> The cipher algorithm name.
2626
-o, --output <output> Displayed fields. Accepted values: all, codepoint, iana, openssl, gnutls, nss. [default: all]
27+
-e, --extended (Online) Display additional information about the cipher (requires output = all or iana)
28+
-a, --acronym (Online) Display full acronym name (requires -e / --extended option)
2729
2830
Export options: (offline)
2931
<filename> The output file name to write to.
@@ -50,6 +52,29 @@ begin
5052
res.each do |k, v|
5153
puts "#{Paint[k, :green]}: #{Paint[v, :white]}"
5254
end
55+
if args['--extended']
56+
tmext = TLSmap::App::Extended
57+
tmext_i = tmext.new
58+
ext = tmext_i.extend(res[:iana])
59+
dic = tmext::DICO
60+
sev = tmext::VULN_SEVERITY
61+
ext.each do |k, v|
62+
case k
63+
when 'vulns'
64+
puts "#{Paint[dic[k], :magenta]}:"
65+
v.each do |vuln|
66+
print " - #{Paint[sev[vuln[:severity]][:title], sev[vuln[:severity]][:color]]} - "
67+
puts Paint[vuln[:description], :white]
68+
end
69+
when 'tls_version'
70+
puts "#{Paint[dic[k], :magenta]}: #{Paint[v.join(', '), :white]}"
71+
else
72+
print "#{Paint[dic[k], :magenta]}: #{Paint[v, :white]}"
73+
print " (#{tmext_i.translate_acronym(v)})" if args['--acronym'] && !tmext_i.translate_acronym(v).nil? # rubocop:disable Metrics/BlockNesting
74+
puts
75+
end
76+
end
77+
end
5378
elsif args['export']
5479
cli = TLSmap::CLI.new(args['--force'])
5580
cli.export(args['<filename>'], args['<format>'].to_sym)

docs/CHANGELOG.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22

33
## [1.1.0]
44

5+
Additions:
6+
7+
- New `TLSmap::App::Extended` class: partial wrapper around ciphersuite.info API to get extra info about a cipher
8+
- New `--extended` and `-acronym` CLI option for the `search` command using the new class
9+
10+
Changes:
11+
12+
- Move `tmpfile()` to a `Utils` module (no breaking changes)
13+
514
Fix:
615

7-
- fix NSS and GnuTLS parser: many ciphers were not parsed due to a wrong regexp
8-
- make search case-insensitive for hexadecimal codepoints
9-
- fix OpenSSL parser: some TLS 1.0 ciphers where defined in SSL 3.0 source code file
16+
- fix NSS and GnuTLS parser: many ciphers were not parsed due to a wrong regexp
17+
- make search case-insensitive for hexadecimal codepoints
18+
- fix OpenSSL parser: some TLS 1.0 ciphers where defined in SSL 3.0 source code file
1019

1120
Documentation:
1221

docs/yard/TLSmap.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<dl>
8080
<dt>Defined in:</dt>
8181
<dd>lib/tls_map.rb<span class="defines">,<br />
82-
lib/tls_map/cli.rb,<br /> lib/tls_map/nss.rb,<br /> lib/tls_map/iana.rb,<br /> lib/tls_map/utils.rb,<br /> lib/tls_map/gnutls.rb,<br /> lib/tls_map/output.rb,<br /> lib/tls_map/openssl.rb,<br /> lib/tls_map/version.rb</span>
82+
lib/tls_map/cli.rb,<br /> lib/tls_map/nss.rb,<br /> lib/tls_map/iana.rb,<br /> lib/tls_map/utils.rb,<br /> lib/tls_map/gnutls.rb,<br /> lib/tls_map/output.rb,<br /> lib/tls_map/openssl.rb,<br /> lib/tls_map/version.rb,<br /> lib/tls_map/ciphersuiteinfo.rb</span>
8383
</dd>
8484
</dl>
8585

@@ -100,6 +100,8 @@ <h2>Overview</h2><div class="docstring">
100100
<p class="children">
101101

102102

103+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="TLSmap/Utils.html" title="TLSmap::Utils (module)">Utils</a></span>
104+
103105

104106

105107
<strong class="classes">Classes:</strong> <span class='object_link'><a href="TLSmap/App.html" title="TLSmap::App (class)">App</a></span>, <span class='object_link'><a href="TLSmap/CLI.html" title="TLSmap::CLI (class)">CLI</a></span>
@@ -118,7 +120,7 @@ <h2>
118120
<dt id="VERSION-constant" class="">VERSION =
119121

120122
</dt>
121-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1.0.0</span><span class='tstring_end'>&#39;</span></span></pre></dd>
123+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1.1.0</span><span class='tstring_end'>&#39;</span></span></pre></dd>
122124

123125
</dl>
124126

@@ -134,7 +136,7 @@ <h2>
134136
</div>
135137

136138
<div id="footer">
137-
Generated on Fri Apr 30 11:43:10 2021 by
139+
Generated on Tue May 25 15:50:21 2021 by
138140
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
139141
0.9.26 (ruby-3.0.1).
140142
</div>

docs/yard/TLSmap/App.html

+44-9
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@
8787

8888

8989

90+
<dl>
91+
<dt>Includes:</dt>
92+
<dd><span class='object_link'><a href="Utils.html" title="TLSmap::Utils (module)">Utils</a></span></dd>
93+
</dl>
94+
9095

9196

9297

@@ -95,7 +100,7 @@
95100
<dl>
96101
<dt>Defined in:</dt>
97102
<dd>lib/tls_map.rb<span class="defines">,<br />
98-
lib/tls_map/nss.rb,<br /> lib/tls_map/iana.rb,<br /> lib/tls_map/utils.rb,<br /> lib/tls_map/gnutls.rb,<br /> lib/tls_map/output.rb,<br /> lib/tls_map/openssl.rb</span>
103+
lib/tls_map/nss.rb,<br /> lib/tls_map/iana.rb,<br /> lib/tls_map/utils.rb,<br /> lib/tls_map/gnutls.rb,<br /> lib/tls_map/output.rb,<br /> lib/tls_map/openssl.rb,<br /> lib/tls_map/ciphersuiteinfo.rb</span>
99104
</dd>
100105
</dl>
101106

@@ -116,6 +121,16 @@ <h2>Overview</h2><div class="docstring">
116121
<h2>Direct Known Subclasses</h2>
117122
<p class="children"><span class='object_link'><a href="CLI.html" title="TLSmap::CLI (class)">CLI</a></span></p>
118123
</div>
124+
<h2>Defined Under Namespace</h2>
125+
<p class="children">
126+
127+
128+
129+
130+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="App/Extended.html" title="TLSmap::App::Extended (class)">Extended</a></span>
131+
132+
133+
</p>
119134

120135

121136
<h2>
@@ -156,6 +171,11 @@ <h2>
156171
</dt>
157172
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://raw.githubusercontent.com/openssl/openssl/master/include/openssl/tls1.h</span><span class='tstring_end'>&#39;</span></span></pre></dd>
158173

174+
<dt id="OPENSSL_URL2-constant" class="">OPENSSL_URL2 =
175+
176+
</dt>
177+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://raw.githubusercontent.com/openssl/openssl/master/include/openssl/ssl3.h</span><span class='tstring_end'>&#39;</span></span></pre></dd>
178+
159179
</dl>
160180

161181

@@ -250,6 +270,17 @@ <h2>
250270
</ul>
251271

252272

273+
274+
275+
276+
277+
278+
279+
280+
281+
282+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Utils.html" title="TLSmap::Utils (module)">Utils</a></span></h3>
283+
<p class="inherited"><span class='object_link'><a href="Utils.html#tmpfile-instance_method" title="TLSmap::Utils#tmpfile (method)">#tmpfile</a></span></p>
253284
<div id="constructor_details" class="method_details_list">
254285
<h2>Constructor Details</h2>
255286

@@ -279,22 +310,24 @@ <h3 class="signature first" id="initialize-instance_method">
279310
<pre class="lines">
280311

281312

282-
19
283313
20
284314
21
285315
22
286316
23
287317
24
288318
25
289319
26
290-
27</pre>
320+
27
321+
28
322+
29</pre>
291323
</td>
292324
<td>
293-
<pre class="code"><span class="info file"># File 'lib/tls_map.rb', line 19</span>
325+
<pre class="code"><span class="info file"># File 'lib/tls_map.rb', line 20</span>
294326

295327
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
296328
<span class='ivar'>@iana_file</span> <span class='op'>=</span> <span class='id identifier rubyid_tmpfile'>tmpfile</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>iana</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#IANA_URL-constant" title="TLSmap::App::IANA_URL (constant)">IANA_URL</a></span></span><span class='rparen'>)</span>
297329
<span class='ivar'>@openssl_file</span> <span class='op'>=</span> <span class='id identifier rubyid_tmpfile'>tmpfile</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>openssl</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#OPENSSL_URL-constant" title="TLSmap::App::OPENSSL_URL (constant)">OPENSSL_URL</a></span></span><span class='rparen'>)</span>
330+
<span class='ivar'>@openssl_file2</span> <span class='op'>=</span> <span class='id identifier rubyid_tmpfile'>tmpfile</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>openssl</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#OPENSSL_URL2-constant" title="TLSmap::App::OPENSSL_URL2 (constant)">OPENSSL_URL2</a></span></span><span class='rparen'>)</span>
298331
<span class='ivar'>@gnutls_file</span> <span class='op'>=</span> <span class='id identifier rubyid_tmpfile'>tmpfile</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>gnutls</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#GNUTLS_URL-constant" title="TLSmap::App::GNUTLS_URL (constant)">GNUTLS_URL</a></span></span><span class='rparen'>)</span>
299332
<span class='ivar'>@nss_file</span> <span class='op'>=</span> <span class='id identifier rubyid_tmpfile'>tmpfile</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>nss</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#NSS_URL-constant" title="TLSmap::App::NSS_URL (constant)">NSS_URL</a></span></span><span class='rparen'>)</span>
300333

@@ -500,21 +533,23 @@ <h3 class="signature " id="search-instance_method">
500533
<pre class="lines">
501534

502535

503-
44
504-
45
505536
46
506537
47
507538
48
508539
49
509540
50
510541
51
511-
52</pre>
542+
52
543+
53
544+
54
545+
55</pre>
512546
</td>
513547
<td>
514-
<pre class="code"><span class="info file"># File 'lib/tls_map.rb', line 44</span>
548+
<pre class="code"><span class="info file"># File 'lib/tls_map.rb', line 46</span>
515549

516550
<span class='kw'>def</span> <span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_critera'>critera</span><span class='comma'>,</span> <span class='id identifier rubyid_term'>term</span><span class='comma'>,</span> <span class='id identifier rubyid_output'>output</span> <span class='op'>=</span> <span class='symbol'>:all</span><span class='rparen'>)</span>
517551
<span class='ivar'>@tls_map</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_alg'>alg</span><span class='op'>|</span>
552+
<span class='id identifier rubyid_term'>term</span> <span class='op'>=</span> <span class='id identifier rubyid_term'>term</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span> <span class='kw'>if</span> <span class='id identifier rubyid_critera'>critera</span> <span class='op'>==</span> <span class='symbol'>:codepoint</span>
518553
<span class='kw'>next</span> <span class='kw'>unless</span> <span class='id identifier rubyid_alg'>alg</span><span class='lbracket'>[</span><span class='id identifier rubyid_critera'>critera</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='id identifier rubyid_term'>term</span>
519554
<span class='kw'>return</span> <span class='id identifier rubyid_alg'>alg</span> <span class='kw'>if</span> <span class='id identifier rubyid_output'>output</span> <span class='op'>==</span> <span class='symbol'>:all</span>
520555

@@ -532,7 +567,7 @@ <h3 class="signature " id="search-instance_method">
532567
</div>
533568

534569
<div id="footer">
535-
Generated on Fri Apr 30 11:43:10 2021 by
570+
Generated on Tue May 25 15:50:21 2021 by
536571
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
537572
0.9.26 (ruby-3.0.1).
538573
</div>

0 commit comments

Comments
 (0)