diff --git a/src/pkcs15init/pkcs15-init.h b/src/pkcs15init/pkcs15-init.h index a5c6e031..3286cc81 100644 --- a/src/pkcs15init/pkcs15-init.h +++ b/src/pkcs15init/pkcs15-init.h @@ -155,6 +155,9 @@ struct sc_pkcs15init_operations { #define SC_PKCS15INIT_USER_PUK 3 #define SC_PKCS15INIT_NPINS 4 +#define SC_PKCS15INIT_MD_STYLE_NONE 0 +#define SC_PKCS15INIT_MD_STYLE_GEMALTO 1 + struct sc_pkcs15init_callbacks { /* * Get a PIN from the front-end. The first argument is diff --git a/src/pkcs15init/profile.c b/src/pkcs15init/profile.c index cbbfc81a..55a7f6c3 100644 --- a/src/pkcs15init/profile.c +++ b/src/pkcs15init/profile.c @@ -199,6 +199,11 @@ static struct map idStyleNames[] = { { "rfc2459", SC_PKCS15INIT_ID_STYLE_RFC2459 }, { NULL, 0 } }; +static struct map mdStyleNames[] = { + { "none", SC_PKCS15INIT_MD_STYLE_NONE }, + { "gemalto", SC_PKCS15INIT_MD_STYLE_GEMALTO }, + { NULL, 0 } +}; static struct { const char * name; struct map * addr; @@ -899,6 +904,12 @@ do_pkcs15_id_style(struct state *cur, int argc, char **argv) return map_str2int(cur, argv[0], &cur->profile->id_style, idStyleNames); } +static int +do_minidriver_support_style(struct state *cur, int argc, char **argv) +{ + return map_str2int(cur, argv[0], &cur->profile->md_style, mdStyleNames); +} + /* * Process an option block */ @@ -1777,10 +1788,11 @@ static struct command pi_commands[] = { * pkcs15 dialect section */ static struct command p15_commands[] = { - { "direct-certificates", 1, 1, do_direct_certificates }, - { "encode-df-length", 1, 1, do_encode_df_length }, - { "do-last-update", 1, 1, do_encode_update_field }, - { "pkcs15-id-style", 1, 1, do_pkcs15_id_style }, + { "direct-certificates", 1, 1, do_direct_certificates }, + { "encode-df-length", 1, 1, do_encode_df_length }, + { "do-last-update", 1, 1, do_encode_update_field }, + { "pkcs15-id-style", 1, 1, do_pkcs15_id_style }, + { "minidriver-support-style", 1, 1, do_minidriver_support_style }, { NULL, 0, 0, NULL } }; @@ -1965,9 +1977,7 @@ sc_profile_find_file(struct sc_profile *pro, for (fi = pro->ef_list; fi; fi = fi->next) { sc_path_t *fpath = &fi->file->path; - if (!strcasecmp(fi->ident, name) - && fpath->len >= len - && !memcmp(fpath->value, path->value, len)) + if (!strcasecmp(fi->ident, name) && fpath->len >= len && !memcmp(fpath->value, path->value, len)) return fi; } return NULL; diff --git a/src/pkcs15init/profile.h b/src/pkcs15init/profile.h index 750e0943..c6e48557 100644 --- a/src/pkcs15init/profile.h +++ b/src/pkcs15init/profile.h @@ -124,6 +124,9 @@ struct sc_profile { /* PKCS15 object ID style */ unsigned int id_style; + + /* Minidriver support style */ + unsigned int md_style; }; struct sc_profile *sc_profile_new(void);