mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
scd: Fix cmd_apdu on error.
* scd/command.c (cmd_apdu): Fix the code path on error. -- GnuPG-bug-id: 6476 Reported-by: Robin Krahl Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
625bd92410
commit
3cf5fc2e2f
@ -3260,7 +3260,7 @@ apdu_send_simple (int slot, int extended_mode,
|
|||||||
* Out of historical reasons the function returns 0 on success and
|
* Out of historical reasons the function returns 0 on success and
|
||||||
* outs the status word at the end of the result to be able to get the
|
* outs the status word at the end of the result to be able to get the
|
||||||
* status word in the case of a not provided RETBUF, R_SW can be used
|
* status word in the case of a not provided RETBUF, R_SW can be used
|
||||||
* to store the SW. But note that R_SW qill only be set if the
|
* to store the SW. But note that R_SW will only be set if the
|
||||||
* function returns 0. */
|
* function returns 0. */
|
||||||
int
|
int
|
||||||
apdu_send_direct (int slot, size_t extended_length,
|
apdu_send_direct (int slot, size_t extended_length,
|
||||||
|
@ -2200,7 +2200,10 @@ cmd_apdu (assuan_context_t ctx, char *line)
|
|||||||
apdu, apdulen, handle_more,
|
apdu, apdulen, handle_more,
|
||||||
NULL, &result, &resultlen);
|
NULL, &result, &resultlen);
|
||||||
if (rc)
|
if (rc)
|
||||||
log_error ("apdu_send_direct failed: %s\n", gpg_strerror (rc));
|
{
|
||||||
|
log_error ("apdu_send_direct failed: %s\n", apdu_strerror (rc));
|
||||||
|
rc = iso7816_map_sw (rc);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rc = assuan_send_data (ctx, result, resultlen);
|
rc = assuan_send_data (ctx, result, resultlen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user