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 +4 -4
- data/Rakefile +15 -0
- data/appveyor.yml +10 -3
- data/certstore_c.gemspec +3 -2
- data/ext/certstore/certstore.h +1 -1
- data/ext/certstore/extconf.rb +1 -1
- data/ext/certstore/loader.c +8 -2
- data/lib/certstore.rb +5 -1
- data/lib/certstore/version.rb +1 -1
- metadata +29 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d980868eb22aa3b7a16701cb9f61f349018ba203c9ea723aa263f26f48b2fbd3
|
4
|
+
data.tar.gz: b068d4b2c25eb8ee020923969c52bb03e24771867e371d4666bd1a2f12a1bd37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.*')
|
data/appveyor.yml
CHANGED
@@ -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
|
-
|
27
|
+
ridk: 1
|
25
28
|
- ruby_version: "24-x64"
|
26
|
-
|
29
|
+
ridk: 1
|
30
|
+
- ruby_version: "23-x64"
|
31
|
+
ridk: 0
|
32
|
+
- ruby_version: "23"
|
33
|
+
ridk: 0
|
data/certstore_c.gemspec
CHANGED
@@ -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.
|
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", "
|
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
|
data/ext/certstore/certstore.h
CHANGED
data/ext/certstore/extconf.rb
CHANGED
data/ext/certstore/loader.c
CHANGED
@@ -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,
|
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,
|
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).
|
data/lib/certstore.rb
CHANGED
data/lib/certstore/version.rb
CHANGED
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
|
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-
|
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: '
|
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: '
|
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.
|
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:
|
136
|
+
version: '0'
|
117
137
|
requirements: []
|
118
138
|
rubyforge_project:
|
119
139
|
rubygems_version: 2.7.3
|