tls-map 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tls_map.rb +5 -5
- data/lib/tls_map/ciphersuiteinfo.rb +2 -5
- data/lib/tls_map/extractor.rb +3 -3
- data/lib/tls_map/utils.rb +11 -6
- data/lib/tls_map/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96e73fb397b1d13049c3da41be80eb8187846bebb2c49bb307e99a825e1bb9ab
|
4
|
+
data.tar.gz: 4798e654bc27a9c5ef01722cc81ebdf5113119e8d46bc7434256ecd7974547ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0675008a588def8477d32a3afef6c88dafd4bff9dccaf0885ec012259524e436014abf88aea0da881e1794f7e6be6b3290737aba0d07cd78df25254009d38cbb'
|
7
|
+
data.tar.gz: 3c4c8fc5710d153f43f5c82e9b7f44f8e047e0b23ec82f9bd574f933a2759d7f4004abfeb7e7f8c29c3d0bd8237690b9e32a9547848c1e8c327db4e3303652d8
|
data/lib/tls_map.rb
CHANGED
@@ -19,11 +19,11 @@ module TLSmap
|
|
19
19
|
class App
|
20
20
|
# Will automatically fetch source files and parse them.
|
21
21
|
def initialize
|
22
|
-
@iana_file = tmpfile('iana', IANA_URL)
|
23
|
-
@openssl_file = tmpfile('openssl', OPENSSL_URL)
|
24
|
-
@openssl_file2 = tmpfile('openssl', OPENSSL_URL2)
|
25
|
-
@gnutls_file = tmpfile('gnutls', GNUTLS_URL)
|
26
|
-
@nss_file = tmpfile('nss', NSS_URL)
|
22
|
+
@iana_file = Utils.tmpfile('iana', IANA_URL)
|
23
|
+
@openssl_file = Utils.tmpfile('openssl', OPENSSL_URL)
|
24
|
+
@openssl_file2 = Utils.tmpfile('openssl', OPENSSL_URL2)
|
25
|
+
@gnutls_file = Utils.tmpfile('gnutls', GNUTLS_URL)
|
26
|
+
@nss_file = Utils.tmpfile('nss', NSS_URL)
|
27
27
|
|
28
28
|
@tls_map = []
|
29
29
|
parse
|
@@ -45,13 +45,10 @@ module TLSmap
|
|
45
45
|
2 => { title: 'High', color: :red }
|
46
46
|
}.freeze
|
47
47
|
|
48
|
-
include Utils
|
49
|
-
protected :tmpfile
|
50
|
-
|
51
48
|
# Will automatically fetch source files and parse them.
|
52
49
|
def initialize
|
53
|
-
@tech_file = tmpfile('tech', TECH_DATA)
|
54
|
-
@vuln_file = tmpfile('vuln', VULN_DATA)
|
50
|
+
@tech_file = Utils.tmpfile('tech', TECH_DATA)
|
51
|
+
@vuln_file = Utils.tmpfile('vuln', VULN_DATA)
|
55
52
|
@tech = parse_tech
|
56
53
|
@vuln = parse_vuln
|
57
54
|
end
|
data/lib/tls_map/extractor.rb
CHANGED
@@ -97,7 +97,7 @@ module TLSmap
|
|
97
97
|
# See {TLSmap::App::Extractor}
|
98
98
|
# @return [Array<String>] Cipher array (IANA names)
|
99
99
|
def parse(file)
|
100
|
-
data =
|
100
|
+
data = Utils.json_load_file(file)
|
101
101
|
extract_cipher(data)
|
102
102
|
end
|
103
103
|
|
@@ -164,7 +164,7 @@ module TLSmap
|
|
164
164
|
# See {TLSmap::App::Extractor}
|
165
165
|
# @return [Array<String>] Cipher array (IANA names)
|
166
166
|
def parse(file)
|
167
|
-
data =
|
167
|
+
data = Utils.json_load_file(file)
|
168
168
|
extract_cipher(data)
|
169
169
|
end
|
170
170
|
|
@@ -214,7 +214,7 @@ module TLSmap
|
|
214
214
|
# See {TLSmap::App::Extractor}
|
215
215
|
# @return [Array<String>] Cipher array (IANA names)
|
216
216
|
def parse(file)
|
217
|
-
data =
|
217
|
+
data = Utils.json_load_file(file)
|
218
218
|
extract_cipher(data)
|
219
219
|
end
|
220
220
|
|
data/lib/tls_map/utils.rb
CHANGED
@@ -3,22 +3,27 @@
|
|
3
3
|
# Ruby internal
|
4
4
|
require 'net/http'
|
5
5
|
require 'tempfile'
|
6
|
+
require 'json'
|
6
7
|
|
7
8
|
# TLS map module
|
8
9
|
module TLSmap
|
9
10
|
# Generic utilities
|
10
11
|
module Utils
|
11
|
-
def tmpfile(name, url)
|
12
|
+
def self.tmpfile(name, url)
|
12
13
|
tmp = Tempfile.new(name)
|
13
14
|
tmp.write(Net::HTTP.get(URI(url)))
|
14
15
|
tmp.close
|
15
16
|
tmp
|
16
17
|
end
|
17
|
-
end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
# bring JSON.load_file before ruby 3.0.0
|
20
|
+
# https://ruby-doc.org/stdlib-3.0.0/libdoc/json/rdoc/JSON.html#method-i-load_file
|
21
|
+
def self.json_load_file(filespec, opts = {})
|
22
|
+
if RUBY_VERSION < '3.0.0'
|
23
|
+
JSON.parse(File.read(filespec), opts)
|
24
|
+
else
|
25
|
+
JSON.load_file(filespec, opts)
|
26
|
+
end
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
data/lib/tls_map/version.rb
CHANGED