Commit Graph

1085 Commits

Author SHA1 Message Date
Christina Quast 0a0ca9fa81 Add resources for gdb and gcc 2015-03-13 12:35:12 +01:00
Christina Quast 2a823a4ad0 Unignore unused files 2015-03-13 12:31:06 +01:00
Christina Quast 391dc2eb43 Undefine possibility for USB trace info
Define USB_NO_DEBUG to undefine TRACE_DEBUG_WP and TRACE_INFO_WP
2015-03-13 12:02:31 +01:00
Christina Quast b4d1b9d937 gemalto USB card reader dump 2015-03-10 23:36:23 +01:00
Christina Quast ecfad8f75c changed select command to one supported by simcard 2015-03-10 23:35:11 +01:00
Christina Quast c63df595e5 Atmel lib bug fixed: param position off by one
Furthermore the debug output level is INFO instead of DEBUG now.
2015-03-10 23:32:45 +01:00
Christina Quast dba7b16b98 ccid.py should not stop when an error occurs 2015-03-10 17:58:54 +01:00
Christina Quast 32a90ac660 remove windows line endings in iso7816_4.c 2015-03-10 16:18:16 +01:00
Christina Quast 40544cacca ignore zwizwa example code and Baselibc symlink 2015-03-10 16:04:44 +01:00
Christina Quast e03630f593 Problematic check for smartcard pin in ISR
This is a bug and should be fixed:
The smartcard insertion detection does not work if we uncomment
the check. But on the other hand, pcscd detects a lot of erroneous
smartcard insertion and removal events.
2015-03-10 15:56:05 +01:00
Christina Quast 0757fff70b Bugfix: add header file for ccid reset pin 2015-03-10 15:54:34 +01:00
Christina Quast e4bd7c104d Removed comment about USART_Configure in iso7816_4.c 2015-03-10 15:52:49 +01:00
Christina Quast 2fcef41c90 Reference to reset pin passed to ISO7816_Init 2015-03-10 15:51:21 +01:00
Christina Quast c5a78d72bf simtrace: wait until usb is configured 2015-03-10 15:37:52 +01:00
Christina Quast 917e0415c9 TODO notes for program 2015-03-10 15:34:00 +01:00
Christina Quast 7c9edfac25 Python script for serial usb card reader 2015-03-10 15:33:06 +01:00
Christina Quast 6838fb603d Remove atmel lib ccid targets from Makefile 2015-03-10 15:25:51 +01:00
Christina Quast 5ce38abd36 Moved code for select file cmd into function
The select command mostly works when the blue sysmocom SIM card is inserted,
but with the white SuperSIM we always get timeouts and invalid answers.
Furthermore the white card takes much longer to answer the requests than the
blue one.
So probably there is a timing issue.

Currently this is the simtrace output for select and reading IMSI, etc:
(pcscd must be running as welil, otherwise we get:
$ ./simtrace.py -S
Exception: Failed to establish context : Service not available.)

$ ./simtrace.py -S
Context established!
PCSC Readers: ['ATMEL AT91SO CCID Smart Card Reader [SIMtraceCCID] 00 00']
Using reader: ATMEL AT91SO CCID Smart Card Reader [SIMtraceCCID] 00 00
Connected with active protocol 1
Select: 0x6E 0x00
Command: 0x6D 0x00
Disconnected
Released context.
==> Expected answer for Select: 0x6D 0x00
(based on trying to execute this command with gemalto usb smart card reader)
The command works only every now and then

$ ./simtrace.py -b
pcsc: wait_for_card
Reading ...
Traceback (most recent call last):
  File "./simtrace.py", line 105, in <module>
    main()
  File "./simtrace.py", line 66, in main
    ccid.pySim_read()
  File "/home/chrysh/ba_thesis/sysmocom_repo/usb_application/ccid.py", line 22, in pySim_read
    (res, sw) = scc.read_binary(['3f00', '2fe2'])
  File "/home/chrysh/code/src/pysim/pySim/commands.py", line 42, in read_binary
    r = self.select_file(ef)
  File "/home/chrysh/code/src/pysim/pySim/commands.py", line 35, in select_file
    data, sw = self._tp.send_apdu_checksw("a0a4000002" + i)
  File "/home/chrysh/code/src/pysim/pySim/transport/__init__.py", line 87, in send_apdu_checksw
    raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1]))
