2020-06-27 13:24:04 +02:00
|
|
|
#include "shared_context.h"
|
|
|
|
|
#include "apdu_constants.h"
|
2020-10-20 15:22:22 +02:00
|
|
|
|
2020-06-27 13:24:04 +02:00
|
|
|
#include "ui_flow.h"
|
|
|
|
|
|
2020-12-01 16:20:13 +01:00
|
|
|
void handleGetAppConfiguration(uint8_t p1,
|
|
|
|
|
uint8_t p2,
|
2022-07-15 12:36:35 +02:00
|
|
|
const uint8_t *workBuffer,
|
2022-07-19 11:42:25 +02:00
|
|
|
uint8_t dataLength,
|
2020-12-01 16:20:13 +01:00
|
|
|
unsigned int *flags,
|
|
|
|
|
unsigned int *tx) {
|
|
|
|
|
UNUSED(p1);
|
|
|
|
|
UNUSED(p2);
|
|
|
|
|
UNUSED(workBuffer);
|
|
|
|
|
UNUSED(dataLength);
|
|
|
|
|
UNUSED(flags);
|
|
|
|
|
G_io_apdu_buffer[0] = (N_storage.dataAllowed ? APP_FLAG_DATA_ALLOWED : 0x00);
|
2020-06-27 13:24:04 +02:00
|
|
|
#ifndef HAVE_TOKENS_LIST
|
2020-12-01 16:20:13 +01:00
|
|
|
G_io_apdu_buffer[0] |= APP_FLAG_EXTERNAL_TOKEN_NEEDED;
|
2020-06-27 13:24:04 +02:00
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_STARKWARE
|
2020-12-01 16:20:13 +01:00
|
|
|
G_io_apdu_buffer[0] |= APP_FLAG_STARKWARE;
|
|
|
|
|
G_io_apdu_buffer[0] |= APP_FLAG_STARKWARE_V2;
|
2020-10-07 16:56:40 +02:00
|
|
|
#endif
|
2020-12-01 16:20:13 +01:00
|
|
|
G_io_apdu_buffer[1] = LEDGER_MAJOR_VERSION;
|
|
|
|
|
G_io_apdu_buffer[2] = LEDGER_MINOR_VERSION;
|
|
|
|
|
G_io_apdu_buffer[3] = LEDGER_PATCH_VERSION;
|
|
|
|
|
*tx = 4;
|
|
|
|
|
THROW(0x9000);
|
2020-06-27 13:24:04 +02:00
|
|
|
}
|