diff --git a/Gemfile.lock b/Gemfile.lock index 3c5b062..d60d4b1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - tls-map (1.0.0) + tls-map (1.1.0) docopt (~> 0.6) paint (~> 2.2) diff --git a/bin/tls-map b/bin/tls-map index c2913d2..a3bcf19 100755 --- a/bin/tls-map +++ b/bin/tls-map @@ -14,7 +14,7 @@ doc = <<~DOCOPT TLS map Usage: - tls-map search [-o --force] [--no-color --debug] + tls-map search [-o --force -e -a] [--no-color --debug] tls-map export [--force] [--debug] tls-map update [--debug] tls-map -h | --help @@ -24,6 +24,8 @@ doc = <<~DOCOPT The type of term. Accepted values: codepoint, iana, openssl, gnutls, nss. The cipher algorithm name. -o, --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) The output file name to write to. @@ -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[''], args[''].to_sym) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index fcae04f..d077398 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -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: diff --git a/docs/yard/TLSmap.html b/docs/yard/TLSmap.html index 90c921f..f39bc89 100644 --- a/docs/yard/TLSmap.html +++ b/docs/yard/TLSmap.html @@ -79,7 +79,7 @@
Defined in:
lib/tls_map.rb,
- lib/tls_map/cli.rb,
lib/tls_map/nss.rb,
lib/tls_map/iana.rb,
lib/tls_map/utils.rb,
lib/tls_map/gnutls.rb,
lib/tls_map/output.rb,
lib/tls_map/openssl.rb,
lib/tls_map/version.rb
+ lib/tls_map/cli.rb,
lib/tls_map/nss.rb,
lib/tls_map/iana.rb,
lib/tls_map/utils.rb,
lib/tls_map/gnutls.rb,
lib/tls_map/output.rb,
lib/tls_map/openssl.rb,
lib/tls_map/version.rb,
lib/tls_map/ciphersuiteinfo.rb
@@ -100,6 +100,8 @@

Overview

+ Modules: Utils + Classes: App, CLI @@ -118,7 +120,7 @@

VERSION =
-
'1.0.0'
+
'1.1.0'
@@ -134,7 +136,7 @@

diff --git a/docs/yard/TLSmap/App.html b/docs/yard/TLSmap/App.html index 5eaf30b..b73fbce 100644 --- a/docs/yard/TLSmap/App.html +++ b/docs/yard/TLSmap/App.html @@ -87,6 +87,11 @@ +
+
Includes:
+
Utils
+
+ @@ -95,7 +100,7 @@
Defined in:
lib/tls_map.rb,
- lib/tls_map/nss.rb,
lib/tls_map/iana.rb,
lib/tls_map/utils.rb,
lib/tls_map/gnutls.rb,
lib/tls_map/output.rb,
lib/tls_map/openssl.rb
+ lib/tls_map/nss.rb,
lib/tls_map/iana.rb,
lib/tls_map/utils.rb,
lib/tls_map/gnutls.rb,
lib/tls_map/output.rb,
lib/tls_map/openssl.rb,
lib/tls_map/ciphersuiteinfo.rb
@@ -116,6 +121,16 @@

Overview

Direct Known Subclasses

CLI

+

Defined Under Namespace

+

+ + + + + Classes: Extended + + +

@@ -156,6 +171,11 @@

'https://raw.githubusercontent.com/openssl/openssl/master/include/openssl/tls1.h'
+
OPENSSL_URL2 = + +
+
'https://raw.githubusercontent.com/openssl/openssl/master/include/openssl/ssl3.h'
+ @@ -250,6 +270,17 @@

+ + + + + + + + + +

Methods included from Utils

+

#tmpfile

Constructor Details

@@ -279,7 +310,6 @@

 
 
-19
 20
 21
 22
@@ -287,14 +317,17 @@ 

24 25 26 -27

+27 +28 +29 -
# File 'lib/tls_map.rb', line 19
+      
# File 'lib/tls_map.rb', line 20
 
 def initialize
   @iana_file = tmpfile('iana', IANA_URL)
   @openssl_file = tmpfile('openssl', OPENSSL_URL)
+  @openssl_file2 = tmpfile('openssl', OPENSSL_URL2)
   @gnutls_file = tmpfile('gnutls', GNUTLS_URL)
   @nss_file = tmpfile('nss', NSS_URL)
 
@@ -500,21 +533,23 @@ 

 
 
