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

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
noraj committed May 25, 2021
1 parent 0fe3a07 commit e61627e
Show file tree
Hide file tree
Showing 20 changed files with 1,216 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
tls-map (1.0.0)
tls-map (1.1.0)
docopt (~> 0.6)
paint (~> 2.2)

Expand Down
27 changes: 26 additions & 1 deletion bin/tls-map
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ doc = <<~DOCOPT
TLS map
Usage:
tls-map search <critera> <term> [-o <output> --force] [--no-color --debug]
tls-map search <critera> <term> [-o <output> --force -e -a] [--no-color --debug]
tls-map export <filename> <format> [--force] [--debug]
tls-map update [--debug]
tls-map -h | --help
Expand All @@ -24,6 +24,8 @@ doc = <<~DOCOPT
<critera> The type of term. Accepted values: codepoint, iana, openssl, gnutls, nss.
<term> The cipher algorithm name.
-o, --output <output> Displayed fields. Accepted values: all, codepoint, iana, openssl, gnutls, nss. [default: all]
-e, --extended (Online) Display additional information about the cipher (requires output = all or iana)
-a, --acronym (Online) Display full acronym name (requires -e / --extended option)
Export options: (offline)
<filename> The output file name to write to.
Expand All @@ -50,6 +52,29 @@ begin
res.each do |k, v|
puts "#{Paint[k, :green]}: #{Paint[v, :white]}"
end
if args['--extended']
tmext = TLSmap::App::Extended
tmext_i = tmext.new
ext = tmext_i.extend(res[:iana])
dic = tmext::DICO
sev = tmext::VULN_SEVERITY
ext.each do |k, v|
case k
when 'vulns'
puts "#{Paint[dic[k], :magenta]}:"
v.each do |vuln|
print " - #{Paint[sev[vuln[:severity]][:title], sev[vuln[:severity]][:color]]} - "
puts Paint[vuln[:description], :white]
end
when 'tls_version'
puts "#{Paint[dic[k], :magenta]}: #{Paint[v.join(', '), :white]}"
else
print "#{Paint[dic[k], :magenta]}: #{Paint[v, :white]}"
print " (#{tmext_i.translate_acronym(v)})" if args['--acronym'] && !tmext_i.translate_acronym(v).nil? # rubocop:disable Metrics/BlockNesting
puts
end
end
end
elsif args['export']
cli = TLSmap::CLI.new(args['--force'])
cli.export(args['<filename>'], args['<format>'].to_sym)
Expand Down
15 changes: 12 additions & 3 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@

## [1.1.0]

Additions:

- New `TLSmap::App::Extended` class: partial wrapper around ciphersuite.info API to get extra info about a cipher
- New `--extended` and `-acronym` CLI option for the `search` command using the new class

Changes:

- Move `tmpfile()` to a `Utils` module (no breaking changes)

Fix:

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

Documentation:

Expand Down
8 changes: 5 additions & 3 deletions docs/yard/TLSmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<dl>
<dt>Defined in:</dt>
<dd>lib/tls_map.rb<span class="defines">,<br />
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>
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>
</dd>
</dl>

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


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



<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>
Expand All @@ -118,7 +120,7 @@ <h2>
<dt id="VERSION-constant" class="">VERSION =

</dt>
<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>
<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>

</dl>

Expand All @@ -134,7 +136,7 @@ <h2>
</div>

<div id="footer">
Generated on Fri Apr 30 11:43:10 2021 by
Generated on Tue May 25 15:50:21 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-3.0.1).
</div>
Expand Down
53 changes: 44 additions & 9 deletions docs/yard/TLSmap/App.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@



<dl>
<dt>Includes:</dt>
<dd><span class='object_link'><a href="Utils.html" title="TLSmap::Utils (module)">Utils</a></span></dd>
</dl>




Expand All @@ -95,7 +100,7 @@
<dl>
<dt>Defined in:</dt>
<dd>lib/tls_map.rb<span class="defines">,<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</span>
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>
</dd>
</dl>

Expand All @@ -116,6 +121,16 @@ <h2>Overview</h2><div class="docstring">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="CLI.html" title="TLSmap::CLI (class)">CLI</a></span></p>
</div>
<h2>Defined Under Namespace</h2>
<p class="children">




<strong class="classes">Classes:</strong> <span class='object_link'><a href="App/Extended.html" title="TLSmap::App::Extended (class)">Extended</a></span>


</p>


<h2>
Expand Down Expand Up @@ -156,6 +171,11 @@ <h2>
</dt>
<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>

<dt id="OPENSSL_URL2-constant" class="">OPENSSL_URL2 =

</dt>
<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>

</dl>


Expand Down Expand Up @@ -250,6 +270,17 @@ <h2>
</ul>











<h3 class="inherited">Methods included from <span class='object_link'><a href="Utils.html" title="TLSmap::Utils (module)">Utils</a></span></h3>
<p class="inherited"><span class='object_link'><a href="Utils.html#tmpfile-instance_method" title="TLSmap::Utils#tmpfile (method)">#tmpfile</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>

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


19
20
21
22
23
24
25
26
27</pre>
27
28
29</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/tls_map.rb', line 19</span>
<pre class="code"><span class="info file"># File 'lib/tls_map.rb', line 20</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
<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>
<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>
<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>
<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>
<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>

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


44
45
46
47
48
49
50
51
52</pre>
52
53
54
55</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/tls_map.rb', line 44</span>
<pre class="code"><span class="info file"># File 'lib/tls_map.rb', line 46</span>

<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>
<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>
<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>
<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>
<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>

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

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

0 comments on commit e61627e

Please sign in to comment.