mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-04-17 21:58:27 +00:00
Fix listing private keys and X509 certificates.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
ab6a081fdf
commit
41f0b53dd5
1 changed files with 7 additions and 3 deletions
10
sc_hsm.c
10
sc_hsm.c
|
|
@ -189,14 +189,18 @@ int parse_token_info(const file_t *f, int mode) {
|
|||
|
||||
static int cmd_list_keys()
|
||||
{
|
||||
file_t *f;
|
||||
//first CC
|
||||
for (int i = 0; i < dynamic_files; i++) {
|
||||
f = &dynamic_file[i];
|
||||
file_t *f = &dynamic_file[i];
|
||||
if ((f->fid & 0xff00) == (PRKD_PREFIX << 8)) {
|
||||
res_APDU[res_APDU_size++] = KEY_PREFIX;
|
||||
res_APDU[res_APDU_size++] = f->fid & 0xff;
|
||||
}
|
||||
else if ((f->fid & 0xff00) == (CD_PREFIX << 8)) {
|
||||
}
|
||||
//second CD
|
||||
for (int i = 0; i < dynamic_files; i++) {
|
||||
file_t *f = &dynamic_file[i];
|
||||
if ((f->fid & 0xff00) == (CD_PREFIX << 8)) {
|
||||
res_APDU[res_APDU_size++] = CD_PREFIX;
|
||||
res_APDU[res_APDU_size++] = f->fid & 0xff;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue