pkcs11 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc4ee509784e2ea587d9e33242c9322d66b87448d69c188e278571695e878206
4
- data.tar.gz: 4f36de60d2d734fc686a195edccaa08a7f89456e3cefacc7d2b90cbf1e8271da
3
+ metadata.gz: b6901b24d77b1c193408fb8715f9b3ded208195ac24121d769c27005df39c701
4
+ data.tar.gz: c5fd2269bd0dd7064912f1f442d52cbc4e7bf8832b31fadaa4403e54198f1f63
5
5
  SHA512:
6
- metadata.gz: 51cf700dae9e033ea20741905c38609741b99bfb106515b58aa4e1d2bf6e4678a7e88691689bb7aaf87c4e48a2d34c450a9148bef11ead1c747f1188e76ec41a
7
- data.tar.gz: 9373aa9ddfec25d955379495b13d1cf2f5b2aa0732f4eaa9f06d62cf815fddc482749d11d4e389074a378e1c849b6bb3bda202f331141d0b2dce43a3dd1adeb0
6
+ metadata.gz: 2357d321016071e60fe51f10b1e10a66859e30d1f34a398c928e9eb8f13544033e33dd6e5303f94d502ec5af8bc11228858e0d962ab0b062dc3f13e99698dee5
7
+ data.tar.gz: ce7fbf9026eb59610ac933f6992876b7a0651c57e105c0baa8aac868ad8acb3b519ff898849d9957df29fb9eec6b3aafa8ef15724032ccbb840dceb759623c03
checksums.yaml.gz.sig CHANGED
Binary file
data/.appveyor.yml CHANGED
@@ -7,12 +7,13 @@ install:
7
7
  - ps: |
8
8
  if ($env:ruby_version -like "*head*") {
9
9
  $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-$env:ruby_version.exe", "$pwd/ruby-setup.exe")
10
- cmd /c ruby-setup.exe /verysilent /dir=C:/Ruby$env:ruby_version
10
+ cmd /c ruby-setup.exe /verysilent /currentuser /dir=C:/Ruby$env:ruby_version
11
11
  }
12
12
  - ridk version
13
- - ridk exec sh -c "pacman -S --noconfirm --needed ${MINGW_PACKAGE_PREFIX}-gcc"
13
+ - ridk exec sh -c "pacman -S --noconfirm --needed ${MINGW_PACKAGE_PREFIX}-gcc ${MINGW_PACKAGE_PREFIX}-libyaml"
14
14
  - gem --version
15
- - bundle install
15
+ - gem inst "bundler:4.0.9"
16
+ - bundle _4.0.9_ install
16
17
 
17
18
  # We need a 32 or 64 bit softokn3.dll to test against.
18
19
  # However it is not part of any installed software on Appveyor,
@@ -32,13 +33,11 @@ install:
32
33
  build: off
33
34
 
34
35
  test_script:
35
- - bundle exec rake compile test gem
36
+ - bundle _4.0.9_ exec rake compile test
36
37
 
37
38
  environment:
38
39
  matrix:
39
40
  - ruby_version: head-x64
40
41
  RUBY_DLL_PATH: "C:/Program Files/Mozilla Firefox"
41
- - ruby_version: "25"
42
+ - ruby_version: "33"
42
43
  RUBY_DLL_PATH: "C:/Program Files (x86)/Mozilla Firefox"
43
- - ruby_version: "31-x64"
44
- RUBY_DLL_PATH: "C:/Program Files/Mozilla Firefox"
@@ -0,0 +1,80 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ workflow_dispatch:
7
+ schedule:
8
+ - cron: "0 5 * * 3" # At 05:00 on Wednesday # https://crontab.guru/#0_5_*_*_3
9
+
10
+ jobs:
11
+ job_test_gem:
12
+ name: Test in source tree
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ include:
17
+ - os: windows
18
+ ruby: "head"
19
+ - os: windows
20
+ ruby: "3.2"
21
+ - os: ubuntu
22
+ ruby: "head"
23
+ - os: ubuntu
24
+ ruby: "4.0"
25
+ - os: ubuntu
26
+ ruby: "3.0"
27
+ - os: ubuntu
28
+ ruby: "truffleruby"
29
+ - os: macos
30
+ ruby: "head"
31
+
32
+ runs-on: ${{ matrix.os }}-latest
33
+
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+
37
+ - uses: ruby/setup-ruby-pkgs@v1
38
+ with:
39
+ ruby-version: ${{ matrix.ruby }} # passed to ruby/setup-ruby
40
+ apt-get: "libnss3" # Ubuntu
41
+ brew: "nss" # macOS
42
+ mingw: "" # Windows mingw / mswin /ucrt
43
+
44
+ - name: Download firefox on Windows
45
+ if: ${{ matrix.os == 'windows' }}
46
+ run: |
47
+ remove-item "C:/Program Files/Mozilla Firefox" -recurse
48
+ $(new-object net.webclient).DownloadFile('http://ftp.mozilla.org/pub/firefox/releases/68.3.0esr/win64/en-US/Firefox%20Setup%2068.3.0esr.exe', 'C:/firefox-setup.exe')
49
+ "SOFTOKN_PATH=C:/Program Files/Mozilla Firefox/softokn3.dll" >> $env:GITHUB_ENV
50
+ "RUBY_DLL_PATH=C:/Program Files/Mozilla Firefox" >> $env:GITHUB_ENV
51
+ "C:/Program Files/Mozilla Firefox" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
52
+
53
+ - name: Install firefox on Windows
54
+ if: ${{ matrix.os == 'windows' }}
55
+ shell: cmd
56
+ run: |
57
+ "C:/firefox-setup.exe" -ms
58
+ dir "C:/Program Files/Mozilla Firefox"
59
+
60
+ - name: Print tool versions
61
+ run: |
62
+ ruby -v
63
+ gcc -v
64
+ gem env
65
+
66
+ - name: Bundle install
67
+ run: bundle install
68
+
69
+ - name: Compile extension
70
+ run: bundle exec rake compile
71
+
72
+ - name: Run tests
73
+ run: bundle exec rake test
74
+
75
+ - name: Build gem
76
+ run: bundle exec rake gem
77
+
78
+ - name: Print compile logs if failed
79
+ if: ${{ failure() && matrix.os != 'windows' }}
80
+ run: find . -name '*.log' -print0 | xargs -0 cat
data/Gemfile CHANGED
@@ -5,12 +5,13 @@
5
5
  source "https://rubygems.org/"
