List keys returns the DEV key if exists.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2022-08-18 11:57:49 +02:00
parent 977aced343
commit 538b39386b
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -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];