Sign and Decrypt operations failing on new epass2003 devices but not on an older one
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start with the failing log entry in card-epass2003.c:2195 and compare the sign/decrypt behavior on the new and older epass2003 devices using the supplied pkcs15-init.exe and pkcs15-crypt.exe commands. Investigate the reported SW1=6F, SW2=83 response; done means identifying the cause and confirming sign and decrypt work on the new devices.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem Description
A set of recently manufactured epass2003 devices (sourced from Feitian) are erroring with Card command failed (1200) when attempting a sign or decrypt operation. An older epass2003 device initialized using the same procedure is performing correctly.
Proposed Resolution
Unclear what the problem is!
We've also reached out direct to Feitian, will update this issue if they come through with something, but I thought I'd try my luck here as well in case there is an OpenSC toolset change I've not spotted that could be causing this.
Steps to reproduce
On both devices, I have done the following procedure:
pkcs15-init.exe -E
pkcs15-init.exe -C --profile pkcs15+onepin --pin <pin> --puk <puk>
pkcs15-init.exe -G rsa/2048 -a 01 -i 01 --pin <pin> -u decrypt -u sign -l <label> --public-key-label <label>
Then, running this command:
pkcs15-crypt.exe -c --key 01 -p <pin> -i <signed file>
Produces the correct output on the old card, and Compute signature failed: Card command failed on the new ones. Same thing for the decipher operation. Public key is accessible and is the same format between the two cards.
Diffing the output of ./opensc-tool.exe -f had a difference in the serial numbers and in the final block which I assume is the public key data, otherwise everything else is the same. The old device had been previously initialized using an older version of OpenSC (0.16 I think) and had a much smaller file contents, but after erasing and re-init'ing the card in the new OpenSC version (0.23) it now looks the same.
OpenSC-0.23.0, rev: 5497519e, commit-time: 2022-11-29 09:34:43 +0100
Logs
<snip>
P:26832; T:28232 2023-08-25 16:45:09.564 [pkcs15-crypt] Unknown SWs; SW1=6F, SW2=83
P:26832; T:28232 2023-08-25 16:45:09.564 [pkcs15-crypt] card-epass2003.c:2195:epass2003_decipher: returning with: -1200 (Card command failed)
P:26832; T:28232 2023-08-25 16:45:09.564 [pkcs15-crypt] sec.c:66:sc_compute_signature: returning with: -1200 (Card command failed)
P:26832; T:28232 2023-08-25 16:45:09.564 [pkcs15-crypt] card.c:530:sc_unlock: called
P:26832; T:28232 2023-08-25 16:45:09.564 [pkcs15-crypt] reader-pcsc.c:740:pcsc_unlock: called
P:26832; T:28232 2023-08-25 16:45:09.580 [pkcs15-crypt] pkcs15-sec.c:169:use_key: returning with: -1200 (Card command failed)
P:26832; T:28232 2023-08-25 16:45:09.580 [pkcs15-crypt] pkcs15-sec.c:771:sc_pkcs15_compute_signature: use_key() failed: -1200 (Card command failed)
P:26832; T:28232 2023-08-25 16:45:09.580 [pkcs15-crypt] pkcs15-sec.c:784:sc_pkcs15_compute_signature: returning with: -1200 (Card command failed)
Compute signature failed: Card command failed
https://gist.github.com/drodgers-immt/eea221465190b979a37f95f96b60c263 for the full run log.
(Note that I have both the old and new smartcard connected to my system, I'm actually using -r <id> on the commands to target each one, but I left it out of the commands above to avoid confusion. Problem still occurs individually).
- Lenguaje dominante
- C
- Estrellas
- 3.1k
- Forks
- 858
- Merge medio
- 4 d 4 h
- PR fusionados (30 d)
- 16
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de OpenSC/OpenSC
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
OpenSC/OpenSC#3881 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
card lock not released in error pathPosiblemente ocupada @mvogt1 la tomó hace 7 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
Commit from 08.10.26 breaks cachingPosiblemente ocupada @mvogt1 la tomó hace 7 días. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
OpenSC/OpenSC#3878 · 7 comentarios ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
OpenSC/OpenSC#3864 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de OpenSC/OpenSC
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
gbdev/homebrewhub-submit#20 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
OpenPrinting/cups#1772 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
snowballstem/snowball#311 ·