diff options
| author | Werner Koch <[email protected]> | 2019-06-21 09:41:58 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2019-06-21 09:44:25 +0000 |
| commit | 1b78e4951ed7a66ec71ca036e7680148a63143be (patch) | |
| tree | be14490609c33727b7fd9c12eb282018374984fb /scd/command.c | |
| parent | scd: Track the currently selected app. (diff) | |
| download | gnupg-1b78e4951ed7a66ec71ca036e7680148a63143be.tar.gz gnupg-1b78e4951ed7a66ec71ca036e7680148a63143be.zip | |
scd: Add code to check whether app switching is possible.
* scd/app.c (check_conflict): Fold into ...
(check_application_conflict): this and adjust callers. Return a
different error code if it is possible to switch apps.
--
Right now this change does nothing visible.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'scd/command.c')
| -rw-r--r-- | scd/command.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scd/command.c b/scd/command.c index c45737376..3156aa9ef 100644 --- a/scd/command.c +++ b/scd/command.c @@ -220,7 +220,8 @@ open_card (ctrl_t ctrl) /* Explicitly open a card for a specific use of APPTYPE or SERIALNO. */ static gpg_error_t -open_card_with_request (ctrl_t ctrl, const char *apptype, const char *serialno) +open_card_with_request (ctrl_t ctrl, + const char *apptypestr, const char *serialno) { gpg_error_t err; unsigned char *serialno_bin = NULL; @@ -231,8 +232,8 @@ open_card_with_request (ctrl_t ctrl, const char *apptype, const char *serialno) need to check that the client didn't requested a specific application different from the one in use before we continue. */ /* FIXME: Extend to allow switching between apps. */ - if (apptype && ctrl->card_ctx) - return check_application_conflict (apptype, ctrl->card_ctx); + if (apptypestr && ctrl->card_ctx) + return check_application_conflict (ctrl->card_ctx, apptypestr); /* Re-scan USB devices. Release CARD, before the scan. */ /* FIXME: Is a card_unref sufficient or do we need to deallocate? */ @@ -242,7 +243,7 @@ open_card_with_request (ctrl_t ctrl, const char *apptype, const char *serialno) if (serialno) serialno_bin = hex_to_buffer (serialno, &serialno_bin_len); - err = select_application (ctrl, apptype, &ctrl->card_ctx, 1, + err = select_application (ctrl, apptypestr, &ctrl->card_ctx, 1, serialno_bin, serialno_bin_len); xfree (serialno_bin); |
