diff --git a/src/hsm/cmd_list_keys.c b/src/hsm/cmd_list_keys.c index 7ecb6e6..84a587f 100644 --- a/src/hsm/cmd_list_keys.c +++ b/src/hsm/cmd_list_keys.c @@ -16,9 +16,20 @@ */ #include "sc_hsm.h" +#include "files.h" int cmd_list_keys() { + /* First we send DEV private key */ + /* Both below conditions should be always TRUE */ + if (search_by_fid(EF_PRKD_DEV, NULL, SPECIFY_EF)) { + res_APDU[res_APDU_size++] = EF_PRKD_DEV >> 8; + res_APDU[res_APDU_size++] = EF_PRKD_DEV & 0xff; + } + if (search_by_fid(EF_KEY_DEV, NULL, SPECIFY_EF)) { + res_APDU[res_APDU_size++] = EF_KEY_DEV >> 8; + res_APDU[res_APDU_size++] = EF_KEY_DEV & 0xff; + } //first CC for (int i = 0; i < dynamic_files; i++) { file_t *f = &dynamic_file[i];