win32-certstore 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5640bf3ab8b678dc92fda6d689d13d080055f29617009a02e36021a9fd1b42bc
4
- data.tar.gz: 2140c35decc023314c21b7cb0bfafd1f1715bc2587751109cb3368818fbfe268
3
+ metadata.gz: 7b07544eeb10d6d5d218064ac922283b7654a4e6a683999f645792ff27fa45d5
4
+ data.tar.gz: c7be876bba7975484a85507e241d9d8f6c590194ea32290edc5189540e647f69
5
5
  SHA512:
6
- metadata.gz: 81d031f2d45507b54254c165704f4b8f1de89f7d1958a9a2c803f170fbb07aabcf7c4b5f17f08c843d646fb2c0ebcffbe826d88a77298ae9b9b6c6cc0cbc8718
7
- data.tar.gz: 38f969fb096085190123601cda01168bbc77c927306f945b033b83d987d9d649499000ab5ce586dbb30948082addd9aa6c3d5904efdb7ef0c2036cacbbae8a3c
6
+ metadata.gz: 772ca2195c9e4aa5b522d2e1196730cfc3cb777a05779c99d17a770eae954280e5a555986ee8718fbf785a94d9490b55b419515548c0740ed7f08f20839cf43b
7
+ data.tar.gz: 167436e45e6ae7b64cd4de5ce95eced68d7b16ed759585b3bd5a682a6f63b6c8b26c31c13c59e448006a6bb298ce89986bb33d987efcbbaee3959f6542ff733f
@@ -68,7 +68,6 @@ module Win32
68
68
  raise if pfx_cert_store.null?
69
69
  # Find the certificate context in certificate store
70
70
  cert_context = CertFindCertificateInStore(pfx_cert_store, ENCODING_TYPE, 0, CERT_FIND_ANY, nil, nil)
71
- close_cert_store(pfx_cert_store)
72
71
  raise if cert_context.null?
73
72
  # Add certificate context to the certificate store
74
73
  args = add_certcontxt_args(certstore_handler, cert_context)
@@ -77,6 +76,10 @@ module Win32
77
76
  cert_added
78
77
  rescue
79
78
  lookup_error("Add a PFX")
79
+ ensure
80
+ if pfx_cert_store && !pfx_cert_store.null?
81
+ close_cert_store(pfx_cert_store)
82
+ end
80
83
  end
81
84
 
82
85
  # Get certificate from open certificate store and return certificate object
@@ -163,9 +166,7 @@ module Win32
163
166
  # To close and destroy pointer of open certificate store handler
164
167
  def close_cert_store(certstore_handler = @certstore_handler)
165
168
  closed = CertCloseStore(certstore_handler, CERT_CLOSE_STORE_FORCE_FLAG)
166
- raise unless closed
167
- rescue
168
- lookup_error("close")
169
+ lookup_error("close") unless closed
169
170
  end
170
171
 
171
172
  private
@@ -1,6 +1,6 @@
1
1
  module Win32
2
2
  class Certstore
3
- VERSION = "0.2.3".freeze
3
+ VERSION = "0.2.4".freeze
4
4
  MAJOR, MINOR, TINY = VERSION.split(".")
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-certstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-29 00:00:00.000000000 Z
11
+ date: 2019-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler