1

I'm busy creating a server and software to remotely read out the data from a European Tachograph (Digital and smart). Everything so far works great but I have one strange problem.

When a new "remote tacho download" starts. I first request the ATR from the company smart card which I send to the tachograph. He processes it, and requests other stuff from the smart card. Some APDUs go up and down to each other and eventually the process is halted because of an error from the smart card. The error code "6A88" is returned. In other words, referenced data is not found. This always happends (with this tachograph + company card). Below you see the order of all commands:

  1. smartcard: 3BDF960080B1FE451F870031C16408923201738421E0059000C5 (gives atr)
  2. TACHO: 00A4020C020002 (selects some file)
  3. smartcard answer: 9000 (understood, ok)
  4. TACHO: 00B0000009 (read 9 bytes)
  5. smartcard answer: 0001036F1A042104309000 ( the bytes requested)
  6. TACHO: 00A4040C06FF544143484F (select a DF)
  7. smartcard answer: 9000 (understood, ok)
  8. TACHO: 00A4020C020501 (select some EF)
  9. smartcard answer: 9000 (understood, ok)
  10. TACHO: 00B0000001 (read one byte)
  11. smartcard answer: 04 (the byte)
  12. TACHO: 0022C1B60A8308001837DE0214FFA1 (manage the security environment command)
  13. smartcard answer: 6A88 (referenced data not found)

Everything here is automated. As fas as I can tell there are no errors in the communication between a device and the tachograph, or the PCSC software and the smart card. If there where, the first few apdus would have gone wrong anyhow. It always stops at the 12th command from the list above. We are out of ideas...

Anybody has any clue what to do about it?

Oscar K
  • 185
  • 1
  • 11
  • The chance you will find an answer here to a specific question with a specific smart card is very small. You will have more luck if you take the issue with those who make the card and load the applet in it. – Dialecticus Apr 20 '21 at 13:40
  • 1
    There is some information [here](https://stackoverflow.com/a/23982886/15299500), but I don't know if it applies to your case or not. – samuei Apr 20 '21 at 13:45
  • 1
    It is a key issue. Doesn't look like you unlocked card properly. See page 225 of https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:02016R0799-20180417&from=ES&force_isolation=true – jdweng Apr 20 '21 at 13:58
  • @jdweng yes, but the unlocking or the reading of the card is not to be done by the software. We just have special inhouse engineered device connected to the tachographs data line (k8 I believe? not sure) that reads out the commands from the tachograph, sending it to my software, which sends it to the card and sends the response back etc etc. Do you mean that I would manually have to unlock a card then? That's not needed when you put them physically in the device either right? But i'll read what you've send me. thanks – Oscar K Apr 20 '21 at 14:04
  • 1
    I work with smart cards that are mounted as a file system. Putting a card into the reader the card does not automatically get unlocked. When I use File Explorer then windows checks the card and if locked will get the certificate and unlock the card. Once a card is unlocked it will stay unlocked until it is removed from the reader. – jdweng Apr 20 '21 at 14:33
  • @jdweng We may have found a solution based on some other part of the document you send me. I'll keep you updated. Thanks for the info. – Oscar K Apr 20 '21 at 14:38
  • 1
    @jdweng We have found a solution. Turns out the other programmer didn't program the device right. the error code was not send in full to the tachograph so the tachograph didn't respond. After sending the full errorcode, the tachograph knew exactly what to do and all following commands where executed properly. Thanks everybody for the help. – Oscar K Apr 21 '21 at 15:01
  • @Dialecticus It seems that at least 2/3rd of them get an answer. So that's a bit of an overstatement. But I agree that it is often hard to debug specific problems. – Maarten Bodewes Apr 21 '21 at 22:23
  • Agreed, but we where out of options, so I thought, why not give it a shot. – Oscar K Apr 22 '21 at 13:19

0 Answers0