pkcs11 0.2.6 → 0.2.7

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
- SHA1:
3
- metadata.gz: 20e09104f3d3d4612707a80a370726b048de1c78
4
- data.tar.gz: 423e7a843678a770b76d486478a18925ff428ee0
2
+ SHA256:
3
+ metadata.gz: dbbe79ed675ee3a36557da0c1daf8c57301fe4feefe884d2de01c6548bc5066b
4
+ data.tar.gz: 52d77be573adf0373a715448aefead6abcb988b53c614b2835ae7b5a0a5ce896
5
5
  SHA512:
6
- metadata.gz: d4dae807594372b47a5b006619936630c63e07c55f9fc0f7d82db5a4d4a2b1c5f4e23e3eab4c219f5a10ee65a485f1e428c796f4009c35507c37a84b33798667
7
- data.tar.gz: 297c34351e2014ea8f9416a84f7c3b9a9b1843bc579ef6e40b89f6fe23318de20c5d58ce5c0f9498af3a3dde08a540bef24f25d84960968d67574e65b357acde
6
+ metadata.gz: 4fa068e4e856d6861eeb11b302d753e19be00b04f245bdada1e322b8067f7dc7704c506a7eab66a026af6ea08dbf6633ccf283a8cf6f82aaf1017e2685bd46f3
7
+ data.tar.gz: 55523644e465ac7f4eebf4c3b649189127828e9ea7924d026506261b8827c0be5400ada65e57214035f8cd1657d07fd0b21880004c0b1d819d17e7c8683ff79c
Binary file
@@ -0,0 +1,4 @@
1
+ =�1���T���P��"?~[�����:Mb�"���`-�8f2��N
2
+ @J�����1/) �K.�B�v��
3
+ ��]/�h~[a6�$P�yd�a1��6�y��]�%*��=�C����U{�%�����/�k���YW��r����c��J���(Iq
4
+ w0���Ô ��ͫh)����H�����Q�Yj�[�}�+�|y ��YV��V�w���n�`�a7��;p�� @S
@@ -1,8 +1,9 @@
1
1
  language: ruby
2
2
  sudo: false
3
3
  rvm:
4
- - "1.9.3"
5
- - "2.2.0"
4
+ - "2.0"
5
+ - "2.5.0"
6
+ - "ruby-head"
6
7
  - rbx
7
8
  matrix:
8
9
  allow_failures:
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ source "https://rubygems.org/"
7
7
 
8
8
  gem "yard", ">=0.6", :group => [:development, :test]
9
9
  gem "rake-compiler", "~>1.0", :group => [:development, :test]
10
- gem "rake-compiler-dock", "~>0.6.0", :group => [:development, :test]
10
+ gem "rake-compiler-dock", "~>0.6.2", :group => [:development, :test]
11
11
  gem "minitest", "~>5.7", :group => [:development, :test]
12
12
  gem "hoe-bundler", "~>1.0", :group => [:development, :test]
13
13
  gem "rdoc", "~>4.0", :group => [:development, :test]
@@ -1,3 +1,10 @@
1
+ === 0.2.7 / 2018-01-05
2
+
3
+ * Add vendor extension for Safenet Luna called pkcs11_luna.
4
+ * Fix warnings to Fixnum/Bignum in Ruby-2.4+.
5
+ * Add binary Windows gems for Ruby-2.5.
6
+ * Add a note about RUBY_DLL_PATH on Windows.
7
+
1
8
  === 0.2.6 / 2017-06-07
2
9
 
3
10
  * Update pkcs11 header files to PKCS11-v2.4.
@@ -64,7 +64,7 @@ Browsable HTML can be found at http://www.cryptsoft.com/pkcs11doc.
64
64
  === Vendor extensions
65
65
  Some vendors extend their libraries beyond the standard, in it's own way.
66
66
  This can be used by vendor specific packages:
