diff --git a/Gemfile.lock b/Gemfile.lock index 8ce7b00..d7b043c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - tls-map (1.3.0) + tls-map (1.3.1) docopt (~> 0.6) paint (~> 2.2) rexml (~> 3.2) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index cbc1218..996f3d8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,10 +2,16 @@ ## [Unreleased] +## [1.3.1] + Fixes: - `JSON.load_file()` is only available since Ruby 3.0 so `Utils.json_load_file()` was created to bring compatibility with Ruby 2.X +Chore: + +- Convert `Utils` methods as module methods instead of instance methods + ## [1.3.0] Additions: diff --git a/docs/yard/TLSmap.html b/docs/yard/TLSmap.html index c53d5bf..74f3281 100644 --- a/docs/yard/TLSmap.html +++ b/docs/yard/TLSmap.html @@ -119,7 +119,7 @@
'1.2.0'
'1.3.1'
Search for corresponding cipher algorithms in other libraries in bulk.
+# File 'lib/tls_map.rb', line 21 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) + @iana_file = Utils.tmpfile('iana', IANA_URL) + @openssl_file = Utils.tmpfile('openssl', OPENSSL_URL) + @openssl_file2 = Utils.tmpfile('openssl', OPENSSL_URL2) + @gnutls_file = Utils.tmpfile('gnutls', GNUTLS_URL) + @nss_file = Utils.tmpfile('nss', NSS_URL) @tls_map = [] parse @@ -342,7 +349,127 @@Instance Method Details
-+ ++
+ + #bulk_search(critera, file, output = :all) ⇒ Array<Hash> + + + + + +
++++Search for corresponding cipher algorithms in other libraries in bulk
+ + ++
++ ++ ++ + +67 +68 +69 +70 +71 +72 +73++ +# File 'lib/tls_map.rb', line 67 + +def bulk_search(critera, file, output = :all) + res = [] + File.foreach(file) do |line| + res.push(search(critera, line.chomp, output)) + end + res +end++diff --git a/docs/yard/TLSmap/App/Extended.html b/docs/yard/TLSmap/App/Extended.html index c7e355d..6278fbc 100644 --- a/docs/yard/TLSmap/App/Extended.html +++ b/docs/yard/TLSmap/App/Extended.html @@ -87,11 +87,6 @@ -#export(filename, format) ⇒ Object @@ -559,7 +686,7 @@
+49 +50 +51 52 53 -54 -55 -56 -57+54
# File 'lib/tls_map/ciphersuiteinfo.rb', line 52 +# File 'lib/tls_map/ciphersuiteinfo.rb', line 49 def initialize - @tech_file = tmpfile('tech', TECH_DATA) - @vuln_file = tmpfile('vuln', VULN_DATA) + @tech_file = Utils.tmpfile('tech', TECH_DATA) + @vuln_file = Utils.tmpfile('vuln', VULN_DATA) @tech = parse_tech @vuln = parse_vuln end@@ -480,6 +464,9 @@
+61 +62 +63 64 65 66 @@ -491,13 +478,10 @@+7572 73 74 -75 -76 -77 -78
# File 'lib/tls_map/ciphersuiteinfo.rb', line 64 +# File 'lib/tls_map/ciphersuiteinfo.rb', line 61 def extend(iana_name) # rubocop:disable Metrics/MethodLength obj = Net::HTTP.get(URI("#{API_ROOT}cs/#{iana_name}/")) @@ -580,14 +564,14 @@
+111 +112 +113 114 -115 -116 -117 -118+115
# File 'lib/tls_map/ciphersuiteinfo.rb', line 114 +# File 'lib/tls_map/ciphersuiteinfo.rb', line 111 def find_vuln(tech) return @tech[tech][:vulnerabilities].map { |vuln| @vuln[vuln] } unless @tech[tech][:vulnerabilities].nil? @@ -660,14 +644,14 @@
+102 +103 +104 105 -106 -107 -108 -109+106
# File 'lib/tls_map/ciphersuiteinfo.rb', line 105 +# File 'lib/tls_map/ciphersuiteinfo.rb', line 102 def translate_acronym(term) return @tech[term][:long_name] unless @tech[term].nil? @@ -684,7 +668,7 @@diff --git a/docs/yard/TLSmap/App/Extractor.html b/docs/yard/TLSmap/App/Extractor.html index c418e0b..4385281 100644 --- a/docs/yard/TLSmap/App/Extractor.html +++ b/docs/yard/TLSmap/App/Extractor.html @@ -933,7 +933,7 @@
diff --git a/docs/yard/TLSmap/App/Extractor/SsllabsScan.html b/docs/yard/TLSmap/App/Extractor/SsllabsScan.html index 5b5446f..bded997 100644 --- a/docs/yard/TLSmap/App/Extractor/SsllabsScan.html +++ b/docs/yard/TLSmap/App/Extractor/SsllabsScan.html @@ -455,7 +455,7 @@
# File 'lib/tls_map/extractor.rb', line 216 def parse(file) - data = JSON.load_file(file) + data = Utils.json_load_file(file) extract_cipher(data) end
# File 'lib/tls_map/extractor.rb', line 99 def parse(file) - data = JSON.load_file(file) + data = Utils.json_load_file(file) extract_cipher(data) end@@ -357,7 +357,7 @@
# File 'lib/tls_map/extractor.rb', line 166 def parse(file) - data = JSON.load_file(file) + data = Utils.json_load_file(file) extract_cipher(data) end@@ -563,7 +563,7 @@
#bulk_search, #export, #search
bring JSON.load_file before ruby 3.0.0 https://ruby-doc.org/stdlib-3.0.0/libdoc/json/rdoc/JSON.html#method-i-load_file.
+bring JSON.load_file before ruby 3.0.0 +https://ruby-doc.org/stdlib-3.0.0/libdoc/json/rdoc/JSON.html#method-i-load_file
+ + +
+ + + +21 +22 +23 +24 +25 +26 +27+ |
+
+ # File 'lib/tls_map/utils.rb', line 21 + +def self.json_load_file(filespec, opts = {}) + if RUBY_VERSION < '3.0.0' + JSON.parse(File.read(filespec), opts) + else + JSON.load_file(filespec, opts) + end +end+ |
+
-11 12 13 14 15 -16+16 +17
# File 'lib/tls_map/utils.rb', line 11 +# File 'lib/tls_map/utils.rb', line 12 -def tmpfile(name, url) +def self.tmpfile(name, url) tmp = Tempfile.new(name) tmp.write(Net::HTTP.get(URI(url))) tmp.close @@ -185,7 +252,7 @@diff --git a/docs/yard/_index.html b/docs/yard/_index.html index 40a948e..53a3e49 100644 --- a/docs/yard/_index.html +++ b/docs/yard/_index.html @@ -203,7 +203,7 @@
Namespace Listing A-Z
diff --git a/docs/yard/file.LICENSE.html b/docs/yard/file.LICENSE.html index 325f7e8..6958d9c 100644 --- a/docs/yard/file.LICENSE.html +++ b/docs/yard/file.LICENSE.html @@ -81,7 +81,7 @@ diff --git a/docs/yard/file.README.html b/docs/yard/file.README.html index 3669159..a6d6965 100644 --- a/docs/yard/file.README.html +++ b/docs/yard/file.README.html @@ -86,8 +86,14 @@Features
- CLI and library
-- Search feature: hexadecimal codepoint and major TLS libraries cipher algorithm name: IANA, OpenSSL, GnuTLS, NSS
+- Search feature: hexadecimal codepoint and major TLS libraries cipher algorithm name: IANA, OpenSSL, GnuTLS, NSS + +
+
- get extra info about a cipher
+- Export to files: markdown table, expanded JSON, minified JSON, Ruby marshalized hash
+- Extract ciphers from external tools file output (SSLyze, sslscan2, testssl.sh, ssllabs-scan)
+- Bulk search (file with one cipher per line)
Installation
@@ -107,7 +113,7 @@Author
diff --git a/docs/yard/index.html b/docs/yard/index.html index 7e2516d..784c78f 100644 --- a/docs/yard/index.html +++ b/docs/yard/index.html @@ -86,8 +86,14 @@Features
- CLI and library
-- Search feature: hexadecimal codepoint and major TLS libraries cipher algorithm name: IANA, OpenSSL, GnuTLS, NSS
+- Search feature: hexadecimal codepoint and major TLS libraries cipher algorithm name: IANA, OpenSSL, GnuTLS, NSS + +
+
- get extra info about a cipher
+- Export to files: markdown table, expanded JSON, minified JSON, Ruby marshalized hash
+- Extract ciphers from external tools file output (SSLyze, sslscan2, testssl.sh, ssllabs-scan)
+- Bulk search (file with one cipher per line)
Installation
@@ -107,7 +113,7 @@Author
diff --git a/docs/yard/method_list.html b/docs/yard/method_list.html index 8cf3b64..d58e04e 100644 --- a/docs/yard/method_list.html +++ b/docs/yard/method_list.html @@ -45,6 +45,14 @@Method List