diff --git a/app/keycard/keycard_cmdset.c b/app/keycard/keycard_cmdset.c index e3f056f..6809ae2 100644 --- a/app/keycard/keycard_cmdset.c +++ b/app/keycard/keycard_cmdset.c @@ -84,6 +84,18 @@ app_err_t keycard_cmd_autopair(keycard_t* kc, const uint8_t* psk, pairing_t* pai return ERR_OK; } +app_err_t keycard_cmd_unpair(keycard_t* kc, uint8_t idx) { + APDU_RESET(&kc->apdu); + APDU_CLA(&kc->apdu) = 0x80; + APDU_INS(&kc->apdu) = 0x13; + APDU_P1(&kc->apdu) = idx; + APDU_P2(&kc->apdu) = 0; + + SC_BUF(data, 0); + + return securechannel_send_apdu(&kc->sc, &kc->ch, &kc->apdu, data, 0); +} + app_err_t keycard_cmd_verify_pin(keycard_t* kc, uint8_t* pin) { APDU_RESET(&kc->apdu); APDU_CLA(&kc->apdu) = 0x80; diff --git a/app/keycard/keycard_cmdset.h b/app/keycard/keycard_cmdset.h index 5ff66df..ea25c18 100644 --- a/app/keycard/keycard_cmdset.h +++ b/app/keycard/keycard_cmdset.h @@ -13,6 +13,7 @@ typedef enum { app_err_t keycard_cmd_select(keycard_t* kc, const uint8_t* aid, uint32_t len); app_err_t keycard_cmd_pair(keycard_t* kc, uint8_t step, uint8_t* data); app_err_t keycard_cmd_autopair(keycard_t* kc, const uint8_t* psk, pairing_t* pairing); +app_err_t keycard_cmd_unpair(keycard_t* kc, uint8_t idx); app_err_t keycard_cmd_verify_pin(keycard_t* kc, uint8_t* pin); app_err_t keycard_cmd_change_credential(keycard_t* kc, keycard_credentials_t type, uint8_t* credentials, uint8_t len); app_err_t keycard_cmd_unblock_pin(keycard_t* kc, uint8_t* pin, uint8_t* puk);