certstore_c 0.1.2.rc → 0.1.2

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: 78ff70eb97e64c2fcf16e9b458d11dc056d54a206d74e89336b21859b6f67b16
4
- data.tar.gz: 99a55e4517f41199b7b1cf2e7210ed7217aa356cd9104abd5095e1e2b4e5034d
3
+ metadata.gz: d980868eb22aa3b7a16701cb9f61f349018ba203c9ea723aa263f26f48b2fbd3
4
+ data.tar.gz: b068d4b2c25eb8ee020923969c52bb03e24771867e371d4666bd1a2f12a1bd37
5
5
  SHA512:
6
- metadata.gz: ab535c2e31db23bf07fcd90dd7b03ba3e8783c2beb37d2f0b37971f143e1a320b5a8d00323c3acc8bf54694f883f55bbaed0371d0e1c6d493e0226ffd526ccdc
7
- data.tar.gz: c8abdd310e2c64875c2ff4fb89bccc4625025f8433116e511e43b22b2aa793a17832103d50473ba008cc6e8fbac928288e48bac2ed13a5f58ea79426529f1ee1
6
+ metadata.gz: 333b89dbd8a05a0a270f480ef047e34abd01657fa9c0e7bce9601c50ff0f5ad84fcfa62cd9d4f4c4c8d997c0fe22a08aadcc21c33fd7395de4897db9d226f093
7
+ data.tar.gz: 209ef9bc316eabf364be79c7f667c3b8e7f3ac45ad2bbbf37047280b97d57ad640f21fd965869e50855b4259be6a932741c2b9614c78b4540ce81c75fdf38eb2
data/Rakefile CHANGED
@@ -2,6 +2,7 @@ require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
3
 
4
4
  require "rake/testtask"
5
+ require 'rake_compiler_dock'
5
6
  require "rake/clean"
6
7
 
7
8
  Rake::TestTask.new(:test) do |t|
@@ -16,6 +17,20 @@ spec = eval File.read("certstore_c.gemspec")
16
17
 
17
18
  Rake::ExtensionTask.new("certstore", spec) do |ext|
18
19
  ext.lib_dir = "lib/certstore"
20
+ ext.cross_compile = true
21
+ ext.lib_dir = File.join(*['lib', 'certstore', ENV['FAT_DIR']].compact)
22
+ # cross_platform names are of MRI's platform name
23
+ ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
24
+ end
25
+
26
+
27
+ desc 'Build gems for Windows per rake-compiler-dock'
28
+ task 'gem:native' do
29
+ # See RUBY_CC_VERSION in https://github.com/rake-compiler/rake-compiler-dock/blob/master/Dockerfile.mri
30
+ RakeCompilerDock.sh <<-EOS
31
+ bundle --local
32
+ bundle exec rake cross native gem RUBY_CC_VERSION=2.4.0:2.5.0:2.6.0
33
+ EOS
19
34
  end
20
35
 
21
36
  CLEAN.include('lib/certstore/certstore.*')
@@ -9,7 +9,8 @@ install:
9
9
  - gem --version
10
10
  - bundle --version
11
11
  - bundle install
12
- - ridk.cmd exec bundle exec rake compile
12
+ - IF %ridk%==1 ridk.cmd exec bundle exec rake compile
13
+ - IF %ridk%==0 bundle exec rake compile -rdevkit
13
14
  build: off
14
15
  test_script:
15
16
  # - bundle exec rake test
@@ -19,8 +20,14 @@ test_script:
19
20
  environment:
20
21
  matrix:
21
22
  - ruby_version: "26-x64"
23
+ ridk: 1
22
24
  - ruby_version: "26"
25
+ ridk: 1
23
26
  - ruby_version: "25-x64"
24
- - ruby_version: "25"
27
+ ridk: 1
25
28
  - ruby_version: "24-x64"
26
- - ruby_version: "24"
29
+ ridk: 1
30
+ - ruby_version: "23-x64"
31
+ ridk: 0
32
+ - ruby_version: "23"
33
+ ridk: 0
@@ -34,11 +34,12 @@ Gem::Specification.new do |spec|
34
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
35
  spec.require_paths = ["lib"]
36
36
  spec.license = "Apache-2.0"
37
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4".freeze)
37
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3".freeze)
38
38
  spec.extensions = ["ext/certstore/extconf.rb"]
