scd: More fix of error return path.
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 2 May 2016 06:56:02 +0000 (15:56 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 29 Nov 2016 08:08:57 +0000 (17:08 +0900)
* scd/command.c (open_card): Return GPG_ERR_ENODEV on the failure of
apdu_connect.

--
Backport of master commit: 6677d8b61446eb5760a30a2488c992d6e895a9ed

GnuPG-bug-id: 2306
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
scd/command.c

index b26bd68..44f0b21 100644 (file)
@@ -482,8 +482,8 @@ open_card (ctrl_t ctrl, const char *apptype)
           else if (sw == SW_HOST_CARD_INACTIVE)
             err = gpg_error (GPG_ERR_CARD_RESET);
           else
-            err = gpg_error (GPG_ERR_CARD);
-       }
+            err = gpg_error (GPG_ERR_ENODEV);
+        }
       else
         err = select_application (ctrl, slot, apptype, &ctrl->app_ctx);
     }