-44
-45
 46
 47
 48
 49
 50
 51
-52
+52 +53 +54 +55

-
# File 'lib/tls_map.rb', line 44
+      
# File 'lib/tls_map.rb', line 46
 
 def search(critera, term, output = :all)
   @tls_map.each do |alg|
+    term = term.upcase if critera == :codepoint
     next unless alg[critera] == term
     return alg if output == :all
 
@@ -532,7 +567,7 @@ 

diff --git a/docs/yard/TLSmap/App/Extended.html b/docs/yard/TLSmap/App/Extended.html new file mode 100644 index 0000000..bb2c7bc --- /dev/null +++ b/docs/yard/TLSmap/App/Extended.html @@ -0,0 +1,710 @@ + + + + + + + Class: TLSmap::App::Extended + + — Documentation by YARD 0.9.26 + + + + + + + + + + + + + + + + + + + +
+ + +

Class: TLSmap::App::Extended + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Utils
+
+ + + + + + +
+
Defined in:
+
lib/tls_map/ciphersuiteinfo.rb
+
+ +
+ +

Overview

+
+ +

Partial wrapper around ciphersuite.info API to get extra info about a cipher Documentation:

+ +
- https://ciphersuite.info/blog/2019/04/05/how-to-use-our-api/
+- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md
+- https://ciphersuite.info/api/
+- https://github.com/hcrudolph/ciphersuite.info
+
+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
ROOT = +
+
+ +

Root URL of Cipher Suite Info

+ + +
+
+
+ + +
+
+
'https://ciphersuite.info/'
+ +
API_ROOT = +
+
+ +

Root URL of Cipher Suite Info API

+ + +
+
+
+ + +
+
+
"#{ROOT}api/"
+ +
VULN_DATA = +
+
+ +

URL of the data file containig vulnerabilities information

+ + +
+
+
+ + +
+
+
'https://raw.githubusercontent.com/hcrudolph/ciphersuite.info/master/directory/fixtures/00_vulnerabilities.yaml'
+ +
TECH_DATA = +
+
+ +

URL of the data file containig technologies information

+ + +
+
+
+ + +
+
+
'https://raw.githubusercontent.com/hcrudolph/ciphersuite.info/master/directory/fixtures/01_technologies.yaml'
+ +
DICO = +
+
+ +

Hash mapping API key and display name for CLI

+ + +
+
+
+ + +
+
+
{
+  'tls_version' => 'TLS Version(s)',
+  'protocol_version' => 'Protocol',
+  'kex_algorithm' => 'Key Exchange',
+  'auth_algorithm' => 'Authentication',
+  'enc_algorithm' => 'Encryption',
+  'hash_algorithm' => 'Hash',
+  'security' => 'Security',
+  'url' => 'More info',
+  'vulns' => 'Vulnerabilities'
+}.freeze
+ +
VULN_SEVERITY = +
+
+ +

Hash mapping the severity number used by the API and the severity text and color for the CLI

+ + +
+
+
+ + +
+
+
{
+  0 => { title: 'Low', color: :yellow },
+  1 => { title: 'Medium', color: 'orange' },
+  2 => { title: 'High', color: :red }
+}.freeze
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Utils

+

#tmpfile

+
+

Constructor Details

+ +
+

+ + #initializeExtended + + + + + +

+
+ +

Will automatically fetch source files and parse them.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+50
+51
+52
+53
+54
+55
+
+
# File 'lib/tls_map/ciphersuiteinfo.rb', line 50
+
+def initialize
+  @tech_file = tmpfile('tech', TECH_DATA)
+  @vuln_file = tmpfile('vuln', VULN_DATA)
+  @tech = parse_tech
+  @vuln = parse_vuln
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #extend(iana_name) ⇒ Hash + + + + + +

+
+ +

Retrieve advanced about a cipher on Cipher Suite Info API and enhanced it

+ + +
+
+
+

Parameters:

+
    + +
  • + + iana_name + + + (String) + + + + — +
    +

    IANA cipher name

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +
    +

    Hash containing advanced information. The keys are the same as DICO. All valeus are string except vulns which is an array of hashes containing two keys: :severity (integer) and :description (string). Each hash in vulns correspond to a vulnerability.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+
