aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2012-01-25Port to npth.npth-3Marcus Brinkmann1-32/+17
* configure.ac: Don't check for PTH but for NPTH. (AH_BOTTOM): Remove PTH_SYSCALL_SOFT. (have_pth): Rename to ... (have_npth): ... this. (USE_GNU_NPTH): Rename to ... (USE_GNU_PTH): ... this. * m4/npth.m4: New file. * agent/Makefile.am, agent/cache.c, agent/call-pinentry.c, agent/call-scd.c, agent/findkey.c, agent/gpg-agent.c, agent/trustlist.c, common/Makefile.am, common/estream.c, common/exechelp-posix.c, common/exechelp-w32.c, common/exechelp-w32ce.c, common/http.c, common/init.c, common/sysutils.c, dirmngr/Makefile.am, dirmngr/crlfetch.c, dirmngr/dirmngr.c, dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c, dirmngr/ldap-wrapper.c, dirmngr/ldap.c, g13/Makefile.am, g13/call-gpg.c, g13/g13.c, g13/runner.c, scd/Makefile.am, scd/apdu.c, scd/app.c, scd/ccid-driver.c, scd/command.c, scd/scdaemon.c, tools/Makefile.am: Port to npth.
2011-12-15scd: Prefer application Geldkarte over DINSIG.Werner Koch1-3/+3
* scd/app.c (select_application): Reorder application tests. -- Although the DINSIG application is available on most German cards, it is in reality not used. Thus showing the Geldkarte application is more desirable for a good user experience.
2011-12-14scd: Skip S/N reading for the "undefined" application.Werner Koch1-45/+52
* scd/app.c (select_application): Skip serial number reading.
2011-12-14scd: Add the "undefined" stub application.Werner Koch1-0/+10
* scd/app.c (select_application): Implement the "undefined" application.
2011-12-13scd: Introduce a virtual reader table.Werner Koch1-3/+4
The vreader table makes the code more clear by explicitly talking about APDU slots and reader indices. It also accommodates for future extensions. * scd/scdaemon.h (server_control_s): Remove READER_SLOT. * scd/scdaemon.c (scd_init_default_ctrl): Do not init READER_SLOT. * scd/app.c (check_application_conflict): Add arg SLOT. * scd/command.c (slot_status_s): Rename to vreader_s. (server_local_s): Add field VREADER_IDX as replacement for the READER_SLOT in server_control_s. Change all users. (slot_table): Rename to vreader_table. Change all users. (vreader_slot): New. (do_reset, cmd_apdu): Map vreader to apdu slot. (get_reader_slot): Rename to get_current_reader. Return -1 on error. (open_card): Map vreader toapdu slot. Pass slot to check_application_conflict. (scd_command_handler): Init VREADER_IDX. (update_reader_status_file): Reset SLOT field on error.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-28/+27
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2009-07-16Add code to better handle unplugging of a reader.Werner Koch1-2/+2
2009-07-13* ccid-driver.c (struct ccid_driver_s): Add fields last_progress,Werner Koch1-19/+36
progress_cb and progress_cb_arg. (ccid_set_progress_cb): New. (print_progress): New. (ccid_transceive): Call print_progress for wait time extensions. * apdu.c (struct reader_table_s): Add field set_progress_cb. (new_reader_slot): Clear that field. (open_ccid_reader): Set it to .. (set_progress_cb_ccid_reader): ... new fucntion. * app.c (print_progress_line): New. (lock_reader): Add arg CTRL to set a progress callback and change all callers to provide it. (unlock_reader): Remove the progress callback.
2009-06-09app-openpgp changesWerner Koch1-1/+1
2009-03-24Better syncronization of several smartcard sessions.Werner Koch1-2/+24
2009-03-18Add server option with-ephemeral-keys.Werner Koch1-3/+4
Extend SCD LEARN command.
2009-02-27Fix a gpg2 problem with removed cards.Werner Koch1-2/+33
Allow runtime conf change for scdaemon. New commands for scdaemon.
2009-01-27Add a Geldkarte gadget application.Werner Koch1-2/+19
Minor other changes.
2008-11-03Fixed the card removed with cached app bug. (Famous last fix).Werner Koch1-18/+18
2008-11-03Use bin2hex if possible.Werner Koch1-7/+5
2008-10-20Marked all unused args on non-W32 platforms.Werner Koch1-0/+2
2008-09-23Support the Certifciate DO of the v2 OpenPGP cards.Werner Koch1-3/+30
2007-07-05Fixed card key generation of gpg2.Werner Koch1-1/+3
Reveal less information about timings while generating a key.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-06-06First steps towards supporting W32.Werner Koch1-0/+4
This is mainly source code reorganization. Update gnulib. g10/ does currently not build.
2006-09-14Take advantage of newer gpg-error features.Werner Koch1-4/+4
2006-09-06The big Assuan error code removal.Werner Koch1-4/+4
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2006-04-142006-04-14 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-19/+28
* app.c (select_application): Cover up a slot mismatch error in case it happens (it shouldn't happen). (release_application): Use APP->slot. Lock the reader. (application_notify_card_removed): Lock the reader.
2006-03-01Fixed card removal problemsWerner Koch1-5/+9
2006-02-09PIN caching of cards does now work.Werner Koch1-15/+112
2005-07-27Removed directories which are only used by the 1.9 branchWerner Koch1-278/+0
2005-06-16gcc-4 defaults forced me to edit many many files to get rid of theWerner Koch1-1/+1
char * vs. unsigned char * warnings. The GNU coding standards used to say that these mismatches are okay and better than a bunch of casts. Obviously this has changed now.
2005-06-03* command.c (cmd_updatestartuptty): New.Werner Koch1-46/+121
* gpg-agent.c: New option --write-env-file. * gpg-agent.c (handle_connections): Make sure that the signals we are handling are not blocked.Block signals while creating new threads. * estream.c: Use HAVE_CONFIG_H and not USE_CONFIG_H! (es_func_fd_read, es_func_fd_write): Protect against EINTR. * gpg-agent.texi (Agent UPDATESTARTUPTTY): New. * scdaemon.c (handle_connections): Make sure that the signals we are handling are not blocked.Block signals while creating new threads. (handle_connections): Include the file descriptor into the name of the thread.
2005-05-20* protect-tool.c: New option --canonical.Werner Koch1-0/+29
(show_file): Implement it. * keyformat.txt: Define the created-at attribute for keys. * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level. (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good. (ccid_transceive): Arghhh. The seqno is another bit in the R-block than in the I block, this was wrong at one place. * scdaemon.c: New options --debug-ccid-driver and --debug-disable-ticker. * app-openpgp.c (do_genkey, do_writekey): Factored code to check for existing key out into .. (does_key_exist): .. New function. * gpg-connect-agent.c (add_definq, show_definq, clear_definq) (handle_inquire): New. (read_and_print_response): Handle INQUIRE command. (main): Implement control commands.
2005-05-18Changed the scdaemon to handle concurrent sessions. AdjustedWerner Koch1-103/+238
gpg-agent accordingly. Code cleanups.
2005-04-27* app-p15.c (micardo_mse): New.Werner Koch1-1/+1
(do_sign): Call it. * iso7816.c (iso7816_manage_security_env): Allow passing DATA as NULL to indicate an empty Lc. * tlv.c (find_tlv): Check that a found object fits into the buffer. (find_tlv_unchecked): New as replacement for the old non-checking variant. * app.c (select_application): Keep on using the non-checking variant. * app-openpgp.c (get_one_do, dump_all_do): Ditto.
2005-04-27* configure.ac: Removed OpenSC detection and options.Werner Koch1-3/+3
* acinclude.m4: Ditto. * scdaemon.texi: Removed OpenSC specific options. * app-p15.c: New. Basic support for pkcs15 cards without OpenSC. There are quite a couple of things missing but at least I can use my old TCOS cards from the Aegypten-1 development for signing. * app.c (select_application): Detect pkcs15 applications. * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h and card-p15.c because they are now obsolete. Added app-p15.c. Removed all OpenSC stuff. * command.c (do_reset, open_card, cmd_serialno, cmd_learn) (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed all special cases for the old card.c based mechanisms. * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
2005-04-11* app-openpgp.c (do_check_pin): Add hack to allow verification ofWerner Koch1-1/+1
CHV3. (get_public_key): Don't use gcry functions to create S-expressions. (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for above change.
2005-02-25* findkey.c (modify_description): Keep invalid % escapes, so thatWerner Koch1-9/+1
%0A may pass through. * agent.h (server_control_s): New field USE_AUTH_CALL. * call-scd.c (agent_card_pksign): Make use of it. * command-ssh.c (data_sign): Set the flag. (ssh_send_key_public): New arg OVERRIDE_COMMENT. (card_key_available): Add new arg CARDSN. (ssh_handler_request_identities): Use the card s/n as comment. (sexp_key_extract): Use GCRYMPI_FMT_STD. (data_sign): Ditto. * learncard.c (make_shadow_info): Moved to .. * protect.c (make_shadow_info): .. here. Return NULL on malloc failure. Made global. * agent.h: Add prototype. * xasprintf.c (xtryasprintf): New. * app-openpgp.c (get_public_key): Make sure not to return negative numbers. (do_sign): Allow passing of indata with algorithm prefix. (do_auth): Allow OPENPGP.3 as an alternative ID. * app.c (app_getattr): Return just the S/N but not the timestamp. * no-libgcrypt.c (gcry_strdup): New.
2005-02-24* call-scd.c (unescape_status_string): New. Actual a copy ofWerner Koch1-0/+29
../g10/call-agent.c (card_getattr_cb, agent_card_getattr): New. * command-ssh.c (card_key_available): New. (ssh_handler_request_identities): First see whether a card key is available. * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the application does dot support the getattr call. * app.c (select_application): Return an error code and the application context in an new arg. * command.c (open_card): Adjusted for that. Don't use the fallback if no card is present. Return an error if the card has been removed without a reset. (do_reset, cmd_serialno): Clear that error flag. (TEST_CARD_REMOVAL): New. Use it with all command handlers. (scd_update_reader_status_file): Set the error flag on all changes.
2005-02-24* gpg-agent.c (handle_connections): Need to check for events ifWerner Koch1-10/+18
select returns with -1. * tools.texi (gpg-connect-agent): New. * app-openpgp.c (get_one_do): Never try to get a non cacheable object from the cache. (get_one_do): Add new arg to return an error code. Changed all callers. (do_getattr): Let it return a proper error code. * app.c (select_application): Return an error code and the application context in an new arg. * command.c (open_card): Adjusted for that. Don't use the fallback if no card is present. Return an error if the card has been removed without a reset. (do_reset, cmd_serialno): Clear that error flag. (TEST_CARD_REMOVAL): New. Use it with all command handlers. * scdaemon.c (ticker_thread): Termintate if a shutdown is pending. * apdu.c: Added some PCSC error codes. (pcsc_error_to_sw): New. (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu) (open_pcsc_reader): Do proper error code mapping. * gpg-connect-agent.c: New. * Makefile.am: Add it.
2005-02-22* app-openpgp.c (app_local_s): New field PK.Werner Koch1-0/+26
(do_deinit, do_genkey, app_openpgp_storekey): Clear it. (get_public_key, send_keypair_info): New. (do_learn_status): Send KEYPAIR info * app-common.h (app_ctx_t): Add function pointer READKEY. * app.c (app_readkey): New. * command.c (cmd_readkey): Use READKEY function if possible.
2004-09-09* app.c (select_application): Fixed serial number extraction andWerner Koch1-3/+56
added the BMI card workaround. (app_munge_serialno): New. * app-openpgp.c (app_select_openpgp): Try munging serialno.
2004-08-05* configure.ac: Changed tests for libusb to also suuport theWerner Koch1-3/+16
stable version 0.1.x. * scdaemon.texi (Card applications): New section. * scdaemon.c (main): New option --disable-application. * app.c (is_app_allowed): New. (select_application): Use it to check for disabled applications. * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New. * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version of libusb. (ccid_get_atr): Handle short messages. * apdu.c (my_rapdu_get_status): Implemented.
2004-04-26* app-common.h: New members FNC.DEINIT and APP_LOCAL.Werner Koch1-0/+6
* app.c (release_application): Call new deconstructor. * app-openpgp.c (do_deinit): New. (get_cached_data, flush_cache_item, flush_cache_after_error) (flush_cache): New. (get_one_do): Replaced arg SLOT by APP. Make used of cached data. (verify_chv2, verify_chv3): Flush some cache item after error. (do_change_pin): Ditto. (do_sign): Ditto. (do_setattr): Flush cache item. (do_genkey): Flush the entire cache. (compare_fingerprint): Use cached data.
2004-03-16*** empty log message ***Werner Koch1-1/+1
2004-01-27Some minor bug fixes, new test utilities and started support for otherWerner Koch1-35/+96
smartcard applications.
2003-10-21* command.c (cmd_checkpin): New.Werner Koch1-0/+23
(register_commands): Add command CHECKPIN. * app.c (app_check_pin): New. * app-openpgp.c (check_against_given_fingerprint): New. Factored out that code elsewhere. (do_check_pin): New.
2003-09-30* command.c (cmd_getattr): New command GETATTR.Werner Koch1-0/+13
* app.c (app_setattr): New. (do_getattr): New. (do_learn_status): Reimplemented in terms of do_getattr. * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are always synced. (verify_chv2, verify_chv3): New. Factored out common code. (do_setattr, do_sign, do_auth, do_decipher): Change the names of the prompts to match that we have only 2 different PINs. (app_select_openpgp): Check whether the card enforced CHV1. (convert_sig_counter_value): New. Factor out code from get_sig_counter.
2003-08-14 * Always use 'dynload.h' instead of 'dlfcn.h'.Timo Schulz1-1/+2
2003-08-05Cleanups, fixes and PC/SC supportWerner Koch1-2/+11
2003-08-05This commit was manufactured by cvs2svn to create branchRepo Admin1-0/+278
'GNUPG-1-9-BRANCH'.
2003-07-23* command.c (cmd_pkauth): New.Werner Koch1-0/+70
(cmd_setdata): Check whether data was given at all to avoid passing 0 to malloc. * app.c (app_auth): New. * app-openpgp.c (do_auth): New.
2003-07-03* app-openpgp.c (do_setattr): Add setting of the URL.Werner Koch1-2/+2
(app_select_openpgp): Dump card data only in very verbose mode. (do_decipher): New.