summaryrefslogtreecommitdiffstats
path: root/scd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* scd: Fix for large ECC keys.NIIBE Yutaka2017-09-111-8/+32
| | | | | | | | | * scd/app-openpgp.c (do_decipher): Support larger length. -- Reported-by: Achim Pietig <achim@pietig.com> Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Convey the correct length for LeWerner Koch2017-08-271-2/+2
| | | | | | | | | | | | | | | | | | | | | * scd/app-openpgp.c (determine_rsa_response): Round bits up. -- Co-authored-by: Arnaud Fontaine <arnaud.fontaine@ssi.gouv.fr> Arnaud wrote: Actually, when the incorrect expected response length (i.e. Le field) is transmitted to the card, the card's answer is missing a byte (i.e. ... 6101) so an additional command has to be sent to the card to retrieve the last byte. Using the correct length avoids to send the additional command to retrieve the missing byte, when the computed length is wrong. Note that an value of 65537 for E is pretty standard and thus we can avoid the 6101 return code inmost cases. Signed-off-by: Werner Koch <wk@gnupg.org>
* w32: Also change the directory on daemon startup.Werner Koch2017-07-251-2/+2
| | | | | | | | | | | | | | | * agent/gpg-agent.c (main): Always to the chdir. * dirmngr/dirmngr.c (main): Ditto. * scd/scdaemon.c (main): Ditto. -- Note that only dirmngr did not call the chdir with --no-detach. thus we kept it this way. Tested gpg-agent by checking the properties shown by procexp. Gnupg-bug-id: 2670 Signed-off-by: Werner Koch <wk@gnupg.org>
* common: New functions gnupg_daemon_rootdir and gnupg_chdir.Werner Koch2017-07-251-2/+3
| | | | | | | | | | | * common/sysutils.c (gnupg_chdir): New. * common/homedir.c (gnupg_daemon_rootdir): New. * agent/gpg-agent.c (main): Use these functions instead chdir("/"). * dirmngr/dirmngr.c (main): Ditto. * scd/scdaemon.c (main): Ditto. -- Signed-off-by: Werner Koch <wk@gnupg.org>
* Revert "w32: Change directory on daemon startup."Werner Koch2017-07-251-10/+3
| | | | | | -- This reverts commit 78ebc62604d77600b9865950610717d28c6027a2. Gnupg-bug-id: 2670
* w32: Change directory on daemon startup.Marcus Brinkmann2017-07-241-3/+10
| | | | | | | | | | | | * agent/gpg-agent.c [HAVE_W32_SYSTEM]: Include <direct.h>. (main) [HAVE_W32_SYSTEM]: Change working directory to \. * dirmngr/dirmngr.c [HAVE_W32_SYSTEM]: Include <direct.h>. (main) [HAVE_W32_SYSTEM]: Change working directory to \. * scd/scdaemon.c [HAVE_W32_SYSTEM]: Include <direct.h>. (main) [HAVE_W32_SYSTEM]: Change working directory to \. Signed-off-by: Marcus Brinkmann <mb@g10code.com> GnuPG-bug-id: 2670
* scd: Use unsigned int for fields.NIIBE Yutaka2017-07-241-5/+5
| | | | | | * scd/app-openpgp.c (data_objects): Use unsigned ints. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix SEGV in CCID driver.NIIBE Yutaka2017-07-211-4/+7
| | | | | | | * scd/ccid-driver.c (intr_cb): Only kick the loop for removal. (bulk_in): Don't set POWERED_OFF when interrupt transfer is enabled. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Add debug message for v3 card.NIIBE Yutaka2017-07-211-8/+17
| | | | | | * scd/app-openpgp.c (show_caps): Output more messages. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Support longer data length for special DOs for v3 card.NIIBE Yutaka2017-07-201-16/+45
| | | | | | | | | | | | | * scd/app-openpgp.c (data_objects): Special DOs like "Login Data", "URL", "Private DO N" can be longer size >= 256. (struct app_local_s): Define bits for v3 card. (get_cached_data): Use extcap.max_special_do for special DOs. (app_select_openpgp): Detect if extcap_v3, kdf_do, and other bits. -- GnuPG-bug-id: 3262 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix error code on failure at usb_init.NIIBE Yutaka2017-05-311-1/+1
| | | | | | * scd/ccid-driver.c (ccid_dev_scan): Return GPG_ERR_ENODEV. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Handle a failure of libusb_init.NIIBE Yutaka2017-05-311-4/+15
| | | | | | | | | | * scd/ccid-driver.c (ccid_get_reader_list, ccid_dev_scan): Handle failure. -- Reported-by: Yuriy M. Kaminskiy <yumkam@gmail.com> Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Spelling fixes in docs and comments.NIIBE Yutaka2017-04-286-9/+9
| | | | | | | | | | -- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Handle unexpected suspend/resume by CCID driver.NIIBE Yutaka2017-04-121-4/+16
| | | | | | | | | * scd/ccid-driver.c (bulk_in): Handle unexpected failure. -- GnuPG-bug-id: 3083 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Relax a condition for p15 driver.NIIBE Yutaka2017-04-101-1/+1
| | | | | | | | | * scd/app-p15.c (read_ef_aodf): Fix. -- Fixes-commit: 3c1ad96f1ce838daf2d861b33e6611f6d3043d25 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Relax a condition for p15 driver.NIIBE Yutaka2017-04-101-1/+1
| | | | | | * scd/app-p15.c (read_ef_aodf): Remove possibly redundant condition. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Remove "special transport" support.NIIBE Yutaka2017-04-101-292/+64
| | | | | | | | | | * scd/ccid-driver.c (transports, my_sleep, prepare_special_transport) (writen): Remove. (ccid_dev_scan, ccid_dev_scan_finish, ccid_get_BAI): Only for USB. (ccid_open_reader, do_close_reader, bulk_out, bulk_in, abort_cmd) (ccid_poll, ccid_transceive): Likewise. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Internal CCID reader cleanup.NIIBE Yutaka2017-04-071-269/+41
| | | | | | | | | | | | * scd/ccid-reader.c (scan_usb_device): Only for scan mode, so, rename from scan_or_find_usb_device. (scan_devices): Likewise. Remove support of special transport types. (ccid_get_reader_list): Simplify. (abort_cmd): Fix error return. (send_escape_cmd): Fix for RESULTLEN == NULL. (ccid_transceive_secure): Remove unnecessary var updates. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Don't keep CCID reader open when card is not available.NIIBE Yutaka2017-04-071-8/+3
| | | | | | * scd/apdu.c (open_ccid_reader): Fail if no ATR. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Change the order of applications when accessed.NIIBE Yutaka2017-03-271-2/+9
| | | | | | * scd/app.c (select_application): Move the app to top. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix timeout handling for key generation.NIIBE Yutaka2017-03-271-5/+13
| | | | | | | | | | | | | | | | * scd/ccid-driver.c (CCID_CMD_TIMEOUT): Back to original value. (CCID_CMD_TIMEOUT_LONGER): New. (ccid_transceive): Add kludge for key generation. -- At key generation of longer key size, OpenPGP card sends back "time extension" with BWI=100, which is unusual value in the protocol and it actually requires host having longer timeout like 43 seconds. Reported-by: Szczepan Zalega <szczepan@nitrokey.com> Fixes-commit: 6510df3a7cd2b5bf44fac1e4d50ee54b8c897daa Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* More change for common.NIIBE Yutaka2017-03-071-2/+2
| | | | | | * g10, scd, test, tools: Follow the change of removal of -Icommon. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Remove -I option to common.NIIBE Yutaka2017-03-0712-30/+30
| | | | | | | | | | | | | * dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Close THE_EVENT handle.NIIBE Yutaka2017-03-071-0/+4
| | | | | | | | * scd/scdaemon.c (handle_connections): Close the handle. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix compiler warnings for app-openpgp.c.NIIBE Yutaka2017-03-061-4/+2
| | | | | | | | * scd/app-openpgp.c (retrieve_key_material): Remove touching I. (do_change_pin): Make sure going to leave if PINVALUE == 0. (rsa_writekey): Emit simpler log. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: More cleanup of old code.NIIBE Yutaka2017-03-063-8/+5
| | | | | | | | | | | | | * scd/app-dinsig.c (do_sign): Remove assignment to HASHALGO. * scd/app-p15.c (parse_keyusage_flags): Remove assign to MASK. (read_ef_aodf): Likewise. (read_ef_cdf): Change the control to parse_error. * scd/app-sc-hsm.c (parse_keyusage_flags): Remove assign to MASK. (read_ef_prkd): Remove assign to S. (read_ef_prkd): Check if PRKDF is not null. (read_ef_cd): Likewise for CDF. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Clean up old code.NIIBE Yutaka2017-03-061-1145/+22
| | | | | | | | | | | | | | * scd/apdu.c (CT_init, CT_data, CT_close): Remove. (ct_error_string, ct_activate_card, close_ct_reader, reset_ct_reader) (ct_get_status, ct_send_apdu, open_ct_reader): Remove. (new_reader_slot) [NEED_PCSC_WRAPPER]: Remove fd and pid handling. (writen, readn): Remove. (pcsc_get_status, pcsc_send_apdu, control_pcsc, close_pcsc_reader) (reset_pcsc_reader, open_pcsc_reader): Only DIRECT version. (apdu_open_one_reader): Remove CT_api handling. (apdu_get_status_internal, send_le): Fix to stop warnings. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix API of select_file/_path.NIIBE Yutaka2017-03-067-48/+25
| | | | | | | | | | | | | | | | * scd/iso7816.c (iso7816_select_file, iso7816_select_path): Remove unused arguments. * scd/app-dinsig.c (do_readcert): Follow the change. * scd/app-help.c (app_help_read_length_of_cert): Likewise. * scd/app-nks.c (keygripstr_from_pk_file, do_readcert, do_readkey) (switch_application): Likewise. * scd/app-p15.c (select_and_read_binary, select_ef_by_path) (micardo_mse, app_select_p15): Likewise. * scd/app.c (app_new_register): Likewise. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix scd_kick_the_loop.NIIBE Yutaka2017-03-031-31/+56
| | | | | | | | | | | | | | | | * scd/scdaemon.c (notify_fd): Remove. (the_event) [W32]: New. (main_thread_pid) [!W32]: New. (handle_signal): Handle SIGCONT. (scd_kick_the_loop): Use signal on UNIX and event on Windows. (handle_connections): Likewise. -- Code with CreateEvent is copied from gpg-agent.c. Code for signal is copied from dkg's gpg-agent-idling in Debian. GnuPG-bug-id: 2982 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd,agent: Improve the OpenPGP PIN prompt texts.Werner Koch2017-02-221-7/+18
| | | | | | | | | | | | | * scd/app-openpgp.c (get_prompt_info): Change texts. * agent/call-pinentry.c (struct entry_features): New. (getinfo_features_cb): New. (start_pinentry): Set new fucntion as status callback. (build_cmd_setdesc): New. Replace all snprintf for SETDESC by this one. -- Suggested-by: Andre Heinecke Signed-off-by: Werner Koch <wk@gnupg.org>
* Revert "scd: Nitpicks on the improved card prompts"Werner Koch2017-02-221-7/+7
| | | | | | | -- This reverts commit 143ca039e1e81140ae520cc1025f8e25c01acc80. I have a more improved version in the works.
* scd: Nitpicks on the improved card promptsAndre Heinecke2017-02-221-7/+7
| | | | | | | | | | | | | * src/app-openpgp.c (get_prompt_info): Change wording and order slightly. -- The word "Card" was repeated too much in the prompt and moving signatures to the bottom results in a more consistent layout between the prompts with signcount and the prompts without. Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
* scd: Improve the prompts for OpenPGP cards.Werner Koch2017-02-221-38/+182
| | | | | | | | | | | | | | | | * scd/app-openpgp.c (get_disp_name): New. (get_disp_serialno): New. (get_prompt_info): New. (build_enter_admin_pin_prompt): Rework the prompt texts. Factor some code out to ... (get_remaining_tries): New. (verify_a_chv): Print a remaining counter also for the standard PIN. Rework the prompt texts. * agent/divert-scd.c (ask_for_card): Pretty format an OpenPGP serial no. Signed-off-by: Werner Koch <wk@gnupg.org>
* Clean up word replication.Yuri Chornoivan2017-02-217-11/+11
| | | | | | | | | -- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* scd: Fix RESET command handling (more).NIIBE Yutaka2017-02-173-12/+26
| | | | | | | | | | | | | | | * scd/app-common.h (struct app_ctx_s): Add reset_requested. * scd/app.c (app_reset): Locking APP, set reset_requested. (deallocate_app): Release the lock. (release_application): Add LOCKED_ALREADY argument. (scd_update_reader_status_file): Hold the lock when accessing APP. When reset_requested is set, close the reader and deallocate APP. * scd/command.c (open_card_with_request, cmd_restart): Follow the change of release_application. (send_client_notifications): Here it calls release_application holding the lock. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Minor fixes to silence compiler warnings.NIIBE Yutaka2017-02-162-4/+6
| | | | | | | | * scd/app.c (app_reset): Initialize ERR. * scd/scdaemon.c (scd_kick_the_loop, handle_connections): Catch the return value. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix RESET command handling.NIIBE Yutaka2017-02-151-28/+24
| | | | | | | | | | * scd/app.c (release_application_internal): Remove. (release_application): Merge release_application_internal. (app_reset): Kick the loop and let close the reader. Sleep is required here to wait closing. (scd_update_reader_status_file): When APP is no use, close it. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix use case of PC/SC.NIIBE Yutaka2017-02-133-5/+13
| | | | | | | | | | | | | | | | | * scd/apdu.c (apdu_open_reader): Add an argument APP_EMPTY. When CCID driver fails to open, try PC/SC if APP is nothing. * scd/app.c (select_application): Supply arg if APP is nothing. -- After scanning available card readers by CCID driver, scdaemon should try PC/SC service if no APP is registered yet. Also, when the slot is allocated for PC/SC (ccid.handle==NULL), it should not call ccid_compare_BAI, otherwise scdaemon crashes. Debian-bug-id: 852702, 854005, 854595, 854616 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix regression tracking the connection count.NIIBE Yutaka2017-02-013-24/+41
| | | | | | | | | | | | | | | | * scd/scdaemon.c (get_active_connection_count): New. (start_connection_thread): Bump ACTIVE_CONNECTIONS up and down. * scd/command.c (cmd_getinfo): Add subcommand "connections". -- Apply gpg-agent change to scdaemon. See the commit in 2016-08-06: 40d16029ed8b334c371fa7f24ac762d47302826e Then, add kicking the loop, so that main loop can notice the change of the connection. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Remove --debug-disable-ticker option.NIIBE Yutaka2017-01-311-34/+11
| | | | | | | | | | | | | * scd/scdaemon.c (ticker_disabled): Remove. (handle_tick, need_tick): Remove. (handle_connections): Don't check ticker_disabled. -- Now, removal of device/card is only done by the function scd_update_reader_status_file, it should be called if needed. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix SERIALNO for multiple devices.NIIBE Yutaka2017-01-315-76/+71
| | | | | | | | | | | | | | * scd/app.c (select_application): Fix the logic if periodical check is needed. If it is needed for newly found device(s), kick the loop. (scd_update_reader_status_file): Return value if select(2) should be called with timeout. * scd/ccid-driver.c (ccid_require_get_status): Don't return 0 for token with no interrupt transfer for now. * scd/command.c (open_card_with_request): Fix scan by SERIALNO. * scd/scdaemon.c (update_usb): Remove. (handle_connections): Evaluate need_tick after handle_tick. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix GetSlotStatus.NIIBE Yutaka2017-01-303-29/+31
| | | | | | | | | | | | | | | * scd/apdu.c (get_status_reader): Add ON_WIRE arg, here. (ct_get_status, pcsc_get_status_direct, pcsc_get_status_wrapped) (pcsc_get_status, get_status_ccid, my_rapdu_get_status): Likewise. (reset_pcsc_reader_wrapped, open_pcsc_reader_wrapped): Follow the change. (apdu_get_status_internal): It's lower-level driver which judge it's not needed. Otherwise, it can't detect the removal. * scd/ccid-driver.c (ccid_slot_status): After the POWERED_OFF check, we can skip sending GetSlotStatus packet on wire, when no need. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org> Fixes-commit: c8eee4d396a751d41fd1ee1e1b87b851fca172a
* scd: Don't send GET_STATUS packet if not needed.NIIBE Yutaka2017-01-301-8/+19
| | | | | | | | | * scd/apdu.c (apdu_get_status_internal): Add ON_WIRE arg. (apdu_connect): Call apdu_get_status_internal with ON_WIRE enabled. (apdu_get_status): For periodical check, call apdu_get_status_internal with ON_WIRE disabled. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix cancel INTERRUPT transfer.NIIBE Yutaka2017-01-301-19/+10
| | | | | | | * scd/ccid-driver.c (do_close_reader): Don't lock events, but check the return value of libusb_cancel_transfer. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: More changes on watching removal of card/reader.NIIBE Yutaka2017-01-275-113/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app-common.h (struct app_ctx_s): Rename field to periodical_check_needed. * scd/scdaemon.c (update_usb): Rename from update_fdset_for_usb. Don't use libusb_get_pollfds any more. (scd_kick_the_loop): New. (need_tick): Follow the rename. (handle_connections): No libusb event handling here. * scd/app.c (app_new_register): Follow the change of rename. (select_application, scd_update_reader_status_file): Likewise. * scd/ccid-driver.c (ccid_usb_thread_is_alive): New. (intr_cb): Call scd_kick_the_loop. (ccid_usb_thread): New. Thread to invoke INTERRUPT callback. (ccid_open_usb_reader): Add thread invocation. (ccid_require_get_status): Remove LIBUSB_WORKS_EXPECTED_FOR_INTERRUPT_ENDP. (do_close_reader): Carefully handle handle->transfer. (get_escaped_usb_string): Insert npth_unprotect/npth_protect. (do_close_reader, bulk_out, bulk_in, abort_cmd, ccid_slot_status) (ccid_transceive, ccid_transceive_secure): Likewise. -- It found that libusb_get_pollfds is not supported on Windows. Besides, it's a bit difficult to use for the select loop. Thus, we use the thread named ccid_usb_thread, instead. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix release of transfer object.NIIBE Yutaka2017-01-271-17/+28
| | | | | | | | * scd/ccid-driver.c (intr_cb): Handle LIBUSB_TRANSFER_CANCELLED. (do_close_reader): When callback is active, call libusb_cancel_transfer and wait callback is fired off. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Improve watching USB device removal.NIIBE Yutaka2017-01-278-106/+127
| | | | | | | | | | | | | | | | | | | | | | | * scd/apdu.c(struct reader_table_s): Add require_get_status. (apdu_connect): Change return value meaning. Call apdu_reset here. * scd/app.c (app_new_register): Add require_get_status. (select_application): Use the return value of apdu_connect. (scd_update_reader_status_file): Call update_fdset_for_usb with checking all_have_intr_endp. (app_list_start, app_list_finish): Remove. * scd/ccid-driver.c (struct ccid_driver_s): Add transfer. (intr_cb): Don't call libusb_transfer in this callback. (ccid_require_get_status): New. (do_close_reader): Call libusb_transfer here. * scd/scdaemon.c (update_fdset_for_usb): Remove the first argument. -- With Gnuk Token, it works fine as expected. With Gemalto reader, intr_cb is not called when card is removed. So, the macro LIBUSB_WORKS_EXPECTED_FOR_INTERRUPT_ENDP is not defined yet. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Wake up the select when new USB scan.NIIBE Yutaka2017-01-271-6/+45
| | | | | | | | | | | | | | | * scd/scdaemon.c (update_fdset_for_usb): Wake up the select(2). (handle_connections): Use a kind of "self-pipe" technique. -- Use pipe to wake up select(2). If UNIX-only, signal could be used. For portability, "self-pipe" is better, here. Setup for non-blocking for pipe fds are not needed, because speed of USB device insertion is limited by human physical interaction; No one can do hundreds of device insertion/removal-s per second. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Only submit apdu_get_status when needed.NIIBE Yutaka2017-01-267-42/+145
| | | | | | | | | | | | | | | * scd/apdu.c (apdu_dev_list_finish): Return Boolean value if all device support INTERRUPT transfer. * scd/ccid-driver.c (ccid_dev_scan_finish): Likewise. * scd/app.c (app_new_register): Fix initial value of card_status. (select_application): Call update_fdset_for_usb. (scd_update_reader_status_file): Ditto. * scd/scdaemon.c (update_fdset_for_usb, need_tick): New. (handle_connections): Call handle_tick when select returns. Let select watch USB file descriptors, too. Call libusb_handle_events_timeout_completed for INTERRUPT transfer. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* scd: Fix APP reference counting.NIIBE Yutaka2017-01-262-2/+1
| | | | | | | | | * scd/app.c (scd_update_reader_status_file): Don't call another release_application_internal. * scd/command.c (open_card_with_request): Don't require APPTYPE != NULL. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>