diff --git a/src/openpgp/cmd_get_data.c b/src/openpgp/cmd_get_data.c index 7c1d04d..ebce369 100644 --- a/src/openpgp/cmd_get_data.c +++ b/src/openpgp/cmd_get_data.c @@ -18,6 +18,8 @@ #include "openpgp.h" #include "asn1.h" +extern bool is_gpg; + int cmd_get_data() { if (apdu.nc > 0) { return SW_WRONG_LENGTH(); diff --git a/src/openpgp/files.c b/src/openpgp/files.c index 896b2ca..51ed59c 100644 --- a/src/openpgp/files.c +++ b/src/openpgp/files.c @@ -17,8 +17,6 @@ #include "files.h" -bool is_gpg = true; - extern const uint8_t openpgp_aid[]; extern const uint8_t openpgp_aid_full[]; diff --git a/src/openpgp/files.h b/src/openpgp/files.h index d08bdb7..2246481 100644 --- a/src/openpgp/files.h +++ b/src/openpgp/files.h @@ -163,6 +163,4 @@ #define EF_DEV_CONF 0x1122 -extern bool is_gpg; - #endif diff --git a/src/openpgp/management.c b/src/openpgp/management.c index c389f2c..cc4498d 100644 --- a/src/openpgp/management.c +++ b/src/openpgp/management.c @@ -22,6 +22,8 @@ #include "asn1.h" #include "management.h" +bool is_gpg = true; + int man_process_apdu(); int man_unload(); @@ -39,6 +41,7 @@ int man_select(app_t *a, uint8_t force) { res_APDU_size = strlen((char *) res_APDU); apdu.ne = res_APDU_size; init_piv(); + is_gpg = false; return PICOKEY_OK; } @@ -145,7 +148,6 @@ int man_process_apdu() { } for (const cmd_t *cmd = cmds; cmd->ins != 0x00; cmd++) { if (cmd->ins == INS(apdu)) { - is_gpg = false; int r = cmd->cmd_handler(); return r; }