Adding INS F1 to get version.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -1695,6 +1695,13 @@ static int cmd_import_data() {
|
|||||||
return SW_OK();
|
return SW_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int cmd_version() {
|
||||||
|
res_APDU[res_APDU_size++] = PIPGP_VERSION_MAJOR;
|
||||||
|
res_APDU[res_APDU_size++] = PIPGP_VERSION_MINOR;
|
||||||
|
res_APDU[res_APDU_size++] = 0x0;
|
||||||
|
return SW_OK();
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct cmd
|
typedef struct cmd
|
||||||
{
|
{
|
||||||
uint8_t ins;
|
uint8_t ins;
|
||||||
@@ -1715,6 +1722,7 @@ typedef struct cmd
|
|||||||
#define INS_PUT_DATA 0xDA
|
#define INS_PUT_DATA 0xDA
|
||||||
#define INS_IMPORT_DATA 0xDB
|
#define INS_IMPORT_DATA 0xDB
|
||||||
#define INS_TERMINATE_DF 0xE6
|
#define INS_TERMINATE_DF 0xE6
|
||||||
|
#define INS_VERSION 0xF1
|
||||||
|
|
||||||
static const cmd_t cmds[] = {
|
static const cmd_t cmds[] = {
|
||||||
{ INS_GET_DATA, cmd_get_data },
|
{ INS_GET_DATA, cmd_get_data },
|
||||||
@@ -1731,6 +1739,7 @@ static const cmd_t cmds[] = {
|
|||||||
{ INS_INTERNAL_AUT, cmd_internal_aut },
|
{ INS_INTERNAL_AUT, cmd_internal_aut },
|
||||||
{ INS_MSE, cmd_mse },
|
{ INS_MSE, cmd_mse },
|
||||||
{ INS_IMPORT_DATA, cmd_import_data },
|
{ INS_IMPORT_DATA, cmd_import_data },
|
||||||
|
{ INS_VERSION, cmd_version },
|
||||||
{ 0x00, 0x0}
|
{ 0x00, 0x0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,5 +23,11 @@
|
|||||||
#define OPGP_VERSION_MAJOR ((OPGP_VERSION >> 8) & 0xff)
|
#define OPGP_VERSION_MAJOR ((OPGP_VERSION >> 8) & 0xff)
|
||||||
#define OPGP_VERSION_MINOR (OPGP_VERSION & 0xff)
|
#define OPGP_VERSION_MINOR (OPGP_VERSION & 0xff)
|
||||||
|
|
||||||
|
|
||||||
|
#define PIPGP_VERSION 0x0106
|
||||||
|
|
||||||
|
#define PIPGP_VERSION_MAJOR ((PIPGP_VERSION >> 8) & 0xff)
|
||||||
|
#define PIPGP_VERSION_MINOR (PIPGP_VERSION & 0xff)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user