6
6
 
7
7
 
8
- gem "yard", "~>0.6", :group => [:development, :test]
8
+ gem "yard", "~>0.9.36", :group => [:development, :test]
9
9
  gem "rake-compiler", "~>1.0", :group => [:development, :test]
10
10
  gem "rake-compiler-dock", "~>1.2", :group => [:development, :test]
11
- gem "minitest", "~>5.7", :group => [:development, :test]
11
+ gem "minitest", ">=5.7", :group => [:development, :test]
12
+ gem "hoe", "~>4.0", :group => [:development, :test]
12
13
  gem "hoe-bundler", "~>1.0", :group => [:development, :test]
13
- gem "rdoc", ">=4.0", "<7", :group => [:development, :test]
14
- gem "hoe", "~>3.23", :group => [:development, :test]
14
+ gem "win32-registry", "~>0.1", :group => [:development, :test]
15
+ gem "rdoc", ">=6.0", "<8", :group => [:development, :test]
15
16
 
16
17
  # vim: syntax=ruby
data/Rakefile CHANGED
@@ -34,11 +34,13 @@ hoe = Hoe.spec 'pkcs11' do
34
34
  developer('Ryosuke Kutsuna', 'ryosuke@deer-n-horse.jp')
35
35
  developer('GOTOU Yuuzou', 'gotoyuzo@notwork.org')
36
36
  developer('Lars Kanis', 'kanis@comcard.de')
37
- extra_dev_deps << ['yard', '~> 0.6']
37
+ extra_dev_deps << ['yard', '~> 0.9.36']
38
38
  extra_dev_deps << ['rake-compiler', '~> 1.0']
39
39
  extra_dev_deps << ['rake-compiler-dock', '~> 1.2']
40
- extra_dev_deps << ['minitest', '~> 5.7']
40
+ extra_dev_deps << ['minitest', '>= 5.7', '< 7.0.a']
41
+ extra_dev_deps << ['hoe', '~> 4.0']
41
42
  extra_dev_deps << ['hoe-bundler', '~> 1.0']
43
+ extra_dev_deps << ['win32-registry', '~> 0.1']
42
44
 
43
45
  self.summary = 'PKCS#11 binding for Ruby'
44
46
  self.description = 'This module allows Ruby programs to interface with "RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki)".'
@@ -48,7 +50,7 @@ hoe = Hoe.spec 'pkcs11' do
48
50
  spec_extras[:extensions] = 'ext/extconf.rb'
49
51
  spec_extras[:files] = `git ls-files`.split("\n").reject{|f| f=~/^pkcs11_/ }
50
52
  spec_extras[:files] += GENERATED_FILES
51
- spec_extras[:required_ruby_version] = '>= 2.2.0'
53
+ spec_extras[:required_ruby_version] = '>= 2.6.0'
52
54
  self.rdoc_locations << "http://www.rubydoc.info/gems/pkcs11"
53
55
  end
54
56
 
@@ -26,7 +26,7 @@ class ConstantParser
26
26
  s.options = options
27
27
  s.start!
28
28
  end
29
-
29
+
30
30
  ConstTemplate = Struct.new :regexp, :def
31
31
  ConstGroups = [
32
32
  ConstTemplate.new(/#define\s+(CKM_[A-Z_0-9]+)\s+(\w+)/, 'PKCS11_DEFINE_MECHANISM'),
@@ -38,11 +38,11 @@ class ConstantParser
38
38
  def start!
39
39
  File.open(options.const, "w") do |fd_const|
40
40
  options.files.each do |file_h|
41
- c_src = IO.read(file_h)
41
+ c_src = File.read(file_h)
42
42
  ConstGroups.each do |const_group|
43
43
  c_src.scan(const_group.regexp) do
44
44
  const_name, const_value = $1, $2
45
-
45
+
46
46
  fd_const.puts "#{const_group.def}(#{const_name}); /* #{const_value} */"
47
47
  end
48
48
  end
@@ -56,7 +56,7 @@ class StructParser
56
56
  def parse_files(files)
57
57
  structs = []
58
58
  files.each do |file_h|
59
- c_src = IO.read(file_h)
59
+ c_src = File.read(file_h)
60
60
  c_src.scan(/struct\s+([A-Z_0-9]+)\s*\{(.*?)\}/m) do |struct|
61
61
  struct_text = $2
62
62
  struct = CStruct.new( $1, [] )
@@ -31,7 +31,7 @@ fd_impl.puts <<-EOT
31
31
  #include #{File.basename(options.decl).inspect}
32
32
  EOT
33
33
  ARGV.each do |file_h|
34
- c_src = IO.read(file_h)
34
+ c_src = File.read(file_h)
35
35
  c_src.scan(/CK_PKCS11_FUNCTION_INFO\((.+?)\).*?\((.*?)\);/m) do
36
36
  func_name, func_param_list = $1, $2
37
37
  func_params = []