1 2007-12-10 Werner Koch <wk@g10code.com>
3 * app-openpgp.c (do_decipher): Take care of cryptograms shorter
4 that 128 bytes. Fixes bug#851.
6 2007-11-14 Werner Koch <wk@g10code.com>
8 * scdaemon.c (main): Pass STANDARD_SOCKET flag to
11 2007-11-13 Werner Koch <wk@g10code.com>
13 * scdaemon.c (start_connection_thread): Do not call
14 assuan_sock_check_nonce if we are running in --server mode.
16 2007-11-07 Werner Koch <wk@g10code.com>
18 * scdaemon.h: Remove errors.h.
20 2007-10-02 Werner Koch <wk@g10code.com>
22 * command.c (cmd_getinfo): Add "pid" subcommand.
24 2007-10-01 Werner Koch <wk@g10code.com>
26 * scdaemon.c (create_server_socket): Use Assuan socket wrappers
27 and remove Windows specific code.
29 (start_connection_thread): Check nonce.
31 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
33 * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
34 W32 targets. Use it for create_socket_name.
36 2007-08-07 Werner Koch <wk@g10code.com>
38 * tlv.c, tlv.h: Move to ../common/.
40 2007-08-02 Werner Koch <wk@g10code.com>
42 * scdaemon.c: Include gc-opt-flags.h and remove their definition
45 2007-08-01 Werner Koch <wk@g10code.com>
47 * apdu.c (send_le): Implement exact length hack. Suggested by
50 2007-07-05 Werner Koch <wk@g10code.com>
52 * command.c (has_option_name, skip_options): New.
53 (cmd_genkey): Add option --timestamp.
54 (cmd_writekey): Enter confidential mode while inquiring the key data.
56 * app.c (app_genkey): Add arg CREATETIME.
57 * app-common.h (app_ctx_s): Likewise
58 * app-openpgp.c (do_genkey): Ditto. Use it.
61 2007-07-04 Werner Koch <wk@g10code.com>
63 * command.c (cmd_getinfo): New subcommand "version".
65 * scdaemon.c (TIMERTICK_INTERVAL): New.
66 (handle_connections) [W32]: Enable a dummy sigs event.
67 (handle_connections): Use a proper count for select and not
69 (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
71 2007-06-21 Werner Koch <wk@g10code.com>
73 * scdaemon.h (ctrl_t): Remove. It is now declared in ../common/util.h.
75 2007-06-18 Marcus Brinkmann <marcus@g10code.de>
77 * scdaemon.c (main): Percent escape output of --gpgconf-list.
79 2007-06-12 Werner Koch <wk@g10code.com>
81 * scdaemon.c (main): Replace some calls by init_common_subsystems.
83 2007-06-11 Werner Koch <wk@g10code.com>
85 * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
87 * command.c (initialize_module_command): New.
88 * scdaemon.c (main) [W32]: Do not use sigpipe code.
89 (main): Call initialize_module_command.
91 2007-06-06 Werner Koch <wk@g10code.com>
93 * app-openpgp.c (do_sign): Fix arithmetic on void*.
95 * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
97 * apdu.c: Remove dynload.h.
99 * scdaemon.c (i18n_init): Remove.
101 2007-04-20 Werner Koch <wk@g10code.com>
103 * sc-copykeys.c (my_gcry_logger): Removed.
104 (main): Call setup_libgcrypt_logging helper.
105 * scdaemon.c (my_gcry_logger): Removed.
106 (main): Call setup_libgcrypt_logging helper.
108 2007-04-03 Werner Koch <wk@g10code.com>
110 * command.c (cmd_getinfo): New subcommand "reader_list".
111 * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
112 for special transports.
114 2007-03-07 Werner Koch <wk@g10code.com>
116 * app-dinsig.c: Include i18n.h.
117 (verify_pin): Support PIN pads.
118 * app-nks.c (verify_pin): Ditto.
120 * ccid-driver.c (bulk_in): Handle time extension before checking
122 (ccid_transceive_secure): Support the Cherry XX44 keyboard.
123 Kudos to the nice folks at Cherry for helping with that.
125 2007-02-18 Werner Koch <wk@g10code.com>
127 * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
129 2007-01-25 Werner Koch <wk@g10code.com>
131 * Makefile.am (scdaemon_LDADD): Added LIBICONV. Noted by Billy
134 2006-12-21 Werner Koch <wk@g10code.com>
136 * app-openpgp.c (verify_chv2): Factored most code out into...
137 (verify_a_chv): ... new.
138 (do_sign): Factored verification code out to new function and
139 take care of a keypad entered PIN.
140 (compare_fingerprint): Print an additional diagnostic.
142 2006-11-28 Werner Koch <wk@g10code.com>
144 * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
145 allow for full 256 byte and the status word. This might break
146 some old PC/SC drivers or cards, but we will see. Suggested by
149 2006-11-23 Werner Koch <wk@g10code.com>
151 * command.c (scd_command_handler): Fixed use of CTRL.
153 2006-11-21 Werner Koch <wk@g10code.com>
155 * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
156 Renamed to gnupg-pcsc-wrapper.
157 * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
158 wrapper. Suggested by Eric Dorland.
160 2006-11-20 Werner Koch <wk@g10code.com>
162 * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
164 * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
167 2006-11-17 Werner Koch <wk@g10code.com>
169 * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
170 log_debug. Removed few other log_debug.
172 * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
174 * command.c (pin_cb): New mode to prompt for a keypad entry.
176 * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
178 2006-11-15 Werner Koch <wk@g10code.com>
180 * app-p15.c (read_ef_odf): Cast one printf arg.
182 * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
183 * command.c (scd_command_handler): Add new arg CTRL.
184 * scdaemon.c (scd_init_default_ctrl): Made static.
185 (scd_deinit_default_ctrl): New.
186 (start_connection_thread): Call init/deinit of ctrl.
187 (handle_connections): Allocate CTRL.
189 * apdu.c (PCSC_ERR_MASK): New.
190 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
191 (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
192 values. Reported by Henrik Nordstrom. Fixes bug #724.
194 2006-10-24 Werner Koch <wk@g10code.com>
196 * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
197 (MAX_DIGEST_LEN): Increased to 36.
198 * app-p15.c (do_sign): Support for TLS_MD5SHA1.
199 (do_auth): Detect TLS_MD5SHA1.
200 (do_sign): Tweaks for that digest.
202 2006-10-23 Werner Koch <wk@g10code.com>
204 * scdaemon.c (main): New command --gpgconf-test.
206 2006-10-17 Werner Koch <wk@g10code.com>
208 * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
210 2006-10-12 Werner Koch <wk@g10code.com>
212 * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
215 2006-10-11 Werner Koch <wk@g10code.com>
217 * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
219 2006-10-06 Werner Koch <wk@g10code.com>
221 * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
222 (scdaemon_LDADD): Ditto.
224 * scdaemon.h (send_status_info): Mark with sentinel attribute.
226 2006-10-02 Marcus Brinkmann <marcus@g10code.de>
228 * command.c (update_reader_status_file): Increase buffer of
229 NUMBUF2 (fixing typo).
231 2006-09-24 Marcus Brinkmann <marcus@g10code.de>
233 * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
236 2006-09-14 Werner Koch <wk@g10code.com>
238 Replaced all call gpg_error_from_errno(errno) by
239 gpg_error_from_syserror().
241 * command.c (scd_command_handler): Replaced
242 init_connected_socket_server by init_socket_server_ext.
244 2006-09-07 Werner Koch <wk@g10code.com>
246 * command.c (update_reader_status_file): Execute an event handler
249 2006-09-06 Werner Koch <wk@g10code.com>
251 * apdu.c (pcsc_end_transaction):
252 * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
253 Reported by Bob Dunlop.
255 * scdaemon.h (CTRL,APP): Removed and changed everywhere to
258 Replaced all Assuan error codes by libgpg-error codes. Removed
259 all map_to_assuan_status and map_assuan_err.
261 * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
262 switch to gpg-error codes.
263 * command.c (set_error): Adjusted.
265 2006-09-02 Marcus Brinkmann <marcus@g10code.de>
267 * command.c (get_reader_slot): Return the slot_table index, not
268 the APDU slot number.
269 (update_reader_status_file): Use the slot_table index in the
270 update_card_removed invocation.
272 2006-09-01 Marcus Brinkmann <marcus@g10code.de>
274 * command.c (cmd_getinfo): Handle status command.
276 2006-08-30 Marcus Brinkmann <marcus@g10code.de>
278 * command.c (do_reset): Delay resetting CTRL->reader_slot until
279 after update_card_removed invocation.
281 2006-08-28 Marcus Brinkmann <marcus@g10code.de>
283 * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
284 resp. "OPENPGP.1" for KEYIDSTR.
286 2006-08-21 Werner Koch <wk@g10code.com>
288 * pcsc-wrapper.c (handle_open, handle_close): Reset card and
289 protocol on error/close.
290 (handle_status): Don't set the state if the state is unknown.
291 (handle_reset): Ignore an error if already disconnected. May
292 happen due to system wake-up after hibernation. Suggested by Bob
295 2006-06-28 Werner Koch <wk@g10code.com>
297 * app-openpgp.c (do_writekey): Fixed computation of memmove
298 length. This led to garbled keys if E was larger than one byte.
299 Thanks to Achim Pietig for hinting at the garbled E.
301 2006-06-09 Marcus Brinkmann <marcus@g10code.de>
303 * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
305 2006-04-14 Marcus Brinkmann <marcus@g10code.de>
307 * app.c (select_application): Cover up a slot mismatch error in
308 case it happens (it shouldn't happen).
309 (release_application): Use APP->slot. Lock the reader.
310 (application_notify_card_removed): Lock the reader.
312 2006-04-11 Werner Koch <wk@g10code.com>
314 * command.c (hex_to_buffer): New.
317 2006-04-03 Werner Koch <wk@g10code.com>
319 * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
321 2006-03-21 Werner Koch <wk@g10code.com>
323 * command.c (cmd_pksign): Add --hash option.
325 2006-03-01 Werner Koch <wk@g10code.com>
327 * command.c (status_file_update_lock): New.
328 (scd_update_reader_status_file): Use lock and factor existing code
330 (update_reader_status_file): .. this.
331 (do_reset): Use the lock and call update_reader_status_file.
333 2006-02-20 Werner Koch <wk@g10code.com>
335 * apdu.c (open_pcsc_reader): Fixed double free. Thanks to Moritz.
337 2006-02-09 Werner Koch <wk@g10code.com>
339 * command.c (get_reader_slot, do_reset)
340 (scd_update_reader_status_file): Rewrote.
342 * app.c (release_application): Factored code out to ..
343 (deallocate_app): new function.
344 (select_application): Introduce new saved application stuff.
345 (application_notify_card_removed): New.
346 * command.c (update_card_removed): Call it here.
347 (do_reset): And here.
349 * app.c (check_application_conflict): New.
350 * command.c (open_card): Use it here.
351 (cmd_restart): New command.
353 * command.c (cmd_lock): Fixed --wait option to actually terminate.
355 2006-02-08 Werner Koch <wk@g10code.com>
357 * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
358 using these parameters.
359 (scan_or_find_devices): Check for NULL r_fd.
361 2006-02-02 Werner Koch <wk@g10code.com>
363 * ccid-driver.c (special_transport): New
364 (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
365 (bulk_out, bulk_in): Add support for CardMan 4040 reader.
367 * ccid-driver.c (scan_or_find_devices): Factored most code out to
368 (scan_or_find_usb_device): .. new.
369 (make_reader_id): Fixed vendor mask.
371 2006-01-01 Werner Koch <wk@g10code.com>
373 * app-openpgp.c (do_sign): Give user error if hash algorithm is
374 not supported by the card.
376 2005-12-06 Werner Koch <wk@g10code.com>
378 * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
381 2005-11-23 Werner Koch <wk@g10code.com>
383 * app-nks.c (verify_pin): Give a special error message for a Nullpin.
385 2005-10-29 Werner Koch <wk@g10code.com>
387 * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
388 RESULTMAX. Changed all callers.
389 (ccid_transceive_escape): New.
391 2005-10-27 Werner Koch <wk@g10code.com>
393 * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
394 Suggested by John P. Clizbe.
395 * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
397 2005-10-19 Werner Koch <wk@g10code.com>
399 * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
400 * apdu.h (SW_HOST_NO_KEYPAD): New.
401 * iso7816.h (struct iso7816_pininfo_s): New.
402 * iso7816.c (map_sw): Support new code.
403 (iso7816_check_keypad): New.
404 (iso7816_verify_kp, iso7816_change_reference_data_kp)
405 (iso7816_reset_retry_counter_kp): New. Extended versions of the
407 * apdu.c (host_sw_string): Support new code.
408 (reader_table_s): New field CHECK_KEYPAD.
409 (new_reader_slot, open_ct_reader, open_pcsc_reader)
410 (open_ccid_reader, open_rapdu_reader): Initialize it.
411 (check_ccid_keypad): New.
412 (apdu_check_keypad): New.
413 (apdu_send_le): Factored all code out to ...
414 (send_le): .. new. Takes an additional arg; changed all callers
415 of the orginal function to use this one with a NULL for the new
417 (apdu_send_simple_kp): New.
418 (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu)
419 (send_apdu_ccid): New arg PININFO.
420 (send_apdu_ccid): Use the new arg.
422 * scdaemon.c: New option --disable-keypad.
424 2005-10-08 Marcus Brinkmann <marcus@g10code.de>
426 * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
427 ../common/libcommon.a.
429 2005-09-20 Werner Koch <wk@g10code.com>
431 * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
433 * iso7816.c (iso7816_select_application): Add arg FLAGS. Changed
434 all callers to pass 0.
435 * app-openpgp.c (app_select_openpgp): But this one requires a
438 * app-p15.c (app_select_p15): Don't use select application for the
441 2005-09-09 Werner Koch <wk@g10code.com>
443 * pcsc-wrapper.c (main): Removed bogus free.
445 * app-p15.c (do_auth): New.
446 (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
447 * app-openpgp.c (do_getattr): Ditto.
449 2005-09-08 Werner Koch <wk@g10code.com>
451 * app-openpgp.c (do_getattr): New key $AUTHKEYID.
453 2005-09-06 Werner Koch <wk@g10code.com>
455 * app-p15.c (do_sign): Tweaked for BELPIC cards.
456 (read_home_df): New arg R_BELPIC.
457 (app_select_p15): Set card type for BELPIC.
459 2005-09-05 Werner Koch <wk@g10code.com>
461 * iso7816.c (iso7816_select_path): New.
462 * app-p15.c (select_ef_by_path): Allow for direct path selection.
463 (app_select_p15): Try using the Belgian variant of pkcs#15.
465 (read_ef_odf): Generalized.
466 (read_ef_tokeninfo): New.
467 (read_p15_info): Set serialnumber from TokenInfo.
468 (app_select_p15): Don't munge serialNumber - that must be done
471 * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
472 data. Handle 6C00 error and take 6B00 as indication for EOF.
473 * apdu.h (SW_EXACT_LENGTH_P): New.
474 * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status)
475 (open_pcsc_reader): Set new reader state IS_T0.
476 (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
477 Problem reported by Carl Meijer.
478 (apdu_send_direct): Initialize RESULTLEN.
479 * pcsc-wrapper.c (handle_status): Return the current protocol as
482 2005-08-05 Werner Koch <wk@g10code.com>
484 * apdu.c (open_rapdu_reader): Set the reader number.
486 2005-07-05 Werner Koch <wk@g10code.com>
488 * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
489 required by the description. Thanks to Moritz for tracking this
492 2005-06-21 Werner Koch <wk@g10code.com>
494 * scdaemon.c (main): ifdef call to ccid_set_debug_level.
496 * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
499 2005-06-06 Werner Koch <wk@g10code.com>
501 * scdaemon.c (main): New option --debug-allow-core-dump.
503 2005-06-03 Werner Koch <wk@g10code.com>
505 * scdaemon.c (handle_connections): Make sure that the signals we
506 are handling are not blocked.Block signals while creating new
508 (handle_connections): Include the file descriptor into the name of
511 2005-06-02 Werner Koch <wk@g10code.com>
513 * app.c (app_dump_state, dump_mutex_state): New.
514 * scdaemon.c (handle_signal): Print it on SIGUSR1.
516 * app-openpgp.c (do_writekey): Typo fix.
518 * command.c (open_card): Check for locked state even if an
519 application context is available.
521 * app-common.h: Add REF_COUNT field.
522 * app.c (release_application, select_application): Implement
523 reference counting to share the context beween connections.
525 * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
526 argument. Changed all callers.
527 (select_application): Unlock the reader on error. This should fix
528 the hangs I noticed last week.
530 * scdaemon.h: Removed card_ctx_t cruft.
532 2005-06-01 Werner Koch <wk@g10code.com>
534 * scdaemon.c: Include mkdtemp.h.
536 2005-05-31 Werner Koch <wk@g10code.com>
538 * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
539 including a gnupg 1.4 header.
541 2005-05-30 Werner Koch <wk@g10code.com>
543 * tlv.c: Add hack to compile without gpg-error.h when used with
546 2005-05-23 Werner Koch <wk@g10code.com>
548 * Makefile.am: Do not build sc-copykeys anymore.
550 * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
551 (app_openpgp_cardinfo): Removed.
553 * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
555 (do_close_reader): Never do a reset. The caller should instead
556 make sure that the reader has been closed properly. The new retry
557 code in ccid_slot_status will make sure that the readersatrts up
558 fine even if the last process didn't closed the USB connection
560 (ccid_get_atr): For certain readers try switching to ISO mode.
561 Thanks to Ludovic Rousseau for this hint and the magic numbers.
562 (print_command_failed): New.
563 (bulk_in): Use it here. Add new arg NO_DEBUG.
564 (ccid_slot_status): Disabled debugging.
566 2005-05-21 Werner Koch <wk@g10code.com>
568 * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
570 2005-05-20 Werner Koch <wk@g10code.com>
572 * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
573 (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
574 (ccid_transceive): Arghhh. The seqno is another bit in the
575 R-block than in the I block, this was wrong at one place.
577 * scdaemon.c: New options --debug-ccid-driver and
578 --debug-disable-ticker.
580 * app-openpgp.c (do_genkey, do_writekey): Factored code to check
581 for existing key out into ..
582 (does_key_exist): .. New function.
584 2005-05-19 Werner Koch <wk@g10code.com>
586 * tlv.c (parse_sexp): New.
588 * command.c (cmd_writekey): New.
589 * app.c (app_writekey): New.
590 * app-common.c (app_t): Add function ptr WRITEKEY.
591 * app-openpgp.c (do_writekey): New.
593 * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
594 * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
595 store the Assuan context.
597 2005-05-17 Werner Koch <wk@g10code.com>
599 * scdaemon.c: Removed non-pth code paths.
600 (create_socket_name, create_server_socket): New. Taken from
602 (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
603 (ticker_thread): Always use pth_event_occurred; it is again
604 defined for all decent PTH versions.
605 (handle_connections): New. Based on the gpg-agent code.
606 (start_connection_thread): Ditto.
607 (ticker_thread): Removed.
608 (cleanup_sh): Removed.
609 (main): Run the handler for the pipe server in a separate
610 thread. This replaces the old ticker thread.
611 (scd_get_socket_name): New.
612 * command.c (cmd_getinfo): New command GETINFO.
613 (scd_command_handler): Renamed argument and changed code to use an
614 already connected FD.
616 2005-05-15 Werner Koch <wk@g10code.com>
618 * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
619 * app-openpgp.c: Change most function return types from int to
621 * command.c (pin_cb): Ditto.
622 * sc-copykeys.c (pincb): Ditto.
624 * app.c (lock_reader, unlock_reader): New. Changed call handler
625 wrappers to make use of these functions.
627 2005-05-07 Werner Koch <wk@g10code.com>
629 * ccid-driver.c (do_close_reader): Don't do a reset before close.
630 Some folks reported that it makes the SCR335 hang less often.
631 Look at the source on how to re-enable it.
633 2005-04-27 Werner Koch <wk@g10code.com>
635 * app-p15.c (micardo_mse): New.
637 * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
638 NULL to indicate an empty Lc.
639 * tlv.c (find_tlv): Check that a found object fits into the
641 (find_tlv_unchecked): New as replacement for the old non-checking
643 * app.c (select_application): Keep on using the non-checking
645 * app-openpgp.c (get_one_do, dump_all_do): Ditto.
648 Removal of the old OpenSC based code.
650 * app-p15.c: New. Basic support for pkcs15 cards without OpenSC.
651 There are quite a couple of things missing but at least I can use
652 my old TCOS cards from the Aegypten-1 development for signing.
653 * app.c (select_application): Detect pkcs15 applications.
654 * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
655 and card-p15.c because they are now obsolete. Added app-p15.c.
656 Removed all OpenSC stuff.
657 * command.c (do_reset, open_card, cmd_serialno, cmd_learn)
658 (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
659 all special cases for the old card.c based mechanisms.
660 * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
662 2005-04-20 Werner Koch <wk@g10code.com>
664 * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
666 2005-04-14 Werner Koch <wk@g10code.com>
668 * app-openpgp.c (retrieve_key_material): Rewritten. Return a
670 (retrieve_next_token): Removed.
671 (retrieve_fpr_from_card): Rewritten to make use of DO caching and
672 to take the KEYNO as arg.
673 (get_public_key): Renamed variable for clarity.
675 2005-04-12 Werner Koch <wk@g10code.com>
677 Basic support for several sessions.
679 * command.c (scd_command_handler): Replace the primary_connection
680 stuff by a real connection list. Release the local context on
682 (scd_update_reader_status_file): Update accordingly. Send signal
683 to all connections who registered an event signal.
684 (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
686 (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr)
687 (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
689 (do_reset): Handle locking.
690 (open_card): Ditto. Share the reader slot with other sessions.
691 (get_reader_slot): New.
692 (update_card_removed): New. Use it in the TEST_CARD_REMOVAL macro.
694 2005-04-07 Werner Koch <wk@g10code.com>
696 * app-openpgp.c (do_check_pin): Add hack to allow verification of
698 (get_public_key): Don't use gcry functions to create S-expressions.
699 (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
702 2005-03-29 Moritz Schulte <moritz@g10code.com>
704 * app-openpgp.c (retrieve_fpr_from_card): New function.
705 (retrieve_next_token): New function.
706 (retrieve_key_material): New function.
707 (get_public_key): Implement retrival of key through expernal
708 helper (gpg) in case the openpgp card is not cooperative enough.
710 2005-03-16 Werner Koch <wk@g10code.com>
712 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
713 reader type specific.
714 (scan_or_find_devices): Do not check the interface subclass in the
715 SPR532 kludge, as this depends on the firmware version.
716 (ccid_get_atr): Get the Slot status first. This solves the
717 problem with readers hanging on recent Linux 2.6.x.
718 (bulk_in): Add argument TIMEOUT and changed all callers to pass an
719 appropriate one. Change the standard timeout from 10 to 5 seconds.
720 (ccid_slot_status): Add a retry code with an initial short timeout.
721 (do_close_reader): Do an usb_reset before closing the reader.
723 2005-02-25 Werner Koch <wk@g10code.com>
725 * app-openpgp.c (get_public_key): Make sure not to return negative
727 (do_sign): Allow passing of indata with algorithm prefix.
728 (do_auth): Allow OPENPGP.3 as an alternative ID.
730 * app.c (app_getattr): Return just the S/N but not the timestamp.
732 2005-02-24 Werner Koch <wk@g10code.com>
734 * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
735 application does dot support the getattr call.
737 * app-openpgp.c (get_one_do): Never try to get a non cacheable
738 object from the cache.
739 (get_one_do): Add new arg to return an error code. Changed all
741 (do_getattr): Let it return a proper error code.
743 * app.c (select_application): Return an error code and the
744 application context in an new arg.
745 * command.c (open_card): Adjusted for that. Don't use the
746 fallback if no card is present. Return an error if the card has
747 been removed without a reset.
748 (do_reset, cmd_serialno): Clear that error flag.
749 (TEST_CARD_REMOVAL): New. Use it with all command handlers.
750 (scd_update_reader_status_file): Set the error flag on all changes.
752 * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
754 * apdu.c: Added some PCSC error codes.
755 (pcsc_error_to_sw): New.
756 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
757 (open_pcsc_reader): Do proper error code mapping.
759 2005-03-16 Werner Koch <wk@g10code.com>
761 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
762 reader type specific.
763 (scan_or_find_devices): Do not check the interface subclass in the
764 SPR532 kludge, as this depends on the firmware version.
765 (ccid_get_atr): Get the Slot status first. This solves the
766 problem with readers hanging on recent Linux 2.6.x.
768 2005-02-22 Werner Koch <wk@g10code.com>
770 * app-openpgp.c (app_local_s): New field PK.
771 (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
772 (get_public_key, send_keypair_info): New.
773 (do_learn_status): Send KEYPAIR info
775 * app-common.h (app_ctx_t): Add function pointer READKEY.
776 * app.c (app_readkey): New.
777 * command.c (cmd_readkey): Use READKEY function if possible.
779 2005-01-26 Werner Koch <wk@g10code.com>
781 * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
782 also for newer firmware versions. Need to get a list of fixed
783 firmware versions and use that.
785 2005-01-25 Werner Koch <wk@g10code.com>
787 * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
790 * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
791 the cache. Changed all callers.
792 (get_one_do): Bypass the cache if the value would have been read
793 directly for v1.1 cards.It makes things a bit slower but obnly for
794 1.0 cards and there are not that many cards out in the wild. This
795 is required to fix a caching bug when generating new keys; as a
796 side effect of the retrieval of the the C4 DO from the 6E DO the
797 cached fingerprint will get updated to the old value and later
798 when signing the generated key the checking of the fingerprint
799 fails because it won't match the new one. Thanks to Moritz for
800 analyzing this problem.
801 (verify_chv3): Removed the CHV status reread logic because we
802 won't cache the C4 DO anymore.
804 2004-12-28 Werner Koch <wk@g10code.com>
806 * ccid-driver.c (find_endpoint): New.
807 (scan_or_find_devices): Add new args to return endpoint info and
809 (ccid_open_reader, ccid_shutdown_reader): Take care of these new
811 (bulk_in, bulk_out): Use the correct endpoints.
812 (ccid_transceive_apdu_level): New.
813 (ccid_transceive): Divert to above.
814 (parse_ccid_descriptor): Allow APDU level exchange mode.
815 (do_close_reader): Pass the interface number to usb_release_interface.
817 2004-12-21 Werner Koch <wk@g10code.com>
819 * scdaemon.c (main): Use default_homedir().
821 2004-12-18 Werner Koch <wk@g10code.com>
823 * scdaemon.c (main) [W32]: Remove special Pth initialize..
825 * scdaemon.h (map_assuan_err): Define in terms of
826 map_assuan_err_with_source.
828 2004-12-15 Werner Koch <wk@g10code.com>
830 * scdaemon.c [W32]: Various hacks to make it run under W32.
832 * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
834 * apdu.c [W32]: Disable use of pcsc_wrapper.
836 * Makefile.am (scdaemon_LDADD): Reorder libs.
837 (sc_copykeys_LDADD): Add libassuan because it is needed for W32.
839 2004-12-06 Werner Koch <wk@g10code.com>
841 * Makefile.am (pkglib_PROGRAMS): Build only for W32.
843 2004-10-22 Werner Koch <wk@g10code.com>
845 * app-openpgp.c (verify_chv3): The minium length for CHV3 is
846 8. Changed string to match the other ones.
848 2004-10-21 Werner Koch <wk@g10code.com>
850 * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
851 This avoids problems with missing vasprintf implementations in
854 * app-common.h (app_openpgp_storekey: Add prototype.
856 2004-10-20 Werner Koch <wk@g10code.com>
858 * sc-investigate: Removed.
859 * Makefile.am (sc_investigate): Removed.
861 * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
862 (handle_open): Succeed even without a present card.
863 (handle_status, handle_reset): New.
865 * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
866 (pcsc_get_status): Implemented.
867 (reset_pcsc_reader): Implemented.
868 (open_pcsc_reader): Succeed even with no card inserted.
869 (open_ccid_reader): Set LAST_STATUS.
871 * iso7816.c (iso7816_select_application): Always use 0 for P1.
873 2004-10-18 Werner Koch <wk@g10code.com>
875 * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
877 2004-10-14 Werner Koch <wk@g10code.com>
879 * app-openpgp.c (parse_login_data): New.
880 (app_select_openpgp): Call it.
881 (do_setattr): Reparse it after change.
883 2004-10-06 Werner Koch <wk@g10code.de>
885 * ccid-driver.c (ccid_open_reader): Store the vendor ID.
886 (ccid_transceive_secure): New.
887 (parse_ccid_descriptor): Workaround for an SCM reader problem.
889 2004-10-04 Werner Koch <wk@g10code.de>
891 * ccid-driver.c (send_escape_cmd): New.
893 2004-09-30 Werner Koch <wk@g10code.com>
895 * Makefile.am: Adjusted for gettext 0.14.
897 * app-openpgp.c (do_sign): Add the error string to the verify
900 2004-09-27 Werner Koch <wk@g10code.com>
904 * app-openpgp.c: Made all strings translatable.
905 (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
906 available for use in gnupg 2.
907 (verify_chv3): Reimplemented countdown showing to use only
908 functions from this module. Flush the CVH status cache on a
910 (get_one_do): Hack to bypass the cache for cards versions > 1.0.
911 (store_fpr): Store the creation date for card version > 1.0.
913 * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
914 (get_cached_data): Move local data initialization to ..
915 (app_select_openpgp): .. here. Read some flags for later use.
916 (do_getattr): New read-only attribute EXTCAP.
918 * apdu.c (open_pcsc_reader): Do not print empty reader string.
920 * ccid-driver.c (do_close_reader): Factored some code out from ...
921 (ccid_close_reader): ..here.
922 (ccid_shutdown_reader): New.
924 * apdu.c (apdu_shutdown_reader): New.
925 (shutdown_ccid_reader): New.
927 * apdu.c (open_ccid_reader): New arg PORTSTR. Pass it to
929 (apdu_open_reader): Pass portstr to open_ccid_reader.
930 (apdu_open_reader): No fallback if a full CCID reader id has been
933 * ccid-driver.c (ccid_get_reader_list): New.
934 (ccid_open_reader): Changed API to take a string for the reader.
935 Removed al the cruft for the libusb development vesion which seems
936 not to be maintained anymore and there are no packages anyway.
937 The stable library works just fine.
938 (struct ccid_reader_id_s): Deleted and replaced everywhere by a
940 (usb_get_string_simple): Removed.
941 (bulk_in): Do valgrind hack here and not just everywhere.
943 * ccid-driver.c (read_device_info): Removed.
944 (make_reader_id, scan_or_find_devices): New.
945 (ccid_open_reader): Simplified by make use of the new functions.
946 (ccid_set_debug_level): New. Changed the macros to make use of
947 it. It has turned out that it is often useful to enable debugging
948 at runtime so I added this option.
950 From gnupg 1.3 - David Shaw <dshaw@jabberwocky.com>
952 * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
953 admin PINs can be entered before the card is locked.
955 * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
956 breaks us when using --enable-m-guard.
958 * ccid-driver.c (usb_get_string_simple): Replacement function to
959 work with older libusb.
961 * ccid-driver.c (read_device_info): Fix segfault when usb device
963 (ccid_open_reader): Allow working with an even older version of
964 libusb (usb_busses global instead of usb_get_busses()).
966 2004-09-11 Werner Koch <wk@g10code.com>
968 * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
969 not app_number_serialno.
971 2004-08-20 Werner Koch <wk@g10code.de>
973 * app.c (select_application): Fixed serial number extraction and
974 added the BMI card workaround.
975 (app_munge_serialno): New.
976 * app-openpgp.c (app_select_openpgp): Try munging serialno.
978 2004-08-05 Werner Koch <wk@g10code.de>
980 * scdaemon.c (main): New option --disable-application.
981 * app.c (is_app_allowed): New.
982 (select_application): Use it to check for disabled applications.
984 * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
985 * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
987 (ccid_get_atr): Handle short messages.
989 * apdu.c (my_rapdu_get_status): Implemented.
991 2004-07-27 Moritz Schulte <moritz@g10code.com>
993 * apdu.c: Include <signal.h>.
995 * Makefile.am: Use @DL_LIBS@ instead of -ldl.
997 2004-07-22 Werner Koch <wk@g10code.de>
999 * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1001 * apdu.c: Don't use Pth if we use OpenSC.
1002 * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.
1004 * scdaemon.c (main): Bumbed thread stack size up to 512k.
1006 2004-07-16 Werner Koch <wk@gnupg.org>
1008 * apdu.c (reader_table_s): Add function pointers for the backends.
1009 (apdu_close_reader, apdu_get_status, apdu_activate)
1010 (send_apdu): Make use of them.
1011 (new_reader_slot): Intialize them to NULL.
1012 (dump_ccid_reader_status, ct_dump_reader_status): New.
1013 (dump_pcsc_reader_status): New.
1014 (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1015 (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1016 (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu)
1017 (error_string): Removed. Replaced by apdu_strerror.
1018 (get_ccid_error_string): Removed.
1019 (ct_activate_card): Remove the unused loop.
1020 (reset_ct_reader): Implemented.
1021 (ct_send_apdu): Activate the card if not yet done.
1022 (pcsc_send_apdu): Ditto.
1024 2004-07-15 Werner Koch <wk@gnupg.org>
1026 * ccid-driver.h: Add error codes.
1027 * ccid-driver.c: Implement more or less proper error codes all
1030 * apdu.c (apdu_send_direct): New.
1031 (get_ccid_error_string): Add some error code mappings.
1032 (send_apdu): Pass error codes along for drivers already supporting
1034 (host_sw_string): New.
1035 (get_ccid_error_string): Use above.
1036 (send_apdu_ccid): Reset the reader if it has not yet been done.
1037 (open_ccid_reader): Don't care if the ATR can't be read.
1038 (apdu_activate_card): New.
1039 (apdu_strerror): New.
1040 (dump_reader_status): Only enable it with opt.VERBOSE.
1041 * iso7816.c (map_sw): Add mappings for the new error codes.
1043 2004-07-02 Werner Koch <wk@gnupg.org>
1045 * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1046 (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1049 2004-07-01 Werner Koch <wk@gnupg.org>
1051 * sc-investigate.c: Initialize Pth which is now required.
1052 (interactive_shell): New command "readpk".
1054 * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1056 2004-06-30 Werner Koch <wk@gnupg.org>
1058 * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1061 2004-06-18 Werner Koch <wk@g10code.com>
1063 * sc-investigate.c (my_read_line): Renamed from read_line.
1065 2004-06-16 Werner Koch <wk@gnupg.org>
1067 * apdu.c (osc_get_status): Fixed type in function name. Noted by
1068 Axel Thimm. Yes, I didn't tested it with OpenSC :-(.
1070 2004-04-28 Werner Koch <wk@gnupg.org>
1072 * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1074 2004-04-27 Werner Koch <wk@gnupg.org>
1076 * app-common.h: Do not include ksba.h for gnupg 1.
1078 2004-04-26 Werner Koch <wk@gnupg.org>
1080 * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1081 * app.c (release_application): Call new deconstructor.
1082 * app-openpgp.c (do_deinit): New.
1083 (get_cached_data, flush_cache_item, flush_cache_after_error)
1085 (get_one_do): Replaced arg SLOT by APP. Make used of cached data.
1086 (verify_chv2, verify_chv3): Flush some cache item after error.
1087 (do_change_pin): Ditto.
1089 (do_setattr): Flush cache item.
1090 (do_genkey): Flush the entire cache.
1091 (compare_fingerprint): Use cached data.
1093 * scdaemon.c (main): Do the last change the usual way. This is so
1094 that we can easily test for versioned config files above.
1096 2004-04-26 Marcus Brinkmann <marcus@g10code.de>
1098 * scdaemon.c (main): For now, always print default filename for
1099 --gpgconf-list, and never /dev/null.
1101 2004-04-21 Werner Koch <wk@gnupg.org>
1103 * command.c (scd_update_reader_status_file): Send a signal back to
1105 (option_handler): Parse the new event-signal option.
1107 * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1108 changing the verbosity.
1110 2004-04-20 Werner Koch <wk@gnupg.org>
1112 * command.c (scd_update_reader_status_file): Write status files.
1114 * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1117 * pcsc-wrapper.c: New.
1118 * Makefile.am (pkglib_PROGRAMS): Install it here.
1119 * apdu.c (writen, readn): New.
1120 (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1121 pcsc-wrapper if we are using Pth.
1122 (apdu_send_le): Reinitialize RESULTLEN. Handle SW_EOF_REACHED
1125 2004-04-19 Werner Koch <wk@gnupg.org>
1127 * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1128 features away. New arg HANDLE
1129 (read_device_info): New arg HANDLE. Changed caller.
1130 (bulk_in): Handle time extension requests.
1131 (ccid_get_atr): Setup parameters and the IFSD.
1132 (compute_edc): New. Factored out code.
1133 (ccid_transceive): Use default NADs when required.
1135 2004-04-14 Werner Koch <wk@gnupg.org>
1137 * scdaemon.h (server_control_s): Add member READER_SLOT.
1138 * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
1139 * command.c (open_card): Reuse an open slot.
1140 (reset_notify): Just reset the slot if supported by the reader.
1141 (do_reset): Factored code from above out.
1142 (scd_command_handler): Use it for cleanup.
1144 * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
1145 SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
1146 * iso7816.c (map_sw): Map it.
1148 * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
1149 * apdu.c (apdu_get_status): New.
1150 (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
1151 (get_status_ccid): New.
1153 (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
1154 (reset_ccid_reader): New.
1155 (apdu_enum_reader): New.
1157 * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
1158 (new_reader_slot) [USE_GNU_PTH]: Init mutex.
1159 (apdu_reset, apdu_get_status, apdu_send_le): Run functions
1162 * command.c (scd_update_reader_status_file): New.
1163 * scdaemon.c (handle_tick): Call it.
1165 2004-04-13 Werner Koch <wk@gnupg.org>
1167 * scdaemon.c: Convert to a Pth application.
1168 (handle_signal, ticker_thread, handle_tick): New.
1169 (main): Fire up the ticker thread in server mode.
1171 2004-03-23 Werner Koch <wk@gnupg.org>
1173 * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
1175 2004-03-17 Werner Koch <wk@gnupg.org>
1177 * tlv.c (parse_ber_header): Do not check for tag overflow - it
1178 does not make sense. Simplified the check for length overflow.
1180 * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
1182 2004-03-16 Werner Koch <wk@gnupg.org>
1184 * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
1185 * app-nks.c (get_length_of_cert): Removed.
1187 (app_help_read_length_of_cert): New. Code taken from above. New
1188 optional arg R_CERTOFF.
1190 * card-dinsig.c: Removed.
1191 * card.c (card_get_serial_and_stamp): Do not bind to the old and
1192 never finsiged card-dinsig.c.
1194 * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
1196 2004-03-11 Werner Koch <wk@gnupg.org>
1198 * scdaemon.h (out_of_core): Removed. Replaced callers by standard
1201 * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
1202 to include a header defined by the compiler. This helps us to
1203 reuse the source in other software.
1205 2004-03-10 Werner Koch <wk@gnupg.org>
1207 * iso7816.c (iso7816_read_record): New arg SHORT_EF. Changed all
1210 2004-02-18 Werner Koch <wk@gnupg.org>
1212 * sc-investigate.c (main): Setup the used character set.
1213 * scdaemon.c (main): Ditto.
1215 * scdaemon.c (set_debug): New. Add option --debug-level.
1216 (main): Add option --gpgconf-list.
1218 2004-02-12 Werner Koch <wk@gnupg.org>
1220 * Makefile.am: Include cmacros.am for common flags.
1222 2004-01-29 Werner Koch <wk@gnupg.org>
1224 * command.c (reset_notify): Release the application context and
1227 2004-01-28 Werner Koch <wk@gnupg.org>
1229 * iso7816.c (iso7816_manage_security_env): New.
1230 (iso7816_decipher): Add PADIND argument.
1232 2004-01-27 Werner Koch <wk@gnupg.org>
1234 * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
1236 * app-common.h (app_ctx_s): Added readcert field.
1237 * app.c (app_readcert): New.
1238 * tlv.c (parse_ber_header): Added; taken from libksba.
1240 2004-01-26 Werner Koch <wk@gnupg.org>
1242 * card.c (map_sc_err): Use SCD as the error source.
1244 * command.c (open_card): ADD arg NAME to allow requesting a
1245 specific application. Changed all callers.
1246 (cmd_serialno): Allow optional argument to select the desired
1251 * scdaemon.h (opt): Add READER_PORT.
1252 * scdaemon.c (main): Set it here.
1253 * app.c (app_set_default_reader_port): Removed.
1254 (select_application): Add NAME arg and figure out a
1255 default serial number from the GDO. Add SLOT arg and remove all
1257 (release_application): New.
1258 (app_write_learn_status): Output an APPTYPE status line.
1259 * command.c (open_card): Adapt for select_application change.
1260 * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
1261 and set it directly. Changed all callers.
1263 2004-01-25 Werner Koch <wk@gnupg.org>
1265 * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
1267 * app-openpgp.c (find_tlv): Factor out this function to ..
1268 * tlv.c, tlv.h: .. new.
1270 * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
1273 2004-01-21 Werner Koch <wk@gnupg.org>
1275 * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
1277 2004-01-20 Werner Koch <wk@gnupg.org>
1279 * iso7816.c (iso7816_read_binary): New.
1280 (iso7816_select_file): New.
1281 (iso7816_list_directory): New.
1283 * sc-investigate.c: Add option -i.
1284 (select_app, read_line, interactive_shell): New.
1286 2004-01-16 Werner Koch <wk@gnupg.org>
1288 * apdu.h: Add SW_FILE_NOT_FOUND.
1289 * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
1290 * iso7816.c (iso7816_select_file): New.
1292 * app-dinsig.c: New file w/o any real code yet.
1293 * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
1295 * sc-investigate.c: Add option --disable-ccid.
1297 2003-12-19 Werner Koch <wk@gnupg.org>
1299 * apdu.c (apdu_send_le): Send a get_response with the indicated
1300 length and not the 64 bytes we used for testing.
1302 * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
1303 minimum length of the passphrase, so that we don't need to
1304 decrement the retry counter.
1306 2003-12-17 Werner Koch <wk@gnupg.org>
1308 * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
1309 * card-dinsig.c (dinsig_enum_keypairs): Ditto.
1311 2003-12-16 Werner Koch <wk@gnupg.org>
1313 * scdaemon.c (main): Set the prefixes for assuan logging.
1315 2003-11-17 Werner Koch <wk@gnupg.org>
1317 * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
1318 * app-openpgp.c (verify_chv3): Check it here.
1320 2003-11-12 Werner Koch <wk@gnupg.org>
1322 Adjusted for API changes in Libksba.
1324 2003-10-30 Werner Koch <wk@gnupg.org>
1326 * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
1327 (get_ccid_error_string): New. Not very useful messages, though.
1329 2003-10-25 Werner Koch <wk@gnupg.org>
1331 * ccid-driver.c (ccid_open_reader): Return an error if no USB
1334 * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
1337 * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
1339 2003-10-20 Werner Koch <wk@gnupg.org>
1341 * command.c (cmd_checkpin): New.
1342 (register_commands): Add command CHECKPIN.
1343 * app.c (app_check_pin): New.
1344 * app-openpgp.c (check_against_given_fingerprint): New. Factored
1345 out that code elsewhere.
1346 (do_check_pin): New.
1348 2003-10-10 Werner Koch <wk@gnupg.org>
1350 * ccid-driver.c (ccid_close_reader): New.
1352 * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
1353 (close_osc_reader, apdu_close_reader): New. Not all are properly
1356 2003-10-09 Werner Koch <wk@gnupg.org>
1358 * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
1360 2003-10-08 Werner Koch <wk@gnupg.org>
1362 * app-openpgp.c (do_getattr): Support SERIALNO and AID.
1364 2003-10-01 Werner Koch <wk@gnupg.org>
1366 * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
1368 * app-openpgp.c: Ditto.
1370 (generate_keypair): Renamed to ..
1371 (do_generate_keypair): .. this.
1372 * app-common.h [GNUPG_MAJOR_VERSION]: New.
1373 * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
1375 2003-09-30 Werner Koch <wk@gnupg.org>
1377 * command.c (cmd_getattr): New command GETATTR.
1378 * app.c (app_setattr): New.
1380 (do_learn_status): Reimplemented in terms of do_getattr.
1382 * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
1384 (verify_chv2, verify_chv3): New. Factored out common code.
1385 (do_setattr, do_sign, do_auth, do_decipher): Change the names of
1386 the prompts to match that we have only 2 different PINs.
1387 (app_select_openpgp): Check whether the card enforced CHV1.
1388 (convert_sig_counter_value): New. Factor out code from
1391 2003-09-28 Werner Koch <wk@gnupg.org>
1393 * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
1395 2003-09-19 Werner Koch <wk@gnupg.org>
1397 * ccid-driver.c (parse_ccid_descriptor): New.
1398 (read_device_info): New.
1399 (ccid_open_reader): Check that the device has all required features.
1401 2003-09-06 Werner Koch <wk@gnupg.org>
1403 * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
1404 David Corcoran was so kind to remove the GPL incompatible
1405 advertisng clause from pcsclite.
1406 * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
1408 2003-09-05 Werner Koch <wk@gnupg.org>
1410 * ccid-driver.c: More work, data can now actually be retrieved.
1411 * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
1414 2003-09-02 Werner Koch <wk@gnupg.org>
1416 * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
1417 * ccid-driver.c, ccid-driver.h: New but far from being useful.
1418 * Makefile.am: Add above.
1419 * apdu.c: Add support for that ccid driver.
1421 2003-08-26 Timo Schulz <twoaday@freakmail.de>
1423 * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
1426 2003-08-25 Werner Koch <wk@gnupg.org>
1428 * command.c (cmd_setattr): Use a copy of LINE.
1429 (cmd_genkey): Use a copy of KEYNO.
1430 (cmd_passwd): Use a copy of CHVNOSTR.
1431 (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
1433 2003-08-19 Werner Koch <wk@gnupg.org>
1435 * scdaemon.c, scdaemon.h: New option --pcsc-driver.
1436 * apdu.c (apdu_open_reader): Use that option here instead of a
1439 2003-08-18 Werner Koch <wk@gnupg.org>
1441 * Makefile.am: Add OPENSC_LIBS to all programs.
1443 * scdaemon.c, scdaemon.h: New option --disable-opensc.
1444 * card.c (card_open): Implement it.
1445 * apdu.c (open_osc_reader, osc_send_apdu): New.
1446 (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
1448 (error_string) [HAVE_OPENSC]: Use sc_strerror.
1449 (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
1451 * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
1454 2003-08-14 Timo Schulz <twoaday@freakmail.de>
1456 * apdu.c (ct_activate_card): Change the code a little to avoid
1457 problems with other readers.
1458 * Always use 'dynload.h' instead of 'dlfcn.h'.
1460 2003-08-05 Werner Koch <wk@gnupg.org>
1462 * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
1465 2003-08-04 Werner Koch <wk@gnupg.org>
1467 * app.c (app_set_default_reader_port): New.
1468 (select_application): Use it here.
1469 * scdaemon.c (main): and here.
1470 * sc-copykeys.c: --reader-port does now take a string.
1471 * sc-investigate.c, scdaemon.c: Ditto.
1472 * apdu.c (apdu_open_reader): Ditto. Load pcsclite if no ctapi
1473 driver is configured. Always include code for ctapi.
1474 (new_reader_slot): Don't test for already used ports and remove
1476 (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
1477 (apdu_send_le): Changed RC to long to cope with PC/SC.
1479 * scdaemon.c, scdaemon.h: New option --ctapi-driver.
1480 * sc-investigate.c, sc-copykeys.c: Ditto.
1482 2003-07-31 Werner Koch <wk@gnupg.org>
1484 * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
1486 2003-07-28 Werner Koch <wk@gnupg.org>
1488 * app-openpgp.c (do_setattr): Change implementation. Allow all
1491 2003-07-27 Werner Koch <wk@gnupg.org>
1493 Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
1495 2003-07-24 Werner Koch <wk@gnupg.org>
1497 * app-openpgp.c (do_learn_status): Print more status information.
1498 (app_select_openpgp): Store the card version.
1499 (store_fpr): Add argument card_version and fix DOs for old cards.
1500 (app_openpgp_storekey): Likewise.
1502 2003-07-23 Werner Koch <wk@gnupg.org>
1504 * command.c (cmd_pkauth): New.
1505 (cmd_setdata): Check whether data was given at all to avoid
1506 passing 0 to malloc.
1508 * app.c (app_auth): New.
1509 * app-openpgp.c (do_auth): New.
1511 2003-07-22 Werner Koch <wk@gnupg.org>
1513 * command.c (cmd_passwd): New.
1514 * app.c (app_change_pin): New.
1515 * app-openpgp.c (do_change_pin): New.
1516 * iso7816.c (iso7816_reset_retry_counter): Implemented.
1518 * sc-investigate.c (main): New option --gen-random.
1519 * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
1520 length larger than 255.
1522 2003-07-17 Werner Koch <wk@gnupg.org>
1524 * command.c (cmd_random): New command RANDOM.
1526 * iso7816.c (map_sw): New. Use it in this file to return
1527 meaningful error messages. Changed all public fucntions to return
1529 (iso7816_change_reference_data): New.
1530 * apdu.c (apdu_open_reader): Use faked status words for soem
1533 2003-07-16 Werner Koch <wk@gnupg.org>
1535 * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
1536 specify not to send Le as it should be.
1538 2003-07-15 Werner Koch <wk@gnupg.org>
1540 * Makefile.am: Add sc-copykeys program.
1541 * sc-copykeys.c: New.
1542 * app-openpgp.c (app_openpgp_storekey): New.
1543 (app_openpgp_cardinfo): New.
1545 (store_fpr): And use it here to get the actual length in bit.
1547 2003-07-03 Werner Koch <wk@gnupg.org>
1549 * app-openpgp.c (do_setattr): Add setting of the URL.
1550 (app_select_openpgp): Dump card data only in very verbose mode.
1553 2003-07-02 Werner Koch <wk@gnupg.org>
1555 * app-openpgp.c (get_sig_counter): New.
1556 (do_sign): Print the signature counter and enable the PIN callback.
1557 (do_genkey): Implement the PIN callback.
1559 2003-07-01 Werner Koch <wk@gnupg.org>
1561 * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
1563 2003-06-26 Werner Koch <wk@gnupg.org>
1565 * app-openpgp.c (find_tlv): Fixed length header parsing.
1567 * app.c (app_genkey): New.
1568 * command.c (cmd_genkey): New.
1570 2003-06-25 Werner Koch <wk@gnupg.org>
1572 * command.c (percent_plus_unescape): New.
1575 2003-06-24 Werner Koch <wk@gnupg.org>
1577 * command.c (send_status_info): New.
1579 * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
1580 and setup the function pointers in APP on success. Changed callers.
1582 * app-common.h: New.
1583 * scdaemon.h (APP): New type to handle applications.
1584 (server_control_s): Add an APP context field.
1586 * command.c (cmd_serialno): Handle applications.
1587 (cmd_pksign): Ditto.
1588 (cmd_pkdecrypt): Ditto.
1589 (reset_notify): Ditto.
1590 (cmd_learn): For now return error for application contexts.
1591 (cmd_readcert): Ditto.
1592 (cmd_readkey): Ditto.
1594 2003-06-04 Werner Koch <wk@gnupg.org>
1596 * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
1598 Renamed error codes from INVALID to INV and removed _ERROR suffixes.
1600 2003-06-03 Werner Koch <wk@gnupg.org>
1602 Changed all error codes in all files to the new libgpg-error scheme.
1604 * scdaemon.h: Include gpg-error.h and errno.h
1605 * card.c (map_sc_err): Use unknown for the error source.
1606 * Makefile.am: Link with libgpg-error
1608 2003-05-14 Werner Koch <wk@gnupg.org>
1610 * atr.c, atr.h: New.
1611 * sc-investigate.c: Dump the ATR in a human readable format.
1613 2003-05-08 Werner Koch <wk@gnupg.org>
1615 * scdaemon.h (DBG_CARD_IO_VALUE): New.
1617 * sc-investigate.c: New.
1618 * scdaemon.c (main): Removed --print-atr option.
1620 * iso7816.c, iso7816.h, app-openpgp.c: New.
1622 2003-04-29 Werner Koch <wk@gnupg.org>
1624 * scdaemon.c: New options --print-atr and --reader-port
1625 * apdu.c, apdu.h: New
1627 * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
1629 * Makefile.am (LDFLAGS): Removed.
1631 * command.c (register_commands): Adjusted for new Assuan semantics.
1633 2002-08-21 Werner Koch <wk@gnupg.org>
1635 * scdaemon.c (main): New option --daemon so that the program is
1636 not accidently started in the background.
1638 2002-08-16 Werner Koch <wk@gnupg.org>
1640 * scdaemon.c: Include i18n.h.
1642 * card-common.h (struct p15_private_s): Forward declaration. Add
1644 * card.c (card_close): Make sure private data is released.
1645 (card_enum_certs): New.
1646 * card-p15.c (p15_release_private_data): New.
1647 (init_private_data): New to work around an OpenSC weirdness.
1648 (p15_enum_keypairs): Do an OpenSC get_objects only once.
1649 (p15_enum_certs): New.
1650 (card_p15_bind): Bind new function.
1651 * command.c (cmd_learn): Return information about the certificates.
1653 2002-08-09 Werner Koch <wk@gnupg.org>
1655 * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
1656 number as a fallback. Add a special prefix for serial numbers.
1658 2002-07-30 Werner Koch <wk@gnupg.org>
1660 Changes to cope with OpenSC 0.7.0:
1662 * card.c: Removed the check for the packed opensc version.
1663 Changed include file names of opensc.
1664 (map_sc_err): Adjusted error codes for new opensc version.
1665 * card-p15.c: Changed include filename of opensc.
1666 * card-dinsig.c: Ditto.
1668 * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
1670 2002-07-24 Werner Koch <wk@gnupg.org>
1672 * card.c (find_simple_tlv, find_iccsn): New.
1673 (card_get_serial_and_stamp): Improved serial number parser.
1675 2002-06-27 Werner Koch <wk@gnupg.org>
1677 * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
1679 2002-06-15 Werner Koch <wk@gnupg.org>
1681 * card-dinsig.c: Documented some stuff from the DIN norm.
1683 2002-04-15 Werner Koch <wk@gnupg.org>
1685 * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
1687 2002-04-12 Werner Koch <wk@gnupg.org>
1689 * scdaemon.c: New option --debug-sc N.
1690 * card.c (card_open): set it here.
1692 * card-p15.c (p15_prepare_key): Factored out common code from ...
1693 (p15_sign, p15_decipher): here and made the decryption work the
1696 2002-04-10 Werner Koch <wk@gnupg.org>
1698 * card.c (card_open): Return immediately when no reader is available.
1700 2002-03-27 Werner Koch <wk@gnupg.org>
1702 * card.c (card_open, card_close): Adjusted for changes in OpenSC.
1704 2002-03-10 Werner Koch <wk@gnupg.org>
1706 * card-p15.c, card-dinsig.c, card-common.h: New.
1707 * card.c: Factored most code out to the new modules, so that we
1708 can better support different types of card applications.
1710 2002-01-26 Werner Koch <wk@gnupg.org>
1712 * scdaemon.c scdaemon.h, command.c: New. Based on the code from
1716 Copyright 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
1718 This file is free software; as a special exception the author gives
1719 unlimited permission to copy and/or distribute it, with or without
1720 modifications, as long as this notice is preserved.
1722 This file is distributed in the hope that it will be useful, but
1723 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
1724 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.