diff --git a/CHANGELOG.md b/CHANGELOG.md index c7428e5a0..85ded399d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Added `hf calypso info` command (@kormax) - Added ARM compilation support for picolibc, fixing compilation on Debian Forky (@doegox) - Added `hf mdfes leaf` command (@pcunning) - Added `hf mfdes vdesign` command (@kormax) diff --git a/client/src/cmdhfcalypso.c b/client/src/cmdhfcalypso.c index 1710fb4c7..416ec35e1 100644 --- a/client/src/cmdhfcalypso.c +++ b/client/src/cmdhfcalypso.c @@ -703,8 +703,22 @@ static int calypso_scan_aidlist(bool verbose, calypso_select_result_t *selected, } if (probe_matched) { - *selected = probe_selected; - *matched = true; + bool restored = false; + int res = calypso_select_aid(probe_selected.requested_aid, probe_selected.requested_aid_len, false, verbose, selected, &restored); + if (res != PM3_SUCCESS || restored == false) { + res = calypso_select_aid(probe_selected.requested_aid, probe_selected.requested_aid_len, true, verbose, selected, &restored); + } + if (res != PM3_SUCCESS) { + AIDSearchFree(root); + return res; + } + if (restored == false) { + if (verbose) { + PrintAndLogEx(DEBUG, "Unable to restore selected Calypso AID %s", sprint_hex_inrow(probe_selected.requested_aid, probe_selected.requested_aid_len)); + } + } else { + *matched = true; + } } AIDSearchFree(root);