diff options
author | Werner Koch <[email protected]> | 2019-01-25 18:12:32 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-01-25 18:12:32 +0000 |
commit | 0415b80227c52620bece3ae7502f38f24a23e59d (patch) | |
tree | 009519e0685737df05442738eb9179c2cf7f7f31 | |
parent | scd: Fix flushing of CA-FPR data objects (diff) | |
download | gnupg-0415b80227c52620bece3ae7502f38f24a23e59d.tar.gz gnupg-0415b80227c52620bece3ae7502f38f24a23e59d.zip |
scd: Improve app selection for app "undefined".
* scd/app.c (app_new_register): Don't bail out early in undefined
mode.
Signed-off-by: Werner Koch <[email protected]>
-rw-r--r-- | scd/app.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -305,21 +305,27 @@ app_new_register (int slot, ctrl_t ctrl, const char *name, } } - /* For certain error codes, there is no need to try more. */ - if (gpg_err_code (err) == GPG_ERR_CARD_NOT_PRESENT - || gpg_err_code (err) == GPG_ERR_ENODEV) - goto leave; - /* Figure out the application to use. */ if (want_undefined) { /* We switch to the "undefined" application only if explicitly requested. */ app->apptype = "UNDEFINED"; + /* Clear the error so that we don't run through the application + * selection chain. */ err = 0; } else - err = gpg_error (GPG_ERR_NOT_FOUND); + { + /* For certain error codes, there is no need to try more. */ + if (gpg_err_code (err) == GPG_ERR_CARD_NOT_PRESENT + || gpg_err_code (err) == GPG_ERR_ENODEV) + goto leave; + + /* Set a default error so that we run through the application + * selecion chain. */ + err = gpg_error (GPG_ERR_NOT_FOUND); + } if (err && is_app_allowed ("openpgp") && (!name || !strcmp (name, "openpgp"))) |