Compare commits
1 Commits
fixeria/fi
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03f7de30df |
@@ -35,10 +35,10 @@ Use the hello-stk example to get started.
|
||||
|
||||
$ mkdir javacard
|
||||
$ cd javacard
|
||||
$ git clone https://git.osmocom.org/sim/sim-tools
|
||||
$ git clone https://git.osmocom.org/sim/hello-stk
|
||||
$ cd hello-stk
|
||||
$ make
|
||||
$ git submodule update --init --recursive
|
||||
$ ant
|
||||
|
||||
To install the applet onto a SIM card, first set the type of reader you are using.
|
||||
|
||||
|
||||
@@ -114,10 +114,10 @@ class AppLoaderCommands(object):
|
||||
# Padding if Ciphering is used
|
||||
if ((spi_1 & 0x04) != 0): # check ciphering bit
|
||||
len_cipher = 6 + len_sig + (len(data) / 2)
|
||||
# 8 Byte blocksize for DES-CBC (TODO: different padding)
|
||||
if len_cipher % 8 > 0:
|
||||
pad_cnt = 8 - (len_cipher % 8)
|
||||
data += '00' * pad_cnt
|
||||
pad_cnt = 8 - (len_cipher % 8) # 8 Byte blocksize for DES-CBC (TODO: different padding)
|
||||
# TODO: there is probably a better way to add "pad_cnt" padding bytes
|
||||
for i in range(0, pad_cnt):
|
||||
data = data + '00';
|
||||
|
||||
# CHL + SPI first octet
|
||||
part_head = ('%02x' % (0x0D + len_sig)) + ('%02x' % (spi_1))
|
||||
|
||||
Reference in New Issue
Block a user