openssl-win-root 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openssl/win/root.rb +29 -9
- data/lib/openssl/win/root/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac483ad299cd7d80407dadd741f0d5b4dc1da182
|
4
|
+
data.tar.gz: 14f0180c0db3bacab9edd2b29ddc8523e3a06e71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32b64d4bf2deb9f397f502df473cd3bbb0a1a39eaa9860e7ae97e5029bf9a1bb896226391e03b353ca80985d24c4870cae2437dde2b7af2d1c5264334e264582
|
7
|
+
data.tar.gz: 9a7470233dc75824c757ed32b501879d1821ea957dcf1ba45536d102bdce669838a82c719472d5ebdf50ebc33bbd1fc47f00b76af2b90d5d116e6878415a77bd
|
data/lib/openssl/win/root.rb
CHANGED
@@ -50,17 +50,35 @@ module OpenSSL::Win::Root
|
|
50
50
|
@path = x
|
51
51
|
end
|
52
52
|
|
53
|
+
# Implement c_rehash naming
|
54
|
+
class CRehash
|
55
|
+
def unique id
|
56
|
+
@seen ||= {}
|
57
|
+
return if @seen[id]
|
58
|
+
@seen[id] = true
|
59
|
+
end
|
60
|
+
|
61
|
+
def name hash
|
62
|
+
hash = "%08x" % hash
|
63
|
+
@hashes ||= {}
|
64
|
+
names[name = "#{hash}.#{@hashes[hash] ||= 0}"] = 1
|
65
|
+
@hashes[hash] += 1
|
66
|
+
name
|
67
|
+
end
|
68
|
+
|
69
|
+
def names
|
70
|
+
@names ||= {}
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
53
74
|
# Almost c_rehash
|
54
75
|
def self.save(path=self.path)
|
55
|
-
|
56
|
-
hashes={}
|
76
|
+
cr = CRehash.new
|
57
77
|
Crypt.each do |crt|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
peers[id]=1
|
63
|
-
File.open File.join(path, name), 'w' do |f|
|
78
|
+
next unless cr.unique OpenSSL::Digest::SHA1.new.digest crt.to_der
|
79
|
+
|
80
|
+
name = File.join path, cr.name(crt.subject.hash)
|
81
|
+
File.open name, 'w' do |f|
|
64
82
|
f.puts <<-EOT
|
65
83
|
Subject: #{crt.subject}
|
66
84
|
Valid: #{crt.not_before} - #{crt.not_after}
|
@@ -68,9 +86,11 @@ Saved: #{Time.now} by #{self} v#{VERSION}
|
|
68
86
|
#{crt.to_pem}
|
69
87
|
EOT
|
70
88
|
end
|
89
|
+
link = File.join path, cr.name(crt.subject.hash_old)
|
90
|
+
FileUtils.ln name, link, force: true
|
71
91
|
end
|
72
92
|
Dir.glob File.join path, '*' do |f|
|
73
|
-
File.unlink f rescue nil unless names[File.basename f]
|
93
|
+
File.unlink f rescue nil unless cr.names[File.basename f]
|
74
94
|
end
|
75
95
|
end
|
76
96
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openssl-win-root
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stas Ukolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.6.7
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: ''
|