~ubuntu-branches/ubuntu/gutsy/gnupg2/gutsy

« back to all changes in this revision

Viewing changes to scd/command.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2007-05-15 13:54:55 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070515135455-89qfyalmgjy6gcqw
Tags: 2.0.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Remove libpcsclite-dev, libopensc2-dev build dependencies (they are in
    universe).
  - Build-depend on libcurl3-gnutls-dev
  - g10/call-agent.c: set DBG_ASSUAN to 0 to suppress a debug message
  - Include /doc files as done with gnupg
  - debian/rules: add doc/com-certs.pem to the docs for gpgsm
  - debian/copyright: update download url
  - debian/README.Debian: remove note the gnupg2 isn't released yet.
  - debian/control: Change Maintainer/XSBC-Original-Maintainer field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include "app-common.h"
39
39
#include "apdu.h" /* Required for apdu_*_reader (). */
40
40
#include "exechelp.h"
 
41
#ifdef HAVE_LIBUSB
 
42
#include "ccid-driver.h"
 
43
#endif
41
44
 
42
45
/* Maximum length allowed as a PIN; used for INQUIRE NEEDPIN */
43
46
#define MAXLEN_PIN 100
1382
1385
   Supported values of WHAT are:
1383
1386
 
1384
1387
   socket_name - Return the name of the socket.
 
1388
 
1385
1389
   status - Return the status of the current slot (in the future, may
1386
1390
   also return the status of all slots).  The status is a list of
1387
1391
   one-character flags.  The following flags are currently defined:
1388
1392
     'u'  Usable card present.  This is the normal state during operation.
1389
1393
     'r'  Card removed.  A reset is necessary.
1390
1394
   These flags are exclusive.
 
1395
 
 
1396
   reader_list - Return a list of detected card readers.  Does
 
1397
                 currently only work with the internal CCID driver.
1391
1398
*/
1392
1399
 
1393
1400
static int
1427
1434
        }
1428
1435
      rc = assuan_send_data (ctx, &flag, 1);
1429
1436
    }
 
1437
  else if (!strcmp (line, "reader_list"))
 
1438
    {
 
1439
#ifdef HAVE_LIBUSB
 
1440
      char *s = ccid_get_reader_list ();
 
1441
#else
 
1442
      char *s = NULL;
 
1443
#endif
 
1444
      
 
1445
      if (s)
 
1446
        rc = assuan_send_data (ctx, s, strlen (s));
 
1447
      else
 
1448
        rc = gpg_error (GPG_ERR_NO_DATA);
 
1449
      xfree (s);
 
1450
    }
1430
1451
  else
1431
1452
    rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
1432
1453
  return rc;