RuntimeError: SW match failed ! Expected 9000 and got 9404.
==> Error code 9404 does not exist, which suggests that we actually have a timing issue when
communicating with the smart cart
2015-03-10 15:16:13 +01:00
Christina Quast 1a224af098 Re-fixed ATR error not send on reset 2015-03-10 15:11:37 +01:00
Christina Quast 53d94264ee gemalto: dump of select file and read further commands 2015-03-09 17:19:48 +01:00
Christina Quast c9c62ce7c7 dump: bug of usb select file request 2015-03-09 17:18:53 +01:00
Christina Quast 31b5b4ed93 renamed ccid reader select file python script
The command can be called now using the following command:
./simtrace -S
2015-03-09 17:17:14 +01:00
Christina Quast b58434eb2f Atr[3] is protocol, not Atr[5], right?
Also: Added debug information for command not supported
2015-03-09 17:13:07 +01:00
Christina Quast d89f4ee948 Ignore python bytecode files (pyc) 2015-03-09 16:44:11 +01:00
Christina Quast d065a4b59d moved config change code to simtrace.py 2015-03-06 19:12:55 +01:00
Christina Quast 71742c770c CCID reader general: does not work yet
Protocol type 0x2 not supported
2015-03-06 19:11:45 +01:00
Christina Quast f2582fc124 python simtrace suit: sniffer, ccid reader 2015-03-06 19:09:35 +01:00
Christina Quast 2dcaa10221 add kevins iccid, imsi, .. read commands 2015-03-06 18:14:43 +01:00
Christina Quast 60dce5d5fc Ignore .E, pycache, atmel_softpack lib files 2015-03-05 15:49:17 +01:00
Christina Quast 297f1a4d55 moved gitignore to root dir 2015-03-05 15:46:47 +01:00
Christina Quast 0166c6d64e Temporary fix: mitm mode use EP 4-6 2015-03-05 15:44:05 +01:00
Christina Quast b5ebebea0f main: configure red led, just in case 2015-03-05 15:43:01 +01:00
Christina Quast 541656cf60 Add CCID functions to func ptrs struct 2015-03-05 15:42:40 +01:00
Christina Quast 73e5658665 sniffer: removed debug write 2015-03-05 15:41:51 +01:00
Christina Quast 1bcac26786 removed atr buf in run func 2015-03-05 15:41:17 +01:00
Christina Quast 53a76082dc ccid: Get card atr in init 2015-03-04 19:01:34 +01:00
Christina Quast 8043fdd4d3 bus configuration in phone 2015-03-04 18:45:30 +01:00
Christina Quast 800019f0dd Fixed ccid define bug in board.h 2015-03-04 13:40:54 +01:00
Christina Quast 83628d41eb Added pin defines simcard power 2015-03-03 23:08:44 +01:00
Christina Quast f274a78e1a Send poweroff in ccid.py 2015-03-03 22:20:22 +01:00
Christina Quast db7b1abd17 CCID config, init, run
Switching to config 1 and 2 works, but to 3 and 4 usb_enum.py is
hanging for some reason. Switching the USB config from Sniffer to
CCID reader was not tested yet.
2015-03-03 12:34:54 +01:00
Christina Quast 4ba4d2230b sniffer functionality fixed buffer
It is possible to use sniffer.py to sniff the phone-simcard-communication.

To be fixed: The buffer size read is fixed and the data is only send
over USB if the buffer max length is reached. which means we don not
get the last bytes of the transaction.
This should be changed in one of the next commits. Maybe the former
simtrace code can give some inspiration on this topic.
2015-03-02 16:14:09 +01:00
Christina Quast cafde00218 conf initially sniff conf 2015-03-02 16:12:16 +01:00
Christina Quast 57e200539b python code usb config change 2015-03-02 16:10:04 +01:00
Christina Quast 763e5309a3 sniff of phone startup bytes 2015-03-02 16:09:45 +01:00
Christina Quast 9836933a27 python sniffer host side 2015-03-02 16:08:40 +01:00
Christina Quast 394b894da1 change naming for default bus switch config 2015-02-27 15:31:09 +01:00
Christina Quast da373fde1b Add input interrupt endpoint to all configurations 2015-02-27 15:26:26 +01:00
Christina Quast 6032e796b9 string descr 0 is language identifier 2015-02-27 15:22:25 +01:00
Christina Quast 33864fa36c Set default trace level to FATAL
Because to compile with a debug trace level you can simply type:
colormake TRACE_LEVEL=5
2015-02-27 13:41:34 +01:00