+
# File 'lib/tls_map/ciphersuiteinfo.rb', line 62
+
+def extend(iana_name) # rubocop:disable Metrics/MethodLength
+  obj = Net::HTTP.get(URI("#{API_ROOT}cs/#{iana_name}/"))
+  out = JSON.parse(obj)[iana_name]
+  out.store('vulns', [])
+  %w[openssl_name gnutls_name hex_byte_1 hex_byte_2].each do |key|
+    out.delete(key)
+  end
+  out.each_value do |v|
+    out['vulns'].push(find_vuln(v)) if @tech.keys.include?(v)
+  end
+  out['vulns'].flatten!
+  out['vulns'].uniq!
+  out.store('url', "#{ROOT}cs/#{iana_name}/") # Add upstream URL
+  out
+end
+
+
+ +
+

+ + #find_vuln(tech) ⇒ Array<Hash> + + + + + +

+
+ +

Find vulnerabilities related to a technology

+ + +
+
+
+

Parameters:

+
    + +
  • + + tech + + + (String) + + + + — +
    +

    The technology acronym, eg. CBC

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<Hash>) + + + + — +
    +

    Array of vulnerabilities as described for #extend return value in the vulns key.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+112
+113
+114
+115
+116
+
+
# File 'lib/tls_map/ciphersuiteinfo.rb', line 112
+
+def find_vuln(tech)
+  return @tech[tech][:vulnerabilities].map { |vuln| @vuln[vuln] } unless @tech[tech][:vulnerabilities].nil?
+
+  nil
+end
+
+
+ +
+

+ + #translate_acronym(term) ⇒ String + + + + + +

+
+ +

Translate cipher related acronyms

+ + +
+
+
+

Parameters:

+
    + +
  • + + term + + + (String) + + + + — +
    +

    Acronym, eg. DSS

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    The long name of the acronym, eg. Digital Signature Standard or nil if it's not found

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+103
+104
+105
+106
+107
+
+
# File 'lib/tls_map/ciphersuiteinfo.rb', line 103
+
+def translate_acronym(term)
+  return @tech[term][:long_name] unless @tech[term].nil?
+
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/yard/TLSmap/CLI.html b/docs/yard/TLSmap/CLI.html index 7653034..4ec1281 100644 --- a/docs/yard/TLSmap/CLI.html +++ b/docs/yard/TLSmap/CLI.html @@ -135,7 +135,7 @@

-
'9a45b44ce6b3347a7de4a34a54d4d4732b7e72a131c02bc6aa2ac2559cea6650'
+
'42e44f89550365da2bc8d33d87f88b65d85d6474e90f9edb65e0ea6c78f61a53'
@@ -146,7 +146,7 @@

Constants inherited from App

-

App::GNUTLS_URL, App::IANA_URL, App::NSS_URL, App::OPENSSL_URL

+

App::GNUTLS_URL, App::IANA_URL, App::NSS_URL, App::OPENSSL_URL, App::OPENSSL_URL2

@@ -222,6 +222,17 @@

Methods inherited from App

#export, #search

+ + + + + + + + + +

Methods included from Utils

+

#tmpfile

Constructor Details

@@ -342,7 +353,7 @@

diff --git a/docs/yard/TLSmap/Utils.html b/docs/yard/TLSmap/Utils.html new file mode 100644 index 0000000..421146d --- /dev/null +++ b/docs/yard/TLSmap/Utils.html @@ -0,0 +1,196 @@ + + + + + + + Module: TLSmap::Utils + + — Documentation by YARD 0.9.26 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: TLSmap::Utils + + + +

+
+ + + + + + + + + +
+
Included in:
+
App, App::Extended
+
+ + + +
+
Defined in:
+
lib/tls_map/utils.rb
+
+ +
+ +

Overview

+
+ +

Generic utilities

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #tmpfile(name, url) ⇒ Object + + + + + +

+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+
+
# File 'lib/tls_map/utils.rb', line 11
+
+def tmpfile(name, url)
+  tmp = Tempfile.new(name)
+  tmp.write(Net::HTTP.get(URI(url)))
+  tmp.close
+  tmp
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/docs/yard/_index.html b/docs/yard/_index.html index 310ce5d..48f65fc 100644 --- a/docs/yard/_index.html +++ b/docs/yard/_index.html @@ -109,6 +109,21 @@

Namespace Listing A-Z

+
    +
  • E
  • +
      + +
    • + Extended + + (TLSmap::App) + +
    • + +
    +
+ +
  • T
    • @@ -121,6 +136,21 @@

      Namespace Listing A-Z

+ +
    +
  • U
  • +
      + +
    • + Utils + + (TLSmap) + +
    • + +
    +
