Move is_gpg flag for fido2.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2025-12-07 20:35:08 +01:00
parent 90e77f7c61
commit 2a14c771cb
4 changed files with 5 additions and 5 deletions

View File

@@ -18,6 +18,8 @@
#include "openpgp.h" #include "openpgp.h"
#include "asn1.h" #include "asn1.h"
extern bool is_gpg;
int cmd_get_data() { int cmd_get_data() {
if (apdu.nc > 0) { if (apdu.nc > 0) {
return SW_WRONG_LENGTH(); return SW_WRONG_LENGTH();

View File

@@ -17,8 +17,6 @@
#include "files.h" #include "files.h"
bool is_gpg = true;
extern const uint8_t openpgp_aid[]; extern const uint8_t openpgp_aid[];
extern const uint8_t openpgp_aid_full[]; extern const uint8_t openpgp_aid_full[];

View File

@@ -163,6 +163,4 @@
#define EF_DEV_CONF 0x1122 #define EF_DEV_CONF 0x1122
extern bool is_gpg;
#endif #endif

View File

@@ -22,6 +22,8 @@
#include "asn1.h" #include "asn1.h"
#include "management.h" #include "management.h"
bool is_gpg = true;
int man_process_apdu(); int man_process_apdu();
int man_unload(); int man_unload();
@@ -39,6 +41,7 @@ int man_select(app_t *a, uint8_t force) {
res_APDU_size = strlen((char *) res_APDU); res_APDU_size = strlen((char *) res_APDU);
apdu.ne = res_APDU_size; apdu.ne = res_APDU_size;
init_piv(); init_piv();
is_gpg = false;
return PICOKEY_OK; return PICOKEY_OK;
} }
@@ -145,7 +148,6 @@ int man_process_apdu() {
} }
for (const cmd_t *cmd = cmds; cmd->ins != 0x00; cmd++) { for (const cmd_t *cmd = cmds; cmd->ins != 0x00; cmd++) {
if (cmd->ins == INS(apdu)) { if (cmd->ins == INS(apdu)) {
is_gpg = false;
int r = cmd->cmd_handler(); int r = cmd->cmd_handler();
return r; return r;
} }