Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to send a reset after every command #50

Closed
ua0lnj opened this issue Oct 28, 2021 · 5 comments
Closed

Need to send a reset after every command #50

ua0lnj opened this issue Oct 28, 2021 · 5 comments
Assignees

Comments

@ua0lnj
Copy link

ua0lnj commented Oct 28, 2021

Hi.
I have Compunicate paytv smart card.
It's detected fine.

Thu Oct 28 16:14:15 2021
 Reader 0: CASTLES EZCCID Smart Card Reader 00 00
  Event number: 0
  Card state: Card inserted, Exclusive Mode,
  ATR: 3B E9 00 00 81 31 C3 45 99 63 74 69 19 99 12 56 10 EC

ATR: 3B E9 00 00 81 31 C3 45 99 63 74 69 19 99 12 56 10 EC
+ TS = 3B --> Direct Convention
+ T0 = E9, Y(1): 1110, K: 9 (historical bytes)
  TB(1) = 00 --> VPP is not electrically connected
  TC(1) = 00 --> Extra guard time: 0
  TD(1) = 81 --> Y(i+1) = 1000, Protocol T = 1
-----
  TD(2) = 31 --> Y(i+1) = 0011, Protocol T = 1
-----
  TA(3) = C3 --> IFSC: 195
  TB(3) = 45 --> Block Waiting Integer: 4 - Character Waiting Integer: 5
+ Historical bytes: 99 63 74 69 19 99 12 56 10
  Category indicator byte: 99 (proprietary format)
+ TCK = EC (correct checksum)

Possibly identified card (using /root/.cache/smartcard_list.txt):
        NONE

Updating /root/.cache/smartcard_list.txt using https://ludovic.rousseau.free.fr/softwares/pcsc-tools/smartcard_list.txt

Possibly identified card (using /root/.cache/smartcard_list.txt):
        NONE

Your card is not present in the database.
Please submit your unknown card at:
https://smartcard-atr.appspot.com/parse?ATR=3BE900008131C345996374691999125610EC

If I send commands one by one, then I get an error:

root@ua0lnjserv:/usr/src# scriptor -r "CASTLES EZCCID Smart Card Reader 00 00"
Using given card reader: CASTLES EZCCID Smart Card Reader 00 00
Using T=1 protocol
Reading commands from STDIN
81 D0 00 01 08
> 81 D0 00 01 08
< 13 E3 F5 C6 CB 27 5F 37 90 00 : Normal processing.
81 C0 00 01 0A
> 81 C0 00 01 0A
Can't get info: Transaction failed.

But if I send a reset after each command, then everything works:

root@ua0lnjserv:/usr/src# scriptor -r "CASTLES EZCCID Smart Card Reader 00 00"
Using given card reader: CASTLES EZCCID Smart Card Reader 00 00
Using T=1 protocol
Reading commands from STDIN
81 D0 00 01 08
> 81 D0 00 01 08
< 13 E3 F5 C6 CB 27 5F 37 90 00 : Normal processing.
reset
> RESET
< OK: 3B E9 00 00 81 31 C3 45 99 63 74 69 19 99 12 56 10 EC
81 C0 00 01 0A
> 81 C0 00 01 0A
< 4A B0 90 00 : Normal processing.
reset
> RESET
< OK: 3B E9 00 00 81 31 C3 45 99 63 74 69 19 99 12 56 10 EC
81 D1 00 01 10
> 81 D1 00 01 10
< 00 18 EB 61 A1 D1 FA BF 30 30 30 30 30 30 30 30
90 00 : Normal processing.
^C

Is this a pcsc-tools problem or is this normal and need to send resets from a program that works with pcscd?

@LudovicRousseau
Copy link
Owner

FIrst I suggest you to update pcsc_scan https://ludovic.rousseau.free.fr/softwares/pcsc-tools/

I think it is a problem with your card or reader or reader driver.

@LudovicRousseau LudovicRousseau self-assigned this Oct 28, 2021
@ua0lnj
Copy link
Author

ua0lnj commented Oct 28, 2021

I use latest git.
And this problem is not mine alone.
I solved it with the patch for Oscam, but it may not be correct.
https://www.sat-universe.com/showthread.php?t=318592
https://board.streamboard.tv/forum/thread/47913-dgcrypt-0x4ab0/

@LudovicRousseau
Copy link
Owner

I am pretty sure you do NOT use a recent ATR_analysis command.
The message should be different. See https://github.com/LudovicRousseau/pcsc-tools/blob/master/ATR_analysis#L289

@ua0lnj
Copy link
Author

ua0lnj commented Oct 29, 2021

I added my cards.
The log from version 1.5.5 (ubuntu 20), but the version from the git works the same way.

@LudovicRousseau
Copy link
Owner

Closing since you solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants