pkcs11 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0786837e9f9aeabeba59200bdfd2b8d4a4f4b1e1
4
+ data.tar.gz: c2f566795dfa8e5128f55c4a7605a13301d43228
5
+ SHA512:
6
+ metadata.gz: 2a24a6e185e6831c53b12ef3c44fc1ee24e1ffbcac718067c1ed767e495873c50a94c3f1620f226474e936b16c34dffaa1255757ad8542e0eb2f20e2317f28a4
7
+ data.tar.gz: df9bed272288404d35b8aa9fccb62545712e8ed49ec4f07476701cd68cb5fa29d56fb49fb8faa61da17b8d77704f77c50dbfc7ebf1c9a8506fdd24cc6c7e0ccd
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,8 @@
1
+ === 0.2.5 / 2015-01-26
2
+
3
+ * Fix compatibility with Ruby-2.2
4
+ * Add Ruby-2.1 and 2.2 to binary Windows gems.
5
+
1
6
  === 0.2.4 / 2013-04-05
2
7
 
3
8
  * Build and package binary x64 version for Windows in addition to x86.
@@ -3,7 +3,7 @@
3
3
  = PKCS #11/Ruby Interface
4
4
 
5
5
  * Homepage: http://github.com/larskanis/pkcs11
6
- * API documentation: http://pkcs11.rubyforge.org/pkcs11/frames.html
6
+ * API documentation: http://rubydoc.info/gems/pkcs11/frames
7
7
 
8
8
  This module allows Ruby programs to interface with "RSA Security Inc.
9
9
  PKCS #11 Cryptographic Token Interface (Cryptoki)".
data/Rakefile CHANGED
@@ -39,7 +39,7 @@ hoe = Hoe.spec 'pkcs11' do
39
39
  self.rdoc_locations << "larskanis@rack.rubyforge.org:/var/www/gforge-projects/pkcs11/pkcs11/"
40
40
  end
41
41
 
42
- ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3:2.0.0'
42
+ ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3:2.0.0:2.1.1:2.2.0'
43
43
 
44
44
  Rake::ExtensionTask.new('pkcs11_ext', hoe.spec) do |ext|
45
45
  ext.ext_dir = 'ext'
@@ -66,16 +66,16 @@ end
66
66
  file 'ext/pk11_thread_funcs.c' => 'ext/pk11_thread_funcs.h'
67
67
  file 'ext/pk11.h' => 'ext/pk11_thread_funcs.h'
68
68
 
69
- task 'copy:pkcs11_ext:i386-mingw32:1.9.3' do |t|
70
- sh "i686-w64-mingw32-strip -S tmp/i386-mingw32/stage/lib/1.9/pkcs11_ext.so"
71
- end
72
- task 'copy:pkcs11_ext:i386-mingw32:2.0.0' do |t|
73
- sh "i686-w64-mingw32-strip -S tmp/i386-mingw32/stage/lib/2.0/pkcs11_ext.so"
74
- end
75
- task 'copy:pkcs11_ext:x64-mingw32:2.0.0' do |t|
76
- sh "x86_64-w64-mingw32-strip -S tmp/x64-mingw32/stage/lib/2.0/pkcs11_ext.so"
77
- end
69
+ # To reduce the gem file size strip mingw32 dlls before packaging
70
+ ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
71
+ task "tmp/x86-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pkcs11_ext.so" do |t|
72
+ sh "i686-w64-mingw32-strip -S tmp/x86-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pkcs11_ext.so"
73
+ end
78
74
 
75
+ task "tmp/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pkcs11_ext.so" do |t|
76
+ sh "x86_64-w64-mingw32-strip -S tmp/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/pkcs11_ext.so"
77
+ end
78
+ end
79
79
 
80
80
  task :docs_of_vendor_extensions do
81
81
  Dir['pkcs11_*'].each do |dir|
@@ -3,5 +3,5 @@ require "mkmf"
3
3
  basedir = File.dirname(__FILE__)
4
4
  $CPPFLAGS += " -I \"#{basedir}/include\""
5
5
  have_func("rb_str_set_len")
6
- have_func("rb_thread_blocking_region")
6
+ have_func("rb_thread_call_without_gvl")
7
7
  create_makefile("pkcs11_ext");
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # This quick and dirty parser for PKCS#11 functions generates
3
- # wrapper functions for using rb_thread_blocking_region()
4
- # of Ruby 1.9.
3
+ # wrapper functions for using rb_thread_call_without_gvl()
4
+ # of Ruby 1.9+
5
5
 
6
6
  require 'optparse'
7
7
 
@@ -26,11 +26,11 @@ fd_decl.puts <<-EOT
26
26
  #ifndef #{options.decl.gsub(/[^\w]/, "_").upcase}
27
27
  #define #{options.decl.gsub(/[^\w]/, "_").upcase}
28
28
  #include "pk11.h"
