openssl-win-root 1.0.3 → 1.1.0

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
  SHA1:
3
- metadata.gz: 2ada8f2f80dac79577ed4a69ddac662f7f59fe3b
4
- data.tar.gz: 89ad5f3f9e0f4e8abcd4c34a76cfaccb6d6c3766
3
+ metadata.gz: ebed7ff514374969535e034a2360f8e953de49b3
4
+ data.tar.gz: 20dab383ad84c77b9bf2da2e8e7b1efab21f3289
5
5
  SHA512:
6
- metadata.gz: 9d972cc71675abcd9db5598982f48269e788b4b1630938981a5946361ab0fc6bc31c5dad3167bae10c48cc4819ec6f875e7c41e4f45d9a7636b1283663a3e51c
7
- data.tar.gz: 9ce632101d57d4291df5f9af0d15e7bd6b959b3361fa6eeaa84e370e850795b9cbd30f19aa4bcd7f841b2b605bc5d6c0d930d17ef0961b517c37350a4b720e0e
6
+ metadata.gz: 47756db99b64c8c85fd22e59af5d8c783c393bcac3391c0d0ba7ce58238bd0ceab50122cb8ae0a56d5dbea1cf0b6b72738a8fbb957b5b05818b7394290b09afb
7
+ data.tar.gz: feed5fe246c0e79df000c24abc2bca559a213ef6d954d5a5c37a45bc412345ddb064055ee4d0e671fcd2b481a309aa280bfb30ced761e0c62d2d053441a77fe4
@@ -1,6 +1,6 @@
1
- require 'ffi'
2
1
  require 'openssl'
3
2
  require 'fileutils'
3
+ require 'fiddle/import'
4
4
 
5
5
  require_relative "root/version"
6
6
 
@@ -10,34 +10,33 @@ module OpenSSL::Win::Root
10
10
 
11
11
  # Based on Puppet::Util::Windows::RootCerts
12
12
  module Crypt
13
- extend FFI::Library
14
- ffi_lib 'crypt32'
15
- ffi_convention :stdcall
13
+ extend Fiddle::Importer
14
+ dlload 'crypt32'
16
15
 
17
- attach_function :open, :CertOpenSystemStoreA, [:pointer, :string], :pointer
18
- attach_function :close, :CertCloseStore, [:pointer, :uint], :int
19
- attach_function :enum, :CertEnumCertificatesInStore, [:pointer, :pointer], :pointer
16
+ extern 'uintptr_t CertOpenSystemStoreA(uintptr_t, char*)', :stdcall
17
+ extern 'int CertCloseStore(uintptr_t, unsigned long)', :stdcall
18
+ extern 'void* CertEnumCertificatesInStore(uintptr_t, void*)', :stdcall
20
19
 
21
- class Ctx < FFI::Struct
22
- layout :dwCertEncodingType, :uint,
23
- :pbCertEncoded, :pointer,
24
- :cbCertEncoded, :uint,
25
- :pCertInfo, :pointer,
26
- :hCertStore, :pointer
20
+ Ctx = struct [
21
+ 'unsigned long dwCertEncodingType',
22
+ 'unsigned char* pbCertEncoded',
23
+ 'unsigned long cbCertEncoded',
24
+ 'void* pCertInfo',
25
+ 'uintptr_t hCertStore',
26
+ ]
27
27
 
28
+ class Ctx
28
29
  def crt
29
- OpenSSL::X509::Certificate.new self[:pbCertEncoded].read_string self[:cbCertEncoded]
30
+ OpenSSL::X509::Certificate.new pbCertEncoded[0, cbCertEncoded]
30
31
  end
31
32
  end
32
33
 
33
34
  def self.each
34
- store = open nil, 'ROOT'
35
- begin
36
- ctx = nil
37
- yield Ctx.new(ctx).crt until (ctx = enum store, ctx).null?
38
- ensure
39
- close store, 0
40
- end
35
+ store = CertOpenSystemStoreA 0, 'ROOT'
36
+ ctx = nil
37
+ yield Ctx.new(ctx).crt until (ctx = CertEnumCertificatesInStore store, ctx).null?
38
+ ensure
39
+ CertCloseStore store, 0
41
40
  end
42
41
  end if On
43
42
 
@@ -1,7 +1,7 @@
1
1
  module OpenSSL
2
2
  module Win
3
3
  module Root
4
- VERSION = "1.0.3"
4
+ VERSION = "1.1.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openssl-win-root
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stas Ukolov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: ffi
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: bundler
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -113,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
99
  version: '0'
114
100
  requirements: []
115
101
  rubyforge_project:
116
- rubygems_version: 2.4.5.1
102
+ rubygems_version: 2.2.3
117
103
  signing_key:
118
104
  specification_version: 4
119
105
  summary: ''