+ @@ -130,7 +160,7 @@

Namespace Listing A-Z

diff --git a/docs/yard/class_list.html b/docs/yard/class_list.html index 7bc9aa3..22a2515 100644 --- a/docs/yard/class_list.html +++ b/docs/yard/class_list.html @@ -43,7 +43,7 @@

Class List

diff --git a/docs/yard/file.LICENSE.html b/docs/yard/file.LICENSE.html index 7e3c318..c23b45e 100644 --- a/docs/yard/file.LICENSE.html +++ b/docs/yard/file.LICENSE.html @@ -70,7 +70,7 @@ diff --git a/docs/yard/file.README.html b/docs/yard/file.README.html index 092cb93..de7a05f 100644 --- a/docs/yard/file.README.html +++ b/docs/yard/file.README.html @@ -95,7 +95,7 @@

Installation

$ gem install tls-map
 
-

Check the installation page on the documentation to discover more methods.

+

Check the installation page on the documentation to discover more methods.

Documentation

@@ -107,7 +107,7 @@

Author

diff --git a/docs/yard/index.html b/docs/yard/index.html index 520fdea..4afcd30 100644 --- a/docs/yard/index.html +++ b/docs/yard/index.html @@ -95,7 +95,7 @@

Installation

$ gem install tls-map
 
-

Check the installation page on the documentation to discover more methods.

+

Check the installation page on the documentation to discover more methods.

Documentation

@@ -107,7 +107,7 @@

Author

diff --git a/docs/yard/method_list.html b/docs/yard/method_list.html index 51d1366..ad193cf 100644 --- a/docs/yard/method_list.html +++ b/docs/yard/method_list.html @@ -52,6 +52,22 @@

Method List

