openssl-win-root 0.9.1 → 0.9.2
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 +7 -5
- data/lib/openssl/win/root/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9dce0464f5e87e087cbb19735ec63627847c5b4
|
4
|
+
data.tar.gz: b8ea6e6cdc1917d355e5798134d6da552dd9f441
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b77749d09eccb1fe0e6beac76620301805a46186d75262964d268e6ed08b03a85d9276e765ff72663473628d6019857ef27d089dac4e48c1e3fb416fde1c3242
|
7
|
+
data.tar.gz: 07f4f007c27bcf100a4cdfb488a8080b1eb12701a2203af73a0727644ac4555d1a26b8903af316d9923ba933a78e0fe0f2342247448abd39b0a2dca72bd0790c
|
data/lib/openssl/win/root.rb
CHANGED
@@ -42,21 +42,23 @@ module OpenSSL::Win::Root
|
|
42
42
|
end if On
|
43
43
|
|
44
44
|
def self.save(path=path)
|
45
|
-
|
45
|
+
names={}
|
46
|
+
hashes={}
|
46
47
|
Crypt.each do |crt|
|
47
|
-
|
48
|
-
|
48
|
+
hash=crt.subject.hash
|
49
|
+
names[name='%08x.%i' % [hash, hashes[hash]||=0]]=1
|
50
|
+
hashes[hash]+=1
|
51
|
+
File.open File.join(path, name), 'w' do |f|
|
49
52
|
f.puts <<-EOT
|
50
53
|
Subject: #{crt.subject}
|
51
54
|
Valid: #{crt.not_before} - #{crt.not_after}
|
52
55
|
Saved: #{self} v#{VERSION} @#{Time.now}
|
53
56
|
#{crt.to_pem}
|
54
|
-
#{crt.to_text}
|
55
57
|
EOT
|
56
58
|
end
|
57
59
|
end
|
58
60
|
Dir.glob File.join path, '*' do |f|
|
59
|
-
File.unlink f unless
|
61
|
+
File.unlink f unless names[File.basename f]
|
60
62
|
end
|
61
63
|
end
|
62
64
|
|