smartcard 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/lib/smartcard/iso/jcop_remote_transport.rb +4 -1
- data/smartcard.gemspec +2 -2
- data/test/iso/jcop_remote_test.rb +19 -2
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -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
|
-
|
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.
|
data/smartcard.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{smartcard}
|
5
|
-
s.version = "0.4.
|
5
|
+
s.version = "0.4.1"
|
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"]
|
9
|
-
s.date = %q{2009-08-
|
9
|
+
s.date = %q{2009-08-19}
|
10
10
|
s.description = %q{Interface with ISO 7816 smart cards.}
|
11
11
|
s.email = %q{victor@costan.us}
|
12
12
|
s.extensions = ["ext/smartcard_pcsc/extconf.rb"]
|
@@ -48,7 +48,7 @@ class JcopRemoteTest < Test::Unit::TestCase
|
|
48
48
|
@server.stop
|
49
49
|
end
|
50
50
|
|
51
|
-
def
|
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
|
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.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Costan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-19 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|