10
0
Fork 0

merge with upstream

This commit is contained in:
Kevin Redon 2021-04-06 13:40:23 +02:00
commit 2112cbccb5
10 changed files with 26 additions and 26 deletions

View File

@ -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"

View File

@ -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

View File

@ -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)

View File

@ -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"

View File

@ -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 ==

View File

@ -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

View File

@ -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

View File

@ -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 :

View File

@ -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) :

View File

@ -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'