mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
scd: Use enums for cardtype and apptype.
* scd/app-common.h (cardtype_t): New. (apptype_t): New. (struct card_ctx_s): Change type of cardtype. (struct app_ctx_s): Change type of apptype. Adjust all users. * scd/app.c (struct app_priority_list_s): Add field apptype. (strcardtype): New. Use as needed. (strapptype): New. Use as needed. -- Using strcmp is lame and we can't use a switch to let the compiler complain about missed cases. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
0ccb5ddef1
commit
9551275857
9 changed files with 94 additions and 34 deletions
|
@ -3413,7 +3413,7 @@ app_select_piv (app_t app)
|
|||
if (err)
|
||||
goto leave;
|
||||
|
||||
app->apptype = "PIV";
|
||||
app->apptype = APPTYPE_PIV;
|
||||
app->did_chv1 = 0;
|
||||
app->did_chv2 = 0;
|
||||
app->did_chv3 = 0;
|
||||
|
@ -3466,7 +3466,7 @@ app_select_piv (app_t app)
|
|||
goto leave;
|
||||
}
|
||||
|
||||
if (app->card->cardtype && !strcmp (app->card->cardtype, "yubikey"))
|
||||
if (app->card->cardtype == CARDTYPE_YUBIKEY)
|
||||
app->app_local->flags.yubikey = 1;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue