smartcard 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.5.3. Fixed buggy protocol number decoding logic.
2
+
1
3
  v0.5.2. Added 'thread' require to fix crashes on new Rubygems versions.
2
4
 
3
5
  v0.5.1. Work around drivers that don't honor PROTOCOL_ANY.
@@ -36,8 +36,8 @@ class Card
36
36
 
37
37
  @context = context
38
38
  @sharing_mode = sharing_mode
39
- @_handle = handle_ptr[:value]
40
- set_protocol FFILib::Protocol[protocol_ptr[:value]]
39
+ @_handle = handle_ptr[:value]
40
+ set_protocol FFILib::PROTOCOLS[protocol_ptr[:value]]
41
41
  end
42
42
 
43
43
  # Updates internal buffers to reflect a change in the communication protocol.
@@ -268,7 +268,7 @@ class Card
268
268
  end
269
269
 
270
270
  { :readers => Context.decode_multi_string(readers_ptr),
271
- :protocol => FFILib::Protocol[protocol_ptr[:value]],
271
+ :protocol => FFILib::PROTOCOLS[protocol_ptr[:value]],
272
272
  :atr => atr_ptr.get_bytes(0, atr_length_ptr[:value]),
273
273
  :state => state }
274
274
  ensure
@@ -41,6 +41,9 @@ module FFILib
41
41
  layout :protocol, Word,
42
42
  :pci_length, Word
43
43
  end
44
+
45
+ # Protocol enum members, indexed by their numeric value.
46
+ PROTOCOLS = Protocol.to_h.invert
44
47
 
45
48
  # Global variables for IoRequests for protocols T=0, T=1, and RAW.
46
49
  begin
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{smartcard}
5
- s.version = "0.5.2"
5
+ s.version = "0.5.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Victor Costan"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartcard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 2
10
- version: 0.5.2
9
+ - 3
10
+ version: 0.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Victor Costan