* scd/app.c (app_new_register): Initialize by -1, so that it can detect
an error correctly when card reader can't power-on the card initially.
* scd/command.c (open_card_with_request): Release APP before the scan.
--
The first one-liner patch handles an erroneous card.
The second patch handles the case when we repeatedly do
signing/decrypting by a single session of scdaemon.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Gbp-Pq: Name 0028-scd-Backport-two-fixes-from-master.patch
}
app->slot = slot;
+ app->card_status = (unsigned int)-1;
if (npth_mutex_init (&app->lock, NULL))
{
gpg_error_t err;
unsigned char *serialno_bin = NULL;
size_t serialno_bin_len = 0;
+ app_t app = ctrl->app_ctx;
/* If we are already initialized for one specific application we
need to check that the client didn't requested a specific
if (apptype && ctrl->app_ctx)
return check_application_conflict (apptype, ctrl->app_ctx);
+ /* Re-scan USB devices. Release APP, before the scan. */
+ ctrl->app_ctx = NULL;
+ release_application (app);
+
if (serialno)
serialno_bin = hex_to_buffer (serialno, &serialno_bin_len);