29
- #ifdef HAVE_RB_THREAD_BLOCKING_REGION
29
+ #ifdef HAVE_RB_THREAD_CALL_WITHOUT_GVL
30
30
  EOT
31
31
  fd_impl.puts <<-EOT
32
32
  #include #{File.basename(options.decl).inspect}
33
- #ifdef HAVE_RB_THREAD_BLOCKING_REGION
33
+ #ifdef HAVE_RB_THREAD_CALL_WITHOUT_GVL
34
34
  EOT
35
35
  ARGV.each do |file_h|
36
36
  c_src = IO.read(file_h)
@@ -48,14 +48,14 @@ ARGV.each do |file_h|
48
48
  struct { #{ func_params.map{|f| f.type+" "+f.name+";"}.join } } params;
49
49
  CK_RV retval;
50
50
  };
51
- VALUE tbf_#{func_name}( void *data );
52
-
51
+ void * tbf_#{func_name}( void *data );
52
+
53
53
  EOT
54
54
  fd_impl.puts <<-EOT
55
- VALUE tbf_#{func_name}( void *data ){
55
+ void * tbf_#{func_name}( void *data ){
56
56
  struct tbr_#{func_name}_params *p = (struct tbr_#{func_name}_params*)data;
57
57
  p->retval = p->func( #{func_params.map{|f| "p->params."+f.name}.join(",") } );
58
- return Qnil;
58
+ return NULL;
59
59
  }
60
60
 
61
61
  EOT
data/ext/pk11.c CHANGED
@@ -39,6 +39,11 @@ static VALUE aCK_MECHANISM_members;
39
39
 
40
40
  VALUE pkcs11_return_value_to_class(CK_RV, VALUE);
41
41
 
42
+ #if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
43
+ extern void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
44
+ rb_unblock_function_t *ubf, void *data2);
45
+ #endif
46
+
42
47
  static void
43
48
  pkcs11_raise(VALUE self, CK_RV rv)