+
  • +
    + #extend + TLSmap::App::Extended +
    +
  • + + +
  • +
    + #find_vuln + TLSmap::App::Extended +
    +
  • + +
  • #initialize @@ -69,6 +85,14 @@

    Method List

  • +
    + #initialize + TLSmap::App::Extended +
    +
  • + + +
  • #search TLSmap::App @@ -76,7 +100,23 @@

    Method List

  • +
  • +
    + #tmpfile + TLSmap::Utils +
    +
  • + +
  • +
    + #translate_acronym + TLSmap::App::Extended +
    +
  • + + +
  • #update TLSmap::CLI diff --git a/docs/yard/top-level-namespace.html b/docs/yard/top-level-namespace.html index 4e52bdf..7eb01d5 100644 --- a/docs/yard/top-level-namespace.html +++ b/docs/yard/top-level-namespace.html @@ -100,7 +100,7 @@

    Defined Under Namespace

    diff --git a/lib/tls_map.rb b/lib/tls_map.rb index 4708627..f83c83f 100644 --- a/lib/tls_map.rb +++ b/lib/tls_map.rb @@ -10,6 +10,7 @@ require 'tls_map/gnutls' require 'tls_map/nss' require 'tls_map/output' +require 'tls_map/ciphersuiteinfo' # TLS map module module TLSmap diff --git a/lib/tls_map/ciphersuiteinfo.rb b/lib/tls_map/ciphersuiteinfo.rb new file mode 100644 index 0000000..4f12b23 --- /dev/null +++ b/lib/tls_map/ciphersuiteinfo.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Ruby internal +require 'net/http' +require 'json' +require 'yaml' +# Project internal + +# TLS map module +module TLSmap + class App + # Partial wrapper around ciphersuite.info API to get extra info about a cipher + # Documentation: + # - https://ciphersuite.info/blog/2019/04/05/how-to-use-our-api/ + # - https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md + # - https://ciphersuite.info/api/ + # - https://github.com/hcrudolph/ciphersuite.info + class Extended + # Root URL of Cipher Suite Info + ROOT = 'https://ciphersuite.info/' + # Root URL of Cipher Suite Info API + API_ROOT = "#{ROOT}api/" + # URL of the data file containig vulnerabilities information + VULN_DATA = 'https://raw.githubusercontent.com/hcrudolph/ciphersuite.info/master/directory/fixtures/00_vulnerabilities.yaml' + # URL of the data file containig technologies information + TECH_DATA = 'https://raw.githubusercontent.com/hcrudolph/ciphersuite.info/master/directory/fixtures/01_technologies.yaml' + # Hash mapping API key and display name for CLI + DICO = { + 'tls_version' => 'TLS Version(s)', + 'protocol_version' => 'Protocol', + 'kex_algorithm' => 'Key Exchange', + 'auth_algorithm' => 'Authentication', + 'enc_algorithm' => 'Encryption', + 'hash_algorithm' => 'Hash', + 'security' => 'Security', + 'url' => 'More info', + 'vulns' => 'Vulnerabilities' + }.freeze + # Hash mapping the severity number used by the API and the severity text and color for the CLI + VULN_SEVERITY = { + 0 => { title: 'Low', color: :yellow }, + 1 => { title: 'Medium', color: 'orange' }, + 2 => { title: 'High', color: :red } + }.freeze + + include Utils + protected :tmpfile + + # Will automatically fetch source files and parse them. + def initialize + @tech_file = tmpfile('tech', TECH_DATA) + @vuln_file = tmpfile('vuln', VULN_DATA) + @tech = parse_tech + @vuln = parse_vuln + end + + # Retrieve advanced about a cipher on Cipher Suite Info API and enhanced it + # @param iana_name [String] IANA cipher name + # @return [Hash] Hash containing advanced information. The keys are the same as {DICO}. All valeus are string + # except +vulns+ which is an array of hashes containing two keys: +:severity+ (integer) and +:description+ + # (string). Each hash in +vulns+ correspond to a vulnerability. + def extend(iana_name) # rubocop:disable Metrics/MethodLength + obj = Net::HTTP.get(URI("#{API_ROOT}cs/#{iana_name}/")) + out = JSON.parse(obj)[iana_name] + out.store('vulns', []) + %w[openssl_name gnutls_name hex_byte_1 hex_byte_2].each do |key| + out.delete(key) + end + out.each_value do |v| + out['vulns'].push(find_vuln(v)) if @tech.keys.include?(v) + end + out['vulns'].flatten! + out['vulns'].uniq! + out.store('url', "#{ROOT}cs/#{iana_name}/") # Add upstream URL + out + end + + # Extract data from the YAML file ({TECH_DATA}) to craft a simplified Ruby hash + def parse_tech + data = Psych.load_file(@tech_file) + out = {} + data.each do |item| + out.store(item['pk'], { long_name: item['fields']['long_name'], + vulnerabilities: item['fields']['vulnerabilities'] }) + end + out + end + + # Extract data from the YAML file ({VULN_DATA}) to craft a simplified Ruby hash + def parse_vuln + data = Psych.load_file(@vuln_file) + out = {} + data.each do |item| + out.store(item['pk'], { severity: item['fields']['severity'], + description: item['fields']['description'] }) + end + out + end + + # Translate cipher related acronyms + # @param term [String] Acronym, eg. DSS + # @return [String] The long name of the acronym, eg. Digital Signature Standard or +nil+ if it's not found + def translate_acronym(term) + return @tech[term][:long_name] unless @tech[term].nil? + + nil + end + + # Find vulnerabilities related to a technology + # @param tech [String] The technology acronym, eg. CBC + # @return [Array] Array of vulnerabilities as described for {extend} return value in the +vulns+ key. + def find_vuln(tech) + return @tech[tech][:vulnerabilities].map { |vuln| @vuln[vuln] } unless @tech[tech][:vulnerabilities].nil? + + nil + end + + protected :parse_tech, :parse_vuln + end + end +end diff --git a/lib/tls_map/openssl.rb b/lib/tls_map/openssl.rb index 7e62482..9f45cda 100644 --- a/lib/tls_map/openssl.rb +++ b/lib/tls_map/openssl.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -# Ruby internal - # TLS map module module TLSmap # TLS mapping diff --git a/lib/tls_map/utils.rb b/lib/tls_map/utils.rb index 6297c23..d01264c 100644 --- a/lib/tls_map/utils.rb +++ b/lib/tls_map/utils.rb @@ -6,14 +6,19 @@ # TLS map module module TLSmap - # TLS mapping - class App + # Generic utilities + module Utils def tmpfile(name, url) tmp = Tempfile.new(name) tmp.write(Net::HTTP.get(URI(url))) + tmp.close tmp end + end + # TLS mapping + class App + include Utils protected :tmpfile end end diff --git a/lib/tls_map/version.rb b/lib/tls_map/version.rb index d5d6806..0381307 100644 --- a/lib/tls_map/version.rb +++ b/lib/tls_map/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module TLSmap - VERSION = '1.0.0' + VERSION = '1.1.0' end