9
0
Fork 0

merge with upstream

master
Kevin Redon 2 years ago
commit 2112cbccb5
  1. 2
      src/apdu_forward.rb
  2. 4
      src/copy_client.rb
  3. 14
      src/demo_client.rb
  4. 12
      src/demo_server.rb
  5. 4
      src/info_client.rb
  6. 6
      src/lib/apdu.rb
  7. 2
      src/pcsc_server.rb
  8. 2
      src/sap/client.rb
  9. 2
      src/sap/server.rb
  10. 4
      src/simos_server.rb

@ -19,7 +19,7 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this programm will forward APDU from an IO to a SAP server
require './sap/client.rb'
require_relative 'sap/client'
require 'socket'
SAP_HOST = "localhost"

@ -18,8 +18,8 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this class copies all files from the SIM to an xml file
require './sap/client.rb'
require './lib/apdu.rb'
require_relative 'sap/client'
require_relative 'lib/apdu'
require 'xml'
class Copy

@ -19,10 +19,10 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this programm will create a client which can be used to test servers
require './sap/client.rb'
require './lib/apdu.rb'
require './info_client.rb'
require './copy_client.rb'
require_relative 'sap/client'
require_relative 'lib/apdu'
require_relative 'info_client'
require_relative 'copy_client'
#=============
#== default ==
@ -31,13 +31,13 @@ require './copy_client.rb'
# client use (demo,info,copy)
@type = "demo"
# which IO to use (tcp,unix,bt)
@socket = "tcp"
@socket = "unix"
# tcp port
@port = 1337
# tcp host
@host = "localhost"
# unix socket
@unix = "/tmp/sap.socket"
@unix = "/tmp/osmocom_sap"
# file were to save the copy
@file = "sim.xml"
# bluetooth rfcomm serial port
@ -131,7 +131,7 @@ when "bt"
if @bt then
io = SerialPort.new(@bt)
else
require './tools/bluetooth_sap_serial.rb'
require_relative 'tools/bluetooth_sap_serial'
bt = BluetoothSAPSerial.new
# using SerialPort because reading the File does not work (have to find right stty options)
io = SerialPort.new(bt.connect)

@ -27,11 +27,11 @@ Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
# the server to use (pcsc,sim)
@type = "pcsc"
# which IO to use (tcp,unix)
@socket = "tcp"
@socket = "unix"
# tcp port
@port = 1337
# unix socket
@unix = "/tmp/sap.socket"
@unix = "/tmp/osmocom_sap"
# sim file
@file = "sim.xml"
# the verbosity (from common)
@ -99,6 +99,10 @@ when "tcp"
socket = TCPServer.new("0.0.0.0",@port)
when "unix"
require 'socket'
if File.exists?(@unix)
puts 'Previous socket exists, deleting it...'
File.delete(@unix)
end
socket = UNIXServer.new(@unix)
else
raise "please defined which socket to use"
@ -108,10 +112,10 @@ io = socket.accept
case @type
when "pcsc"
require './pcsc_server.rb'
require_relative 'pcsc_server'
server = PCSCServer.new(io)
when "sim"
require './simos_server.rb'
require_relative 'simos_server'
server = SIMServer.new(io)
else
raise "unkown server type"

@ -19,8 +19,8 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this programm will display information stored in the SIM
require './sap/client.rb'
require './lib/apdu.rb'
require_relative 'sap/client'
require_relative 'lib/apdu'
#=============
#== methods ==

@ -19,11 +19,7 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this librarie is to centralise the APDU related work
# required by ruby 1.8, but brakes 1.9
#$KCODE = 'UTF8'
#require 'jcode'
# this library is to centralise the APDU related work
# transform binary string into readable hex string
class String

@ -18,7 +18,7 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
require './sap/server.rb'
require_relative 'sap/server'
require 'rubygems'
require 'smartcard'
=begin

@ -19,7 +19,7 @@ Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
# this is the client part of the SAP
# it implements the state machine for the client
require './sap/common.rb'
require_relative 'common'
# this is an abstract class
# TODO :

@ -20,7 +20,7 @@ Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
# this is the server part of the SAP
# it implements the state machine for the server
# this is an abstract class
require './sap/common.rb'
require_relative 'common'
# this is an bastract class
# TODO (not implemented) :

@ -18,8 +18,8 @@ along with sofSIM. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Kevin "tsaitgaist" Redon kevredon@mail.tsaitgaist.info
=end
require './sap/server.rb'
require './lib/apdu.rb'
require_relative 'sap/server'
require_relative 'lib/apdu'
require 'socket'
require 'xml'

Loading…
Cancel
Save