44
49
  {
@@ -62,13 +67,13 @@ typedef struct {
62
67
  if (!sval) rb_raise(ePKCS11Error, #name " is not supported."); \
63
68
  }
64
69
 
65
- #ifdef HAVE_RB_THREAD_BLOCKING_REGION
70
+ #ifdef HAVE_RB_THREAD_CALL_WITHOUT_GVL
66
71
  #define CallFunction(name, func, rv, ...) \
67
72
  { \
68
73
  struct tbr_##name##_params params = { \
69
74
  func, {__VA_ARGS__}, CKR_FUNCTION_FAILED \
70
75
  }; \
71
- rb_thread_blocking_region(tbf_##name, &params, RUBY_UBF_PROCESS, 0); \
76
+ rb_thread_call_without_gvl(tbf_##name, &params, RUBY_UBF_PROCESS, NULL); \
72
77
  rv = params.retval; \
73
78
  }
74
79
 
@@ -158,7 +163,7 @@ pkcs11_load_library(VALUE self, VALUE path)
158
163
  const char *so_path;
159
164
  pkcs11_ctx *ctx;
160
165
 
161
- so_path = StringValuePtr(path);
166
+ so_path = StringValueCStr(path);
162
167
  Data_Get_Struct(self, pkcs11_ctx, ctx);
163
168
  #ifdef compile_for_windows
164
169
  if((ctx->module = LoadLibrary(so_path)) == NULL) {
@@ -166,7 +171,7 @@ pkcs11_load_library(VALUE self, VALUE path)
166
171
  FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,
167
172
  NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
168
173
  (LPTSTR)&error_text, sizeof(error_text), NULL);
169
- rb_raise(ePKCS11Error, error_text);
174
+ rb_raise(ePKCS11Error, "%s", error_text);
170
175
  }
171
176
  #else
172
177
  if((ctx->module = dlopen(so_path, RTLD_NOW)) == NULL) {
@@ -199,7 +204,7 @@ pkcs11_C_GetFunctionList(VALUE self)
199
204
  FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,
200
205
  NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
201
206
  (LPTSTR)&error_text, sizeof(error_text), NULL);
202
- rb_raise(ePKCS11Error, error_text);
207
+ rb_raise(ePKCS11Error, "%s", error_text);
203
208
  }
204
209
  #else
205
210
  func = (CK_C_GetFunctionList)dlsym(ctx->module, "C_GetFunctionList");
@@ -375,7 +380,7 @@ pkcs11_C_InitToken(VALUE self, VALUE slot_id, VALUE pin, VALUE label)
375
380
  CK_C_InitToken func;
376
381
 
377
382
  StringValue(pin);
378
- StringValue(label);
383
+ StringValueCStr(label);
379
384
  GetFunction(self, C_InitToken, func);
380
385
  CallFunction(C_InitToken, func, rv, NUM2HANDLE(slot_id),
381
386
  (CK_UTF8CHAR_PTR)RSTRING_PTR(pin), RSTRING_LEN(pin),
@@ -1,411 +1,411 @@
1
1
  #include "pk11_thread_funcs.h"
2
- #ifdef HAVE_RB_THREAD_BLOCKING_REGION
3
- VALUE tbf_C_Initialize( void *data ){
2
+ #ifdef HAVE_RB_THREAD_CALL_WITHOUT_GVL
3
+ void * tbf_C_Initialize( void *data ){
4
4
  struct tbr_C_Initialize_params *p = (struct tbr_C_Initialize_params*)data;
5
5
  p->retval = p->func( p->params.pInitArgs );
6
- return Qnil;
6
+ return NULL;
7
7
  }
8
8
 
9
- VALUE tbf_C_Finalize( void *data ){
9
+ void * tbf_C_Finalize( void *data ){
10
10
  struct tbr_C_Finalize_params *p = (struct tbr_C_Finalize_params*)data;
11
11
  p->retval = p->func( p->params.pReserved );
12
- return Qnil;
12
+ return NULL;
13
13
  }
14
14
 
15
- VALUE tbf_C_GetInfo( void *data ){
15
+ void * tbf_C_GetInfo( void *data ){
16
16
  struct tbr_C_GetInfo_params *p = (struct tbr_C_GetInfo_params*)data;
17
17
  p->retval = p->func( p->params.pInfo );
18
- return Qnil;
18
+ return NULL;
19
19
  }
20
20
 
21
- VALUE tbf_C_GetFunctionList( void *data ){
21
+ void * tbf_C_GetFunctionList( void *data ){
22
22
  struct tbr_C_GetFunctionList_params *p = (struct tbr_C_GetFunctionList_params*)data;
23
23
  p->retval = p->func( p->params.ppFunctionList );
24
- return Qnil;
24
+ return NULL;
25
25
  }
26
26
 
27
- VALUE tbf_C_GetSlotList( void *data ){
27
+ void * tbf_C_GetSlotList( void *data ){
28
28
  struct tbr_C_GetSlotList_params *p = (struct tbr_C_GetSlotList_params*)data;
29
29
  p->retval = p->func( p->params.tokenPresent,p->params.pSlotList,p->params.pulCount );
30
- return Qnil;
30
+ return NULL;
31
31
  }
32
32
 
33
- VALUE tbf_C_GetSlotInfo( void *data ){
33
+ void * tbf_C_GetSlotInfo( void *data ){
34
34
  struct tbr_C_GetSlotInfo_params *p = (struct tbr_C_GetSlotInfo_params*)data;
35
35
  p->retval = p->func( p->params.slotID,p->params.pInfo );
36
- return Qnil;
36
+ return NULL;
37
37
  }
38
38
 
39
- VALUE tbf_C_GetTokenInfo( void *data ){
39
+ void * tbf_C_GetTokenInfo( void *data ){
40
40
  struct tbr_C_GetTokenInfo_params *p = (struct tbr_C_GetTokenInfo_params*)data;
41
41
  p->retval = p->func( p->params.slotID,p->params.pInfo );
42
- return Qnil;
42
+ return NULL;
43
43
  }
44
44
 
45
- VALUE tbf_C_GetMechanismList( void *data ){
45
+ void * tbf_C_GetMechanismList( void *data ){
46
46
  struct tbr_C_GetMechanismList_params *p = (struct tbr_C_GetMechanismList_params*)data;
47
47
  p->retval = p->func( p->params.slotID,p->params.pMechanismList,p->params.pulCount );
48
- return Qnil;
48
+ return NULL;
49
49
  }
50
50
 
51
- VALUE tbf_C_GetMechanismInfo( void *data ){
51
+ void * tbf_C_GetMechanismInfo( void *data ){
52
52
  struct tbr_C_GetMechanismInfo_params *p = (struct tbr_C_GetMechanismInfo_params*)data;
53
53
  p->retval = p->func( p->params.slotID,p->params.type,p->params.pInfo );
54
- return Qnil;
54
+ return NULL;
55
55
  }
56
56
 
57
- VALUE tbf_C_InitToken( void *data ){
57
+ void * tbf_C_InitToken( void *data ){
58
58
  struct tbr_C_InitToken_params *p = (struct tbr_C_InitToken_params*)data;
59
59
  p->retval = p->func( p->params.slotID,p->params.pPin,p->params.ulPinLen,p->params.pLabel );
60
- return Qnil;
60
+ return NULL;
61
61
  }
62
62
 
63
- VALUE tbf_C_InitPIN( void *data ){
63
+ void * tbf_C_InitPIN( void *data ){
64
64
  struct tbr_C_InitPIN_params *p = (struct tbr_C_InitPIN_params*)data;
65
65
  p->retval = p->func( p->params.hSession,p->params.pPin,p->params.ulPinLen );
66
- return Qnil;
66
+ return NULL;
67
67
  }
68
68
 
69
- VALUE tbf_C_SetPIN( void *data ){
69
+ void * tbf_C_SetPIN( void *data ){
70
70
  struct tbr_C_SetPIN_params *p = (struct tbr_C_SetPIN_params*)data;
71
71
  p->retval = p->func( p->params.hSession,p->params.pOldPin,p->params.ulOldLen,p->params.pNewPin,p->params.ulNewLen );
72
- return Qnil;
72
+ return NULL;
73
73
  }
74
74
 
75
- VALUE tbf_C_OpenSession( void *data ){
75
+ void * tbf_C_OpenSession( void *data ){
76
76
  struct tbr_C_OpenSession_params *p = (struct tbr_C_OpenSession_params*)data;
77
77
  p->retval = p->func( p->params.slotID,p->params.flags,p->params.pApplication,p->params.Notify,p->params.phSession );
78
- return Qnil;
78
+ return NULL;
79
79
  }
80
80
 
81
- VALUE tbf_C_CloseSession( void *data ){
81
+ void * tbf_C_CloseSession( void *data ){
82
82
  struct tbr_C_CloseSession_params *p = (struct tbr_C_CloseSession_params*)data;
83
83
  p->retval = p->func( p->params.hSession );
84
- return Qnil;
84
+ return NULL;
85
85
  }
86
86
 
87
- VALUE tbf_C_CloseAllSessions( void *data ){
87
+ void * tbf_C_CloseAllSessions( void *data ){
88
88
  struct tbr_C_CloseAllSessions_params *p = (struct tbr_C_CloseAllSessions_params*)data;
89
89
  p->retval = p->func( p->params.slotID );
90
- return Qnil;
90
+ return NULL;
91
91
  }
92
92
 
93
- VALUE tbf_C_GetSessionInfo( void *data ){
93
+ void * tbf_C_GetSessionInfo( void *data ){
94
94
  struct tbr_C_GetSessionInfo_params *p = (struct tbr_C_GetSessionInfo_params*)data;
95
95
  p->retval = p->func( p->params.hSession,p->params.pInfo );
96
- return Qnil;
96
+ return NULL;
97
97
  }
98
98
 
99
- VALUE tbf_C_GetOperationState( void *data ){
99
+ void * tbf_C_GetOperationState( void *data ){
100
100
  struct tbr_C_GetOperationState_params *p = (struct tbr_C_GetOperationState_params*)data;
101
101
  p->retval = p->func( p->params.hSession,p->params.pOperationState,p->params.pulOperationStateLen );
102
- return Qnil;
102
+ return NULL;
103
103
  }
104
104
 
105
- VALUE tbf_C_SetOperationState( void *data ){
105
+ void * tbf_C_SetOperationState( void *data ){
106
106
  struct tbr_C_SetOperationState_params *p = (struct tbr_C_SetOperationState_params*)data;
107
107
  p->retval = p->func( p->params.hSession,p->params.pOperationState,p->params.ulOperationStateLen,p->params.hEncryptionKey,p->params.hAuthenticationKey );
108
- return Qnil;
108
+ return NULL;
109
109
  }
110
110
 
111
- VALUE tbf_C_Login( void *data ){
111
+ void * tbf_C_Login( void *data ){
112
112
  struct tbr_C_Login_params *p = (struct tbr_C_Login_params*)data;
113
113
  p->retval = p->func( p->params.hSession,p->params.userType,p->params.pPin,p->params.ulPinLen );
114
- return Qnil;
114
+ return NULL;
115
115
  }
116
116
 
117
- VALUE tbf_C_Logout( void *data ){
117
+ void * tbf_C_Logout( void *data ){
118
118
  struct tbr_C_Logout_params *p = (struct tbr_C_Logout_params*)data;
119
119
  p->retval = p->func( p->params.hSession );
120
- return Qnil;
120
+ return NULL;
121
121
  }
122
122
 
123
- VALUE tbf_C_CreateObject( void *data ){
123
+ void * tbf_C_CreateObject( void *data ){
124
124
  struct tbr_C_CreateObject_params *p = (struct tbr_C_CreateObject_params*)data;
125
125
  p->retval = p->func( p->params.hSession,p->params.pTemplate,p->params.ulCount,p->params.phObject );
126
- return Qnil;
126
+ return NULL;
127
127
  }
128
128
 
129
- VALUE tbf_C_CopyObject( void *data ){
129
+ void * tbf_C_CopyObject( void *data ){
130
130
  struct tbr_C_CopyObject_params *p = (struct tbr_C_CopyObject_params*)data;
131
131
  p->retval = p->func( p->params.hSession,p->params.hObject,p->params.pTemplate,p->params.ulCount,p->params.phNewObject );
132
- return Qnil;
132
+ return NULL;
133
133
  }
134
134
 
135
- VALUE tbf_C_DestroyObject( void *data ){
135
+ void * tbf_C_DestroyObject( void *data ){
136
136
  struct tbr_C_DestroyObject_params *p = (struct tbr_C_DestroyObject_params*)data;
137
137
  p->retval = p->func( p->params.hSession,p->params.hObject );
138
- return Qnil;
138
+ return NULL;
139
139
  }
140
140
 
141
- VALUE tbf_C_GetObjectSize( void *data ){
141
+ void * tbf_C_GetObjectSize( void *data ){
142
142
  struct tbr_C_GetObjectSize_params *p = (struct tbr_C_GetObjectSize_params*)data;
143
143
  p->retval = p->func( p->params.hSession,p->params.hObject,p->params.pulSize );
144
- return Qnil;
144
+ return NULL;
145
145
  }
146
146
 
147
- VALUE tbf_C_GetAttributeValue( void *data ){
147
+ void * tbf_C_GetAttributeValue( void *data ){
148
148
  struct tbr_C_GetAttributeValue_params *p = (struct tbr_C_GetAttributeValue_params*)data;
149
149
  p->retval = p->func( p->params.hSession,p->params.hObject,p->params.pTemplate,p->params.ulCount );
150
- return Qnil;
150
+ return NULL;
151
151
  }
152
152
 
153
- VALUE tbf_C_SetAttributeValue( void *data ){
153
+ void * tbf_C_SetAttributeValue( void *data ){
154
154
  struct tbr_C_SetAttributeValue_params *p = (struct tbr_C_SetAttributeValue_params*)data;
155
155
  p->retval = p->func( p->params.hSession,p->params.hObject,p->params.pTemplate,p->params.ulCount );
156
- return Qnil;
156
+ return NULL;
157
157
  }
158
158
 
159
- VALUE tbf_C_FindObjectsInit( void *data ){
159
+ void * tbf_C_FindObjectsInit( void *data ){
160
160
  struct tbr_C_FindObjectsInit_params *p = (struct tbr_C_FindObjectsInit_params*)data;
161
161
  p->retval = p->func( p->params.hSession,p->params.pTemplate,p->params.ulCount );
162
- return Qnil;
162
+ return NULL;
163
163
  }
164
164
 
165
- VALUE tbf_C_FindObjects( void *data ){
165
+ void * tbf_C_FindObjects( void *data ){
166
166
  struct tbr_C_FindObjects_params *p = (struct tbr_C_FindObjects_params*)data;
167
167
  p->retval = p->func( p->params.hSession,p->params.phObject,p->params.ulMaxObjectCount,p->params.pulObjectCount );
168
- return Qnil;
168
+ return NULL;
169
169
  }
170
170
 
171
- VALUE tbf_C_FindObjectsFinal( void *data ){
171
+ void * tbf_C_FindObjectsFinal( void *data ){
172
172
  struct tbr_C_FindObjectsFinal_params *p = (struct tbr_C_FindObjectsFinal_params*)data;
173
173
  p->retval = p->func( p->params.hSession );
174
- return Qnil;
174
+ return NULL;
175
175
  }
176
176
 
177
- VALUE tbf_C_EncryptInit( void *data ){
177
+ void * tbf_C_EncryptInit( void *data ){
178
178
  struct tbr_C_EncryptInit_params *p = (struct tbr_C_EncryptInit_params*)data;
179
179
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
180
- return Qnil;
180
+ return NULL;
181
181
  }
182
182
 
183
- VALUE tbf_C_Encrypt( void *data ){
183
+ void * tbf_C_Encrypt( void *data ){
184
184
  struct tbr_C_Encrypt_params *p = (struct tbr_C_Encrypt_params*)data;
185
185
  p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pEncryptedData,p->params.pulEncryptedDataLen );
186
- return Qnil;
186
+ return NULL;
187
187
  }
188
188
 
189
- VALUE tbf_C_EncryptUpdate( void *data ){
189
+ void * tbf_C_EncryptUpdate( void *data ){
190
190
  struct tbr_C_EncryptUpdate_params *p = (struct tbr_C_EncryptUpdate_params*)data;
191
191
  p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen,p->params.pEncryptedPart,p->params.pulEncryptedPartLen );
192
- return Qnil;
192
+ return NULL;
193
193
  }
194
194
 
195
- VALUE tbf_C_EncryptFinal( void *data ){
195
+ void * tbf_C_EncryptFinal( void *data ){
196
196
  struct tbr_C_EncryptFinal_params *p = (struct tbr_C_EncryptFinal_params*)data;
197
197
  p->retval = p->func( p->params.hSession,p->params.pLastEncryptedPart,p->params.pulLastEncryptedPartLen );
198
- return Qnil;
198
+ return NULL;
199
199
  }
200
200
 
201
- VALUE tbf_C_DecryptInit( void *data ){
201
+ void * tbf_C_DecryptInit( void *data ){
202
202
  struct tbr_C_DecryptInit_params *p = (struct tbr_C_DecryptInit_params*)data;
203
203
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
204
- return Qnil;
204
+ return NULL;
205
205
  }
206
206
 
207
- VALUE tbf_C_Decrypt( void *data ){
207
+ void * tbf_C_Decrypt( void *data ){
208
208
  struct tbr_C_Decrypt_params *p = (struct tbr_C_Decrypt_params*)data;
209
209
  p->retval = p->func( p->params.hSession,p->params.pEncryptedData,p->params.ulEncryptedDataLen,p->params.pData,p->params.pulDataLen );
210
- return Qnil;
210
+ return NULL;
211
211
  }
212
212
 
213
- VALUE tbf_C_DecryptUpdate( void *data ){
213
+ void * tbf_C_DecryptUpdate( void *data ){
214
214
  struct tbr_C_DecryptUpdate_params *p = (struct tbr_C_DecryptUpdate_params*)data;
215
215
  p->retval = p->func( p->params.hSession,p->params.pEncryptedPart,p->params.ulEncryptedPartLen,p->params.pPart,p->params.pulPartLen );
216
- return Qnil;
216
+ return NULL;
217
217
  }
218
218
 
219
- VALUE tbf_C_DecryptFinal( void *data ){
219
+ void * tbf_C_DecryptFinal( void *data ){
220
220
  struct tbr_C_DecryptFinal_params *p = (struct tbr_C_DecryptFinal_params*)data;
221
221
  p->retval = p->func( p->params.hSession,p->params.pLastPart,p->params.pulLastPartLen );
222
- return Qnil;
222
+ return NULL;
223
223
  }
224
224
 
225
- VALUE tbf_C_DigestInit( void *data ){
225
+ void * tbf_C_DigestInit( void *data ){
226
226
  struct tbr_C_DigestInit_params *p = (struct tbr_C_DigestInit_params*)data;
227
227
  p->retval = p->func( p->params.hSession,p->params.pMechanism );
228
- return Qnil;
228
+ return NULL;
229
229
  }
230
230
 
231
- VALUE tbf_C_Digest( void *data ){
231
+ void * tbf_C_Digest( void *data ){
232
232
  struct tbr_C_Digest_params *p = (struct tbr_C_Digest_params*)data;
233
233
  p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pDigest,p->params.pulDigestLen );
234
- return Qnil;
234
+ return NULL;
235
235
  }
236
236
 
237
- VALUE tbf_C_DigestUpdate( void *data ){
237
+ void * tbf_C_DigestUpdate( void *data ){
238
238
  struct tbr_C_DigestUpdate_params *p = (struct tbr_C_DigestUpdate_params*)data;
239
239
  p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen );
240
- return Qnil;
240
+ return NULL;
241
241
  }
242
242
 
243
- VALUE tbf_C_DigestKey( void *data ){
243
+ void * tbf_C_DigestKey( void *data ){
244
244
  struct tbr_C_DigestKey_params *p = (struct tbr_C_DigestKey_params*)data;
245
245
  p->retval = p->func( p->params.hSession,p->params.hKey );
246
- return Qnil;
246
+ return NULL;
247
247
  }
248
248
 
249
- VALUE tbf_C_DigestFinal( void *data ){
249
+ void * tbf_C_DigestFinal( void *data ){
250
250
  struct tbr_C_DigestFinal_params *p = (struct tbr_C_DigestFinal_params*)data;
251
251
  p->retval = p->func( p->params.hSession,p->params.pDigest,p->params.pulDigestLen );
252
- return Qnil;
252
+ return NULL;
253
253
  }
254
254
 
255
- VALUE tbf_C_SignInit( void *data ){
255
+ void * tbf_C_SignInit( void *data ){
256
256
  struct tbr_C_SignInit_params *p = (struct tbr_C_SignInit_params*)data;
257
257
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
258
- return Qnil;
258
+ return NULL;
259
259
  }
260
260
 
261
- VALUE tbf_C_Sign( void *data ){
261
+ void * tbf_C_Sign( void *data ){
262
262
  struct tbr_C_Sign_params *p = (struct tbr_C_Sign_params*)data;
263
263
  p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pSignature,p->params.pulSignatureLen );
264
- return Qnil;
264
+ return NULL;
265
265
  }
266
266
 
267
- VALUE tbf_C_SignUpdate( void *data ){
267
+ void * tbf_C_SignUpdate( void *data ){
268
268
  struct tbr_C_SignUpdate_params *p = (struct tbr_C_SignUpdate_params*)data;
269
269
  p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen );
270
- return Qnil;
270
+ return NULL;
271
271
  }
272
272
 
273
- VALUE tbf_C_SignFinal( void *data ){
273
+ void * tbf_C_SignFinal( void *data ){
274
274
  struct tbr_C_SignFinal_params *p = (struct tbr_C_SignFinal_params*)data;
275
275
  p->retval = p->func( p->params.hSession,p->params.pSignature,p->params.pulSignatureLen );
276
- return Qnil;
276
+ return NULL;
277
277
  }
278
278
 
279
- VALUE tbf_C_SignRecoverInit( void *data ){
279
+ void * tbf_C_SignRecoverInit( void *data ){
280
280
  struct tbr_C_SignRecoverInit_params *p = (struct tbr_C_SignRecoverInit_params*)data;
281
281
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
282
- return Qnil;
282
+ return NULL;
283
283
  }
284
284
 
285
- VALUE tbf_C_SignRecover( void *data ){
285
+ void * tbf_C_SignRecover( void *data ){
286
286
  struct tbr_C_SignRecover_params *p = (struct tbr_C_SignRecover_params*)data;
287
287
  p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pSignature,p->params.pulSignatureLen );
288
- return Qnil;
288
+ return NULL;
289
289
  }
290
290
 
291
- VALUE tbf_C_VerifyInit( void *data ){
291
+ void * tbf_C_VerifyInit( void *data ){
292
292
  struct tbr_C_VerifyInit_params *p = (struct tbr_C_VerifyInit_params*)data;
293
293
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
294
- return Qnil;
294
+ return NULL;
295
295
  }
296
296
 
297
- VALUE tbf_C_Verify( void *data ){
297
+ void * tbf_C_Verify( void *data ){
298
298
  struct tbr_C_Verify_params *p = (struct tbr_C_Verify_params*)data;
299
299
  p->retval = p->func( p->params.hSession,p->params.pData,p->params.ulDataLen,p->params.pSignature,p->params.ulSignatureLen );
300
- return Qnil;
300
+ return NULL;
301
301
  }
302
302
 
303
- VALUE tbf_C_VerifyUpdate( void *data ){
303
+ void * tbf_C_VerifyUpdate( void *data ){
304
304
  struct tbr_C_VerifyUpdate_params *p = (struct tbr_C_VerifyUpdate_params*)data;
305
305
  p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen );
306
- return Qnil;
306
+ return NULL;
307
307
  }
308
308
 
309
- VALUE tbf_C_VerifyFinal( void *data ){
309
+ void * tbf_C_VerifyFinal( void *data ){
310
310
  struct tbr_C_VerifyFinal_params *p = (struct tbr_C_VerifyFinal_params*)data;
311
311
  p->retval = p->func( p->params.hSession,p->params.pSignature,p->params.ulSignatureLen );
312
- return Qnil;
312
+ return NULL;
313
313
  }
314
314
 
315
- VALUE tbf_C_VerifyRecoverInit( void *data ){
315
+ void * tbf_C_VerifyRecoverInit( void *data ){
316
316
  struct tbr_C_VerifyRecoverInit_params *p = (struct tbr_C_VerifyRecoverInit_params*)data;
317
317
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hKey );
318
- return Qnil;
318
+ return NULL;
319
319
  }
320
320
 
321
- VALUE tbf_C_VerifyRecover( void *data ){
321
+ void * tbf_C_VerifyRecover( void *data ){
322
322
  struct tbr_C_VerifyRecover_params *p = (struct tbr_C_VerifyRecover_params*)data;
323
323
  p->retval = p->func( p->params.hSession,p->params.pSignature,p->params.ulSignatureLen,p->params.pData,p->params.pulDataLen );
324
- return Qnil;
324
+ return NULL;
325
325
  }
326
326
 
327
- VALUE tbf_C_DigestEncryptUpdate( void *data ){
327
+ void * tbf_C_DigestEncryptUpdate( void *data ){
328
328
  struct tbr_C_DigestEncryptUpdate_params *p = (struct tbr_C_DigestEncryptUpdate_params*)data;
329
329
  p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen,p->params.pEncryptedPart,p->params.pulEncryptedPartLen );
330
- return Qnil;
330
+ return NULL;
331
331
  }
332
332
 
333
- VALUE tbf_C_DecryptDigestUpdate( void *data ){
333
+ void * tbf_C_DecryptDigestUpdate( void *data ){
334
334
  struct tbr_C_DecryptDigestUpdate_params *p = (struct tbr_C_DecryptDigestUpdate_params*)data;
335
335
  p->retval = p->func( p->params.hSession,p->params.pEncryptedPart,p->params.ulEncryptedPartLen,p->params.pPart,p->params.pulPartLen );
336
- return Qnil;
336
+ return NULL;
337
337
  }
338
338
 
339
- VALUE tbf_C_SignEncryptUpdate( void *data ){
339
+ void * tbf_C_SignEncryptUpdate( void *data ){
340
340
  struct tbr_C_SignEncryptUpdate_params *p = (struct tbr_C_SignEncryptUpdate_params*)data;
341
341
  p->retval = p->func( p->params.hSession,p->params.pPart,p->params.ulPartLen,p->params.pEncryptedPart,p->params.pulEncryptedPartLen );
342
- return Qnil;
342
+ return NULL;
343
343
  }
344
344
 
345
- VALUE tbf_C_DecryptVerifyUpdate( void *data ){
345
+ void * tbf_C_DecryptVerifyUpdate( void *data ){
346
346
  struct tbr_C_DecryptVerifyUpdate_params *p = (struct tbr_C_DecryptVerifyUpdate_params*)data;
347
347
  p->retval = p->func( p->params.hSession,p->params.pEncryptedPart,p->params.ulEncryptedPartLen,p->params.pPart,p->params.pulPartLen );
348
- return Qnil;
348
+ return NULL;
349
349
  }
350
350
 
351
- VALUE tbf_C_GenerateKey( void *data ){
351
+ void * tbf_C_GenerateKey( void *data ){
352
352
  struct tbr_C_GenerateKey_params *p = (struct tbr_C_GenerateKey_params*)data;
353
353
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.pTemplate,p->params.ulCount,p->params.phKey );
354
- return Qnil;
354
+ return NULL;
355
355
  }
356
356
 
357
- VALUE tbf_C_GenerateKeyPair( void *data ){
357
+ void * tbf_C_GenerateKeyPair( void *data ){
358
358
  struct tbr_C_GenerateKeyPair_params *p = (struct tbr_C_GenerateKeyPair_params*)data;
359
359
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.pPublicKeyTemplate,p->params.ulPublicKeyAttributeCount,p->params.pPrivateKeyTemplate,p->params.ulPrivateKeyAttributeCount,p->params.phPublicKey,p->params.phPrivateKey );
360
- return Qnil;
360
+ return NULL;
361
361
  }
362
362
 
363
- VALUE tbf_C_WrapKey( void *data ){
363
+ void * tbf_C_WrapKey( void *data ){
364
364
  struct tbr_C_WrapKey_params *p = (struct tbr_C_WrapKey_params*)data;
365
365
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hWrappingKey,p->params.hKey,p->params.pWrappedKey,p->params.pulWrappedKeyLen );
366
- return Qnil;
366
+ return NULL;
367
367
  }
368
368
 
369
- VALUE tbf_C_UnwrapKey( void *data ){
369
+ void * tbf_C_UnwrapKey( void *data ){
370
370
  struct tbr_C_UnwrapKey_params *p = (struct tbr_C_UnwrapKey_params*)data;
371
371
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hUnwrappingKey,p->params.pWrappedKey,p->params.ulWrappedKeyLen,p->params.pTemplate,p->params.ulAttributeCount,p->params.phKey );
372
- return Qnil;
372
+ return NULL;
373
373
  }
374
374
 
375
- VALUE tbf_C_DeriveKey( void *data ){
375
+ void * tbf_C_DeriveKey( void *data ){
376
376
  struct tbr_C_DeriveKey_params *p = (struct tbr_C_DeriveKey_params*)data;
377
377
  p->retval = p->func( p->params.hSession,p->params.pMechanism,p->params.hBaseKey,p->params.pTemplate,p->params.ulAttributeCount,p->params.phKey );
378
- return Qnil;
378
+ return NULL;
379
379
  }
380
380
 
381
- VALUE tbf_C_SeedRandom( void *data ){
381
+ void * tbf_C_SeedRandom( void *data ){
382
382
  struct tbr_C_SeedRandom_params *p = (struct tbr_C_SeedRandom_params*)data;
383
383
  p->retval = p->func( p->params.hSession,p->params.pSeed,p->params.ulSeedLen );
384
- return Qnil;
384
+ return NULL;
385
385
  }
386
386
 
387
- VALUE tbf_C_GenerateRandom( void *data ){
387
+ void * tbf_C_GenerateRandom( void *data ){
388
388
  struct tbr_C_GenerateRandom_params *p = (struct tbr_C_GenerateRandom_params*)data;
389
389
  p->retval = p->func( p->params.hSession,p->params.RandomData,p->params.ulRandomLen );
390
- return Qnil;
390
+ return NULL;
391
391
  }
392
392
 
393
- VALUE tbf_C_GetFunctionStatus( void *data ){
393
+ void * tbf_C_GetFunctionStatus( void *data ){
394
394
  struct tbr_C_GetFunctionStatus_params *p = (struct tbr_C_GetFunctionStatus_params*)data;
395
395
  p->retval = p->func( p->params.hSession );
396
- return Qnil;
396
+ return NULL;
397
397
  }
398
398
 
399
- VALUE tbf_C_CancelFunction( void *data ){
399
+ void * tbf_C_CancelFunction( void *data ){
400
400
  struct tbr_C_CancelFunction_params *p = (struct tbr_C_CancelFunction_params*)data;
401
401
  p->retval = p->func( p->params.hSession );
402
- return Qnil;
402
+ return NULL;
403
403
  }
404
404
 
405
- VALUE tbf_C_WaitForSlotEvent( void *data ){
405
+ void * tbf_C_WaitForSlotEvent( void *data ){
406
406
  struct tbr_C_WaitForSlotEvent_params *p = (struct tbr_C_WaitForSlotEvent_params*)data;
407
407
  p->retval = p->func( p->params.flags,p->params.pSlot,p->params.pRserved );
408
- return Qnil;
408
+ return NULL;
409
409
  }
410
410
 
411
411
  #endif