39
39
 
40
- spec.add_development_dependency "bundler", "~> 2.0"
40
+ spec.add_development_dependency "bundler", [">= 1.16", "< 3"]
41
41
  spec.add_development_dependency "rake", "~> 12.0"
42
42
  spec.add_development_dependency "rake-compiler", "~> 1.0"
43
+ spec.add_development_dependency "rake-compiler-dock", "~> 0.7.2"
43
44
  spec.add_development_dependency "test-unit", "~> 3.3.3"
44
45
  end
@@ -30,7 +30,7 @@
30
30
  #define CERT_THUMBPRINT_STR_LENGTH 40
31
31
  #define CERT_THUMBPRINT_SIZE (160 / 8)
32
32
 
33
- #include <Wincrypt.h>
33
+ #include <wincrypt.h>
34
34
 
35
35
  VALUE rb_mCertstore;
36
36
  VALUE rb_cCertLoader;
@@ -13,7 +13,7 @@ dir_config("certstore", includedir, libdir)
13
13
  have_library("crypt32")
14
14
  have_func("PFXExportCertStoreEx", "Wincrypt.h")
15
15
 
16
- $LDFLAGS << " -lCrypt32"
16
+ $LDFLAGS << " -lcrypt32"
17
17
  $CFLAGS << " -std=c99 -fPIC -fms-extensions "
18
18
  # $CFLAGS << " -g -O0"
19
19
 
@@ -81,14 +81,20 @@ certificate_context_to_string(PCCERT_CONTEXT pContext)
81
81
  CHAR errBuf[256];
82
82
  DWORD errCode;
83
83
 
84
+ #ifndef CRYPT_STRING_NOCRLF
85
+ #define CRYPT_STRING_NOCRLF 0x40000000
86
+ #endif
87
+
84
88
  if (!CryptBinaryToStringW(pContext->pbCertEncoded, pContext->cbCertEncoded,
85
- CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, NULL, &cchString)) {
89
+ CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF,
90
+ NULL, &cchString)) {
86
91
  rb_raise(rb_eCertLoaderError, "cannot obtain certificate string length.");
87
92
  }
88
93
 
89
94
  wszString = malloc(sizeof(WCHAR) * cchString);
90
95
  CryptBinaryToStringW(pContext->pbCertEncoded, pContext->cbCertEncoded,
91
- CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, wszString, &cchString);
96
+ CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF,
97
+ wszString, &cchString);
92
98
 
93
99
  utf8str = wstr_to_mbstr(CP_UTF8, wszString, -1);
94
100
  // malloc sizeof CHAR * ((base64 cert content + header + footer) length).
@@ -1,4 +1,8 @@
1
- require "certstore/certstore"
1
+ begin
2
+ require "certstore/#{RUBY_VERSION[/\d+.\d+/]}/certstore"
3
+ rescue LoadError
4
+ require "certstore/certstore"
5
+ end
2
6
  require "certstore/version"
3
7
  require "certstore/loader"
4
8
  require "certstore/openssl/loader"
@@ -15,5 +15,5 @@
15
15
  #
16
16
 
17
17
  module Certstore
18
- VERSION = "0.1.2.rc"
18
+ VERSION = "0.1.2"
19
19
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: certstore_c
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.rc
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Hatake
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-03 00:00:00.000000000 Z
11
+ date: 2019-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '2.0'
22
+ version: '3'
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.16'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '2.0'
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rake
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +58,20 @@ dependencies:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
60
  version: '1.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake-compiler-dock
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: 0.7.2
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: 0.7.2
55
75
  - !ruby/object:Gem::Dependency
56
76
  name: test-unit
57
77
  requirement: !ruby/object:Gem::Requirement
@@ -108,12 +128,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
128
  requirements:
109
129
  - - ">="
110
130
  - !ruby/object:Gem::Version
111
- version: '2.4'
131
+ version: '2.3'
112
132
  required_rubygems_version: !ruby/object:Gem::Requirement
113
133
  requirements:
114
- - - ">"
134
+ - - ">="
115
135
  - !ruby/object:Gem::Version
116
- version: 1.3.1
136
+ version: '0'
117
137
  requirements: []
118
138
  rubyforge_project:
119
139
  rubygems_version: 2.7.3