mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-11 22:01:08 +02:00
Merge branch 'STABLE-BRANCH-2-2'
-- Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
commit
fe96ca8d86
@ -425,11 +425,17 @@ do_get_from_fd ( const char *keyword, int hidden, int getbool )
|
|||||||
{
|
{
|
||||||
if (i >= len-1 )
|
if (i >= len-1 )
|
||||||
{
|
{
|
||||||
|
/* On the first iteration allocate a new buffer. If that
|
||||||
|
* buffer is too short at further iterations do a poor man's
|
||||||
|
* realloc. */
|
||||||
char *save = string;
|
char *save = string;
|
||||||
len += 100;
|
len += 100;
|
||||||
string = hidden? xmalloc_secure ( len ) : xmalloc ( len );
|
string = hidden? xmalloc_secure ( len ) : xmalloc ( len );
|
||||||
if (save)
|
if (save)
|
||||||
memcpy (string, save, i );
|
{
|
||||||
|
memcpy (string, save, i);
|
||||||
|
xfree (save);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@ -1498,8 +1498,13 @@ open_ccid_reader (struct dev_list *dl)
|
|||||||
err = ccid_open_reader (dl->portstr, dl->idx, dl->ccid_table,
|
err = ccid_open_reader (dl->portstr, dl->idx, dl->ccid_table,
|
||||||
&slotp->ccid.handle, &slotp->rdrname);
|
&slotp->ccid.handle, &slotp->rdrname);
|
||||||
if (!err)
|
if (!err)
|
||||||
err = ccid_get_atr (slotp->ccid.handle,
|
{
|
||||||
slotp->atr, sizeof slotp->atr, &slotp->atrlen);
|
err = ccid_get_atr (slotp->ccid.handle,
|
||||||
|
slotp->atr, sizeof slotp->atr, &slotp->atrlen);
|
||||||
|
if (err)
|
||||||
|
ccid_close_reader (slotp->ccid.handle);
|
||||||
|
}
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
slotp->used = 0;
|
slotp->used = 0;
|
||||||
|
10
scd/app.c
10
scd/app.c
@ -323,7 +323,7 @@ select_application (ctrl_t ctrl, const char *name, app_t *r_app,
|
|||||||
if (scan || !app_top)
|
if (scan || !app_top)
|
||||||
{
|
{
|
||||||
struct dev_list *l;
|
struct dev_list *l;
|
||||||
int periodical_check_needed = 0;
|
int new_app = 0;
|
||||||
|
|
||||||
/* Scan the devices to find new device(s). */
|
/* Scan the devices to find new device(s). */
|
||||||
err = apdu_dev_list_start (opt.reader_port, &l);
|
err = apdu_dev_list_start (opt.reader_port, &l);
|
||||||
@ -349,8 +349,7 @@ select_application (ctrl_t ctrl, const char *name, app_t *r_app,
|
|||||||
{
|
{
|
||||||
err = app_new_register (slot, ctrl, name,
|
err = app_new_register (slot, ctrl, name,
|
||||||
periodical_check_needed_this);
|
periodical_check_needed_this);
|
||||||
if (periodical_check_needed_this)
|
new_app++;
|
||||||
periodical_check_needed = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
@ -359,9 +358,8 @@ select_application (ctrl_t ctrl, const char *name, app_t *r_app,
|
|||||||
|
|
||||||
apdu_dev_list_finish (l);
|
apdu_dev_list_finish (l);
|
||||||
|
|
||||||
/* If periodical check is needed for new device(s), kick the
|
/* If new device(s), kick the scdaemon loop. */
|
||||||
scdaemon loop. */
|
if (new_app)
|
||||||
if (periodical_check_needed)
|
|
||||||
scd_kick_the_loop ();
|
scd_kick_the_loop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1661,9 +1661,6 @@ ccid_open_usb_reader (const char *spec_reader_name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*handle)->ep_intr >= 0)
|
|
||||||
ccid_setup_intr (*handle);
|
|
||||||
|
|
||||||
rc = ccid_vendor_specific_init (*handle);
|
rc = ccid_vendor_specific_init (*handle);
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
@ -2311,6 +2308,11 @@ ccid_slot_status (ccid_driver_t handle, int *statusbits, int on_wire)
|
|||||||
no need to send on wire. */
|
no need to send on wire. */
|
||||||
if (!on_wire && !ccid_require_get_status (handle))
|
if (!on_wire && !ccid_require_get_status (handle))
|
||||||
{
|
{
|
||||||
|
/* Setup interrupt transfer at the initial call of slot_status
|
||||||
|
with ON_WIRE == 0 */
|
||||||
|
if (handle->transfer == NULL && handle->ep_intr >= 0)
|
||||||
|
ccid_setup_intr (handle);
|
||||||
|
|
||||||
*statusbits = 0;
|
*statusbits = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3748,7 +3750,7 @@ main (int argc, char **argv)
|
|||||||
if (!no_poll)
|
if (!no_poll)
|
||||||
ccid_poll (ccid);
|
ccid_poll (ccid);
|
||||||
fputs ("getting slot status ...\n", stderr);
|
fputs ("getting slot status ...\n", stderr);
|
||||||
rc = ccid_slot_status (ccid, &slotstat);
|
rc = ccid_slot_status (ccid, &slotstat, 1);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
print_error (rc);
|
print_error (rc);
|
||||||
|
@ -1003,6 +1003,7 @@ handle_signal (int signo)
|
|||||||
|
|
||||||
case SIGCONT:
|
case SIGCONT:
|
||||||
/* Nothing. */
|
/* Nothing. */
|
||||||
|
log_debug ("SIGCONT received - breaking select\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user