67
- * Safenet ProtectServer: {file:pkcs11_protect_server/README_PROTECT_SERVER.rdoc}
67
+ * Safenet ProtectServer: {http://www.rubydoc.info/gems/pkcs11_protect_server/}
68
68
  * Safenet Luna: {file:pkcs11_luna/README_LUNA.rdoc}
69
69
 
70
70
  === Threading
data/Rakefile CHANGED
@@ -30,7 +30,7 @@ hoe = Hoe.spec 'pkcs11' do
30
30
  developer('Lars Kanis', 'kanis@comcard.de')
31
31
  extra_dev_deps << ['yard', '>= 0.6']
32
32
  extra_dev_deps << ['rake-compiler', '~> 1.0']
33
- extra_dev_deps << ['rake-compiler-dock', '~> 0.6.0']
33
+ extra_dev_deps << ['rake-compiler-dock', '~> 0.6.2']
34
34
  extra_dev_deps << ['minitest', '~> 5.7']
35
35
  extra_dev_deps << ['hoe-bundler', '~> 1.0']
36
36
 
@@ -1,6 +1,6 @@
1
1
  install:
2
- - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
3
- - SET PATH=C:\MinGW\msys\1.0\bin;%PATH%
2
+ - SET PATH=C:/Ruby%ruby_version%/bin;%PATH%
3
+ - SET PATH=C:/MinGW/msys/1.0/bin;%PATH%
4
4
  - SET RAKEOPT=-rdevkit
5
5
  - ruby --version
6
6
  - gem --version
@@ -15,10 +15,10 @@ install:
15
15
  - ps: |
16
16
  if ($env:isx64 -eq "1")
17
17
  {
18
- $(new-object net.webclient).DownloadFile('http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/40.0b4/win64/en-US/Firefox%20Setup%2040.0b4.exe', 'C:\firefox-setup.exe')
19
- cmd /c C:\firefox-setup.exe -ms
20
- $env:SOFTOKN_PATH = 'C:\Program Files\Mozilla Firefox\softokn3.dll'
21
- $env:PATH = 'C:\Program Files\Mozilla Firefox;' + $env:PATH
18
+ $(new-object net.webclient).DownloadFile('http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/40.0b4/win64/en-US/Firefox%20Setup%2040.0b4.exe', 'C:/firefox-setup.exe')
19
+ cmd /c "C:/firefox-setup.exe" -ms
20
+ $env:SOFTOKN_PATH = 'C:/Program Files/Mozilla Firefox/softokn3.dll'
21
+ $env:PATH = 'C:/Program Files/Mozilla Firefox;' + $env:PATH
22
22
  }
23
23
 
24
24
  build: off
@@ -28,11 +28,15 @@ test_script:
28
28
 
29
29
  environment:
30
30
  matrix:
31
- - ruby_version: "193"
32
- #- ruby_version: "200"
31
+ - ruby_version: "24"
32
+ RUBY_DLL_PATH: "C:/Program Files (x86)/Mozilla Firefox"
33
+ - ruby_version: "24-x64"
34
+ RUBY_DLL_PATH: "C:/Program Files/Mozilla Firefox"
35
+ isx64: "1"
36
+ - ruby_version: "200"
33
37
  #- ruby_version: "200-x64"
34
38
  #- ruby_version: "21"
35
39
  #- ruby_version: "21-x64"
36
40
  - ruby_version: "22"
37
- - ruby_version: "22-x64"
41
+ - ruby_version: "23-x64"
38
42
  isx64: "1"
@@ -1,6 +1,6 @@
1
1
  #ifndef RUBY_PK11_VERSION_H
2
2
  #define RUBY_PK11_VERSION_H
3
3
 
4
- static const char *VERSION = "0.2.6";
4
+ static const char *VERSION = "0.2.7";
5
5
 
6
6
  #endif
@@ -133,9 +133,7 @@ module PKCS11
133
133
  end
134
134
 
135
135
  PKCS11::CK_MECHANISM.new(mech, param)
136
- when Fixnum
137
- PKCS11::CK_MECHANISM.new(mechanism)
138
- when Bignum
136
+ when Integer
139
137
  PKCS11::CK_MECHANISM.new(mechanism)
140
138
  else
141
139
  mechanism
@@ -34,6 +34,10 @@ module PKCS11
34
34
  # pkcs11.load_library(so_path)
35
35
  # pkcs11.C_GetFunctionList
36
36
  # pkcs11.C_Initialize(args)
37
+ #
38
+ # Note: When using RubyInstaller-2.4+ on Windows it might be required to add the path of dependent DLLs to the DLL search path.
39
+ # This can be done by the +RUBY_DLL_PATH+ environment variable.
40
+ # See https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#user-content-dll-loading
37
41
  def initialize(so_path=nil, args={})
38
42
  unwrapped_initialize(so_path, args)
39
43
  end
@@ -64,7 +64,7 @@ module PKCS11
64
64
  # true -> 0x01
65
65
  # false -> 0x00
66
66
  # nil -> NULL pointer
67
- # Fixnum -> binary encoded unsigned long
67
+ # Integer-> binary encoded unsigned long
68
68
  #
69
69
  # @example
70
70
  # object[:VALUE] = "\000\000\000\000\000\000\000\000"
@@ -90,8 +90,14 @@ class TestPkcs11Crypt < Minitest::Test
90
90
 
91
91
  def create_openssl_cipher(pk11_key)
92
92
  rsa = OpenSSL::PKey::RSA.new
93
- rsa.n = OpenSSL::BN.new pk11_key[:MODULUS], 2
94
- rsa.e = OpenSSL::BN.new pk11_key[:PUBLIC_EXPONENT], 2
93
+ n = OpenSSL::BN.new pk11_key[:MODULUS], 2
94
+ e = OpenSSL::BN.new pk11_key[:PUBLIC_EXPONENT], 2
95
+ if rsa.respond_to?(:set_key)
96
+ rsa.set_key(n, e, nil)
97
+ else
98
+ rsa.n = n
99
+ rsa.e = e
100
+ end
95
101
  rsa
96
102
  end
97
103
 
@@ -26,13 +26,13 @@ class TestPkcs11Slot < Minitest::Test
26
26
 
27
27
  assert sinfo.inspect =~ /manufacturerID=/, 'Slot info should tell about manufacturerID'
28
28
 
29
- assert_equal Fixnum, sinfo.flags.class
29
+ assert_kind_of Integer, sinfo.flags
30
30
  assert sinfo.manufacturerID =~ /Mozilla/i, "It's the mozilla libaray we test against"
31
31
  assert sinfo.slotDescription =~ /Private Key/i, "It's the slot with users private keys"
32
- assert_equal Fixnum, sinfo.hardwareVersion.major.class, "Version should be a number"
33
- assert_equal Fixnum, sinfo.hardwareVersion.minor.class, "Version should be a number"
34
- assert_equal Fixnum, sinfo.firmwareVersion.major.class, "Version should be a number"
35
- assert_equal Fixnum, sinfo.firmwareVersion.minor.class, "Version should be a number"
32
+ assert_kind_of Integer, sinfo.hardwareVersion.major, "Version should be a number"
33
+ assert_kind_of Integer, sinfo.hardwareVersion.minor, "Version should be a number"
34
+ assert_kind_of Integer, sinfo.firmwareVersion.major, "Version should be a number"
35
+ assert_kind_of Integer, sinfo.firmwareVersion.minor, "Version should be a number"
36
36
  end
37
37
 
38
38
  def test_token_info
@@ -44,14 +44,14 @@ class TestPkcs11Slot < Minitest::Test
44
44
  assert_equal false, slot.mechanisms.empty?, 'There should be some mechanisms'
45
45
  slot.mechanisms.each do |m|
46
46
  info = slot.mechanism_info(m)
47
- assert_equal CK_MECHANISM_INFO, info.class, 'Mechanism info should get a CK_MECHANISM_INFO'
47
+ assert_kind_of CK_MECHANISM_INFO, info, 'Mechanism info should get a CK_MECHANISM_INFO'
48
48
  assert info.inspect =~ /ulMaxKeySize=/, 'Mechanism info should tell about max key size'
49
49
  end
50
50
  end
51
51
 
52
52
  def test_mechanism_info
53
53
  info1 = slot.mechanism_info(:DES3_CBC)
54
- assert_equal CK_MECHANISM_INFO, info1.class, 'Mechanism info should get a CK_MECHANISM_INFO'
54
+ assert_kind_of CK_MECHANISM_INFO, info1, 'Mechanism info should get a CK_MECHANISM_INFO'
55
55
  assert info1.inspect =~ /ulMinKeySize=/, 'Mechanism info should tell about min key size'
56
56
 
57
57
  info2 = slot.mechanism_info(CKM_DES3_CBC)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkcs11
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryosuke Kutsuna
@@ -9,8 +9,29 @@ authors:
9
9
  - Lars Kanis
10
10
  autorequire:
11
11
  bindir: bin
12
- cert_chain: []
13
- date: 2017-06-07 00:00:00.000000000 Z
12
+ cert_chain:
13
+ - |
14
+ -----BEGIN CERTIFICATE-----
15
+ MIIDPDCCAiSgAwIBAgIBAzANBgkqhkiG9w0BAQUFADBEMQ0wCwYDVQQDDARsYXJz
16
+ MR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZImiZPyLGQB
17
+ GRYCZGUwHhcNMTcwNDA0MTgyNDE1WhcNMTgwNDA0MTgyNDE1WjBEMQ0wCwYDVQQD
18
+ DARsYXJzMR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZIm
19
+ iZPyLGQBGRYCZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZb4Uv
20
+ RFJfRu/VEWiy3psh2jinETjiuBrL0NeRFGf8H7iU9+gx/DI/FFhfHGLrDeIskrJx
21
+ YIWDMmEjVO10UUdj7wu4ZhmU++0Cd7Kq9/TyP/shIP3IjqHjVLCnJ3P6f1cl5rxZ
22
+ gqo+d3BAoDrmPk0rtaf6QopwUw9RBiF8V4HqvpiY+ruJotP5UQDP4/lVOKvA8PI9
23
+ P0GmVbFBrbc7Zt5h78N3UyOK0u+nvOC23BvyHXzCtcFsXCoEkt+Wwh0RFqVZdnjM
24
+ LMO2vULHKKHDdX54K/sbVCj9pN9h1aotNzrEyo55zxn0G9PHg/G3P8nMvAXPkUTe
25
+ brhXrfCwWRvOXA4TAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0G
26
+ A1UdDgQWBBRAHK81igrXodaDj8a8/BIKsaZrETANBgkqhkiG9w0BAQUFAAOCAQEA
27
+ Wbp+grpaqUH+RiXNXmi/5xBfvSYLbxWj+DZpCSnQW+DMfx46RVVko3b7BtKDs2zs
28
+ EtKM6r6s7VbllPgcYUzaP92uzPqCw8FncvqG0+B+Nd4C2jKzPxAQyzYXv/3bQhv1
29
+ sXAzEqLQqKx5V63eBDh1TPvPTEMfJwmjcdcbvMwFSt5EcUkT63W13ZJXX23JYp1K
30
+ KRW+N1WIYz8RSBNaQIP2v5Inb9vUA+jPUOcdyLHoi205lyZ28hE4lcnh9Zs02aHs
31
+ Ao8FZozVJz8xVEuYNJsL2k70w0FiwXwoWyvKyekgPBvYNUj4JGDMtBBayJTOpDs7
32
+ 3EVmCm5IRuqZ1UcDFouQ9w==
33
+ -----END CERTIFICATE-----
34
+ date: 2018-01-05 00:00:00.000000000 Z
14
35
  dependencies:
15
36
  - !ruby/object:Gem::Dependency
16
37
  name: yard
@@ -46,14 +67,14 @@ dependencies:
46
67
  requirements:
47
68
  - - "~>"
48
69
  - !ruby/object:Gem::Version
49
- version: 0.6.0
70
+ version: 0.6.2
50
71
  type: :development
51
72
  prerelease: false
52
73
  version_requirements: !ruby/object:Gem::Requirement
53
74
  requirements:
54
75
  - - "~>"
55
76
  - !ruby/object:Gem::Version
56
- version: 0.6.0
77
+ version: 0.6.2
57
78
  - !ruby/object:Gem::Dependency
58
79
  name: minitest
59
80
  requirement: !ruby/object:Gem::Requirement
@@ -205,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
226
  version: '0'
206
227
  requirements: []
207
228
  rubyforge_project:
208
- rubygems_version: 2.6.12
229
+ rubygems_version: 2.7.3
209
230
  signing_key:
210
231
  specification_version: 4
211
232
  summary: PKCS#11 binding for Ruby
@@ -0,0 +1 @@
1
+ nԕ���/��xȄ0����u-h�6��^3[�v��6�ar���7���c�F�q�/�u����