smartcard 0.4.0-x86-mswin32-60 → 0.4.1-x86-mswin32-60

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.4.1. Workaround ATR resend bug in JCOP simulator 3.2.7.
2
+
1
3
  v0.4.0. High-level functionality for ISO7816 cards.
2
4
 
3
5
  v0.3.2. Fixed documentation for ReaderStates class.
data/Manifest CHANGED
@@ -1,37 +1,37 @@
1
- BUILD
2
- CHANGELOG
3
- ext/smartcard_pcsc/extconf.rb
4
- ext/smartcard_pcsc/pcsc.h
5
- ext/smartcard_pcsc/pcsc_card.c
6
- ext/smartcard_pcsc/pcsc_constants.c
7
- ext/smartcard_pcsc/pcsc_context.c
8
- ext/smartcard_pcsc/pcsc_exception.c
9
- ext/smartcard_pcsc/pcsc_io_request.c
10
- ext/smartcard_pcsc/pcsc_main.c
11
- ext/smartcard_pcsc/pcsc_multi_strings.c
12
- ext/smartcard_pcsc/pcsc_namespace.c
13
- ext/smartcard_pcsc/pcsc_reader_states.c
14
- ext/smartcard_pcsc/pcsc_surrogate_reader.h
15
- ext/smartcard_pcsc/pcsc_surrogate_wintypes.h
16
- lib/smartcard/gp/gp_card_mixin.rb
17
- lib/smartcard/iso/auto_configurator.rb
18
- lib/smartcard/iso/iso_card_mixin.rb
19
- lib/smartcard/iso/jcop_remote_protocol.rb
20
- lib/smartcard/iso/jcop_remote_server.rb
21
- lib/smartcard/iso/jcop_remote_transport.rb
22
- lib/smartcard/iso/pcsc_transport.rb
23
- lib/smartcard/iso/transport.rb
24
- lib/smartcard/pcsc/pcsc_exception.rb
25
- lib/smartcard.rb
26
- LICENSE
27
- Manifest
28
- Rakefile
29
- README
30
- smartcard.gemspec
31
- test/gp/gp_card_mixin_test.rb
32
- test/iso/auto_configurator_test.rb
33
- test/iso/iso_card_mixin_test.rb
34
- test/iso/jcop_remote_test.rb
35
- test/pcsc/containers_test.rb
36
- test/pcsc/smoke_test.rb
37
- tests/ts_pcsc_ext.rb
1
+ BUILD
2
+ CHANGELOG
3
+ ext/smartcard_pcsc/extconf.rb
4
+ ext/smartcard_pcsc/pcsc.h
5
+ ext/smartcard_pcsc/pcsc_card.c
6
+ ext/smartcard_pcsc/pcsc_constants.c
7
+ ext/smartcard_pcsc/pcsc_context.c
8
+ ext/smartcard_pcsc/pcsc_exception.c
9
+ ext/smartcard_pcsc/pcsc_io_request.c
10
+ ext/smartcard_pcsc/pcsc_main.c
11
+ ext/smartcard_pcsc/pcsc_multi_strings.c
12
+ ext/smartcard_pcsc/pcsc_namespace.c
13
+ ext/smartcard_pcsc/pcsc_reader_states.c
14
+ ext/smartcard_pcsc/pcsc_surrogate_reader.h
15
+ ext/smartcard_pcsc/pcsc_surrogate_wintypes.h
16
+ lib/smartcard/gp/gp_card_mixin.rb
17
+ lib/smartcard/iso/auto_configurator.rb
18
+ lib/smartcard/iso/iso_card_mixin.rb
19
+ lib/smartcard/iso/jcop_remote_protocol.rb
20
+ lib/smartcard/iso/jcop_remote_server.rb
21
+ lib/smartcard/iso/jcop_remote_transport.rb
22
+ lib/smartcard/iso/pcsc_transport.rb
23
+ lib/smartcard/iso/transport.rb
24
+ lib/smartcard/pcsc/pcsc_exception.rb
25
+ lib/smartcard.rb
26
+ LICENSE
27
+ Manifest
28
+ Rakefile
29
+ README
30
+ smartcard.gemspec
31
+ test/gp/gp_card_mixin_test.rb
32
+ test/iso/auto_configurator_test.rb
33
+ test/iso/iso_card_mixin_test.rb
34
+ test/iso/jcop_remote_test.rb
35
+ test/pcsc/containers_test.rb
36
+ test/pcsc/smoke_test.rb
37
+ tests/ts_pcsc_ext.rb
@@ -28,7 +28,10 @@ class JcopRemoteTransport
28
28
  #
29
29
  def exchange_apdu(apdu)
30
30
  send_message @socket, :type => 1, :node => 0, :data => apdu
31
- recv_message(@socket)[:data]
31
+ loop do
32
+ message = recv_message @socket
33
+ return message[:data] if message[:type] == 1
34
+ end
32
35
  end
33
36
 
34
37
  # Makes a transport-level connection to the TEM.
Binary file
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{smartcard}
5
- s.version = "0.4.0"
5
+ s.version = "0.4.1"
6
6
  s.platform = %q{x86-mswin32-60}
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
@@ -48,7 +48,7 @@ class JcopRemoteTest < Test::Unit::TestCase
48
48
  @server.stop
49
49
  end
50
50
 
51
- def test_apdu_exchange
51
+ def _test_apdu_exchange
52
52
  apdu_request = [0x31, 0x41, 0x59, 0x26, 0x53]
53
53
  apdu_response = [0x27, 0x90, 0x00]
54
54
 
@@ -69,8 +69,25 @@ class JcopRemoteTest < Test::Unit::TestCase
69
69
  Kernel.sleep 0.05 # Wait for the server to process the disconnect.
70
70
  assert_equal [:start, apdu_request, :end], logic.received
71
71
  end
72
+
73
+ def test_apdu_exchange
74
+ _test_apdu_exchange
75
+ end
76
+
77
+ def test_apud_exchange_with_broken_server
78
+ # Test broken server which re-sends the ATR before any good message.
79
+ class << @server
80
+ def send_message(socket, message)
81
+ if message[:type] == 1
82
+ super socket, :type => 0, :node => 0, :data => (61..68).to_a
83
+ end
84
+ super socket, message
85
+ end
86
+ end
87
+ _test_apdu_exchange
88
+ end
72
89
 
73
- def test_java_card_integration
90
+ def test_iso_card_integration
74
91
  apdu_request = [0x00, 0x31, 0x41, 0x59, 0x00]
75
92
  apdu_response = [0x27, 0x90, 0x00]
76
93
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartcard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: x86-mswin32-60
6
6
  authors:
7
7
  - Victor Costan