Fix AID selection.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -33,10 +33,13 @@ int u2f_unload();
|
|||||||
int u2f_process_apdu();
|
int u2f_process_apdu();
|
||||||
|
|
||||||
int u2f_select(app_t *a) {
|
int u2f_select(app_t *a) {
|
||||||
|
if (cap_supported(CAP_U2F)) {
|
||||||
a->process_apdu = u2f_process_apdu;
|
a->process_apdu = u2f_process_apdu;
|
||||||
a->unload = u2f_unload;
|
a->unload = u2f_unload;
|
||||||
return CCID_OK;
|
return CCID_OK;
|
||||||
}
|
}
|
||||||
|
return CCID_ERR_FILE_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
void __attribute__((constructor)) u2f_ctor() {
|
void __attribute__((constructor)) u2f_ctor() {
|
||||||
register_app(u2f_select, u2f_aid);
|
register_app(u2f_select, u2f_aid);
|
||||||
|
|||||||
@@ -55,10 +55,13 @@ const uint8_t atr_fido[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int fido_select(app_t *a) {
|
int fido_select(app_t *a) {
|
||||||
|
if (cap_supported(CAP_FIDO2)) {
|
||||||
a->process_apdu = fido_process_apdu;
|
a->process_apdu = fido_process_apdu;
|
||||||
a->unload = fido_unload;
|
a->unload = fido_unload;
|
||||||
return CCID_OK;
|
return CCID_OK;
|
||||||
}
|
}
|
||||||
|
return CCID_ERR_FILE_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
void __attribute__((constructor)) fido_ctor() {
|
void __attribute__((constructor)) fido_ctor() {
|
||||||
#if defined(USB_ITF_CCID) || defined(ENABLE_EMULATION)
|
#if defined(USB_ITF_CCID) || defined(ENABLE_EMULATION)
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ const uint8_t oath_aid[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int oath_select(app_t *a) {
|
int oath_select(app_t *a) {
|
||||||
|
if (cap_supported(CAP_OATH)) {
|
||||||
a->process_apdu = oath_process_apdu;
|
a->process_apdu = oath_process_apdu;
|
||||||
a->unload = oath_unload;
|
a->unload = oath_unload;
|
||||||
res_APDU_size = 0;
|
res_APDU_size = 0;
|
||||||
@@ -105,6 +106,8 @@ int oath_select(app_t *a) {
|
|||||||
apdu.ne = res_APDU_size;
|
apdu.ne = res_APDU_size;
|
||||||
return CCID_OK;
|
return CCID_OK;
|
||||||
}
|
}
|
||||||
|
return CCID_ERR_FILE_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
void __attribute__((constructor)) oath_ctor() {
|
void __attribute__((constructor)) oath_ctor() {
|
||||||
register_app(oath_select, oath_aid);
|
register_app(oath_select, oath_aid);
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ const uint8_t otp_aid[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int otp_select(app_t *a) {
|
int otp_select(app_t *a) {
|
||||||
|
if (cap_supported(CAP_OTP)) {
|
||||||
a->process_apdu = otp_process_apdu;
|
a->process_apdu = otp_process_apdu;
|
||||||
a->unload = otp_unload;
|
a->unload = otp_unload;
|
||||||
if (file_has_data(search_dynamic_file(EF_OTP_SLOT1)) ||
|
if (file_has_data(search_dynamic_file(EF_OTP_SLOT1)) ||
|
||||||
@@ -132,6 +133,8 @@ int otp_select(app_t *a) {
|
|||||||
apdu.ne = res_APDU_size;
|
apdu.ne = res_APDU_size;
|
||||||
return CCID_OK;
|
return CCID_OK;
|
||||||
}
|
}
|
||||||
|
return CCID_ERR_FILE_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t modhex_tab[] =
|
uint8_t modhex_tab[] =
|
||||||
{ 'c', 'b', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'r', 't', 'u', 'v' };
|
{ 'c', 'b', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'r', 't', 'u', 'v' };
|
||||||
|
|||||||
Reference in New Issue
Block a user