Return a dedicated error if Ledger-PKI APDU received but feature not enabled

This commit is contained in:
Charles-Edouard de la Vergne
2024-08-02 16:43:08 +02:00
parent 2008307c0c
commit a32e86ffd4

View File

@@ -150,6 +150,15 @@ void handleApdu(unsigned int *flags, unsigned int *tx) {
BEGIN_TRY {
TRY {
#ifndef HAVE_LEDGER_PKI
if ((G_io_apdu_buffer[OFFSET_CLA] == 0xB0 && (G_io_apdu_buffer[OFFSET_INS] == 0x06))) {
// Ledger-PKI APDU not yet caught by the running OS.
// Command code not supported
PRINTF("Ledger-PKI not yet supported!\n");
THROW(0x911C);
}
#endif // HAVE_LEDGER_PKI
if (G_io_apdu_buffer[OFFSET_CLA] != CLA) {
THROW(0x6E00);
}