1 2009-07-24 Werner Koch <wk@g10code.com>
3 * ccid-driver.c (parse_ccid_descriptor): Enable hack for SCR 3320.
5 2009-07-21 Werner Koch <wk@g10code.com>
7 * ccid-driver.c [HAVE_PTH]: Include pth.h.
9 (bulk_in): s/gnupg_sleep/my_sleep/.
11 2009-07-20 Werner Koch <wk@g10code.com>
13 * apdu.c [GNUPG_MAJOR_VERSION==1]: Include dynload.h.
15 2009-07-16 Werner Koch <wk@g10code.com>
17 * command.c (update_reader_status_file): Test for unplugged reader.
18 (TEST_CARD_REMOVAL): Ditto.
19 * app.c (select_application): Ditto.
20 * ccid-driver.c (bulk_out): Return CCID_DRIVER_ERR_NO_READER if a
22 (struct ccid_driver_s): Turn nonnull_nad into an unsigned char.
23 Turn apdu_level, auto_ifsd, powered_off, has_pinpad into
24 bitfields. Add enodev_seen.
25 * apdu.c (apdu_prepare_exit): New.
26 (get_status_ccid): Return the status word and nut just -1.
27 * scdaemon.c (scd_exit): Call it.
29 2009-07-13 Werner Koch <wk@g10code.com>
31 * ccid-driver.c (struct ccid_driver_s): Add fields last_progress,
32 progress_cb and progress_cb_arg.
33 (ccid_set_progress_cb): New.
34 (print_progress): New.
35 (ccid_transceive): Call print_progress for wait time extensions.
36 * apdu.c (struct reader_table_s): Add field set_progress_cb.
37 (new_reader_slot): Clear that field.
38 (open_ccid_reader): Set it to ..
39 (set_progress_cb_ccid_reader): ... new fucntion.
40 * app.c (print_progress_line): New.
41 (lock_reader): Add arg CTRL to set a progress callback and
42 change all callers to provide it.
43 (unlock_reader): Remove the progress callback.
45 2009-07-10 Werner Koch <wk@g10code.com>
47 * iso7816.c (iso7816_compute_ds): Add args EXTENDED_MODE and LE.
48 Change all callers to use 0.
49 (iso7816_internal_authenticate): Add args EXTENDED_MODE and LE.
50 * app-openpgp.c (do_sign): Take exmode and Le from card
51 capabilities and pass them to iso7816_compute_ds.
52 (do_auth): Ditto for iso7816_internal_authenticate.
53 (change_keyattr): Reset CHV verification status.
55 2009-07-09 Werner Koch <wk@g10code.com>
57 * app-openpgp.c (change_keyattr): New.
58 (do_writekey): Call it.
60 * app-openpgp.c (does_key_exist): Add arg GENERATING. Change
63 2009-06-30 Werner Koch <wk@g10code.com>
65 * ccid-driver.c (ccid_transceive): Set RESYNCING flag.
67 2009-06-29 Werner Koch <wk@g10code.com>
69 * ccid-driver.c (ccid_transceive): Add a hack to support extended
70 length for Omnikey readers.
72 (parse_ccid_descriptor): Track short+extended apdu exchange level.
74 2009-06-18 Werner Koch <wk@g10code.com>
76 * app-openpgp.c (verify_chv2): Remove special case for v2 cards.
77 (get_public_key): Use extended mode.
79 2009-06-17 Werner Koch <wk@g10code.com>
81 * iso7816.c (iso7816_get_data): Add arg EXTENDED_MODE. Change all
83 * app-openpgp.c (data_objects): Use bit flags. Add flag
85 (get_cached_data): Add arg TRY_EXTLEN and use it for iso7816_get_data.
86 (get_one_do): Use extended length APDU if necessary.
88 2009-06-10 Werner Koch <wk@g10code.com>
90 * app-openpgp.c (store_fpr): Change first arg to app_t; adjust
91 callers. Flush the cache.
93 2009-06-09 Werner Koch <wk@g10code.com>
95 * app-openpgp.c (do_readcert): Return NOT_FOUND if the retrieved
96 data has a length of zero.
97 (do_getattr): Add EXTCAP subkey "sm".
99 2009-05-20 Werner Koch <wk@g10code.com>
101 * app-openpgp.c (verify_chv2): Add case for v2 cards.
102 (verify_chv3): Factor some code out to ..
103 (build_enter_admin_pin_prompt): .. new.
104 (do_change_pin): Properly handle v2 cards.
106 2009-05-19 Werner Koch <wk@g10code.com>
108 * scdaemon.c (create_server_socket): Use SUN_LEN.
109 (JNLIB_NEED_AFLOCAL): Define.
111 2009-05-13 Werner Koch <wk@g10code.com>
113 * ccid-driver.c (abort_cmd): Add arg SEQNO and change callers.
114 (bulk_in): Retry on seqno mismatch.
116 * apdu.c (send_le): Release result_buffer.
117 (apdu_send_direct): Implemend extended length.
118 * command.c (cmd_apdu): Add option "--exlen".
120 2009-05-11 Werner Koch <wk@g10code.com>
122 * apdu.c (send_le): Replace log_error by log_info.
124 2009-05-08 Werner Koch <wk@g10code.com>
126 * app-openpgp.c (do_genkey): Allow larger key sizes.
127 (do_decipher): Ditto.
128 * iso7816.c (do_generate_keypair): Add arg EXTENDED_MODE an LE.
129 (iso7816_generate_keypair, iso7816_read_public_key): Ditto.
131 * apdu.c (send_le): Implement extended length return values.
133 * ccid-driver.c (bulk_in): Retry on EAGAIN.
134 (abort_cmd): Change seqno handling.
136 2009-04-28 Werner Koch <wk@g10code.com>
138 * app-help.c (app_help_count_bits): New.
140 * app-nks.c (switch_application): Detect mass signature cards.
141 Take care of new NEED_APP_SELECT flag.
142 (do_sign): Don't allow mass signature cards.
145 (app_select_nks): Register do_readkey.
147 2009-04-01 Werner Koch <wk@g10code.com>
149 * app-openpgp.c (do_setattr, do_writekey): Prepare for extended
152 2009-03-31 Werner Koch <wk@g10code.com>
154 * command.c (percent_plus_unescape): Remove.
155 (cmd_setattr): Use percent_plus_unescape_inplace.
157 2009-03-30 Werner Koch <wk@g10code.com>
159 * app-nks.c (do_decipher): Make it work for TCOS 3.
160 * iso7816.c (iso7816_decipher): Add arg EXTENDED_MODE.
161 * apdu.c (apdu_send): Add arg EXTENDED_MODE and change all callers.
162 (apdu_send_le): Ditto.
163 (apdu_send_direct): Ditto, but not yet functional.
164 (send_le): Fix command chaining. Implement extended length option.
165 * ccid-driver.c (ccid_transceive): Remove restriction on apdu length.
166 (struct ccid_driver_s): Add field IFSC.
167 (ccid_get_atr): Set IFSC.
168 (ccid_transceive): Use negotiated IFSC and support S(IFS) command.
170 2009-03-26 Werner Koch <wk@g10code.com>
172 * command.c (cmd_pksign): Allow more hash algorithms.
174 * scdaemon.h (MAX_DIGEST_LEN): Change to 64.
176 * apdu.c (open_ccid_reader): Clear the is_to flag.
178 * app-nks.c (filelist): Add field KID.
179 (do_getattr): Change standard authentication key.
180 (do_sign): Setup a security environment for TCOS 3 cards and support
181 all SHA-2 algorithms.
183 2009-03-24 Werner Koch <wk@g10code.com>
185 * command.c (struct server_local_s): Add flag
186 APP_CTX_MARKED_FOR_RELEASE.
187 (do_reset): Set the flag.
188 (open_card): Act on this flag.
189 * app-common.h (struct app_ctx_s): Add flag NO_REUSE.
190 (application_notify_card_reset): Set the flag.
191 * app.c (select_application, release_application): Take care of
194 2009-03-20 Werner Koch <wk@g10code.com>
196 * app-nks.c (keygripstr_from_pk_file): Fix for TCOS 3 cards.
198 2009-03-18 Werner Koch <wk@g10code.com>
200 * apdu.c (open_pcsc_reader_wrapped): Use close_all_fds.
202 * command.c (cmd_learn): Add option --keypairinfo.
203 * app.c (app_write_learn_status): Add arg FLAGS.
204 * app-common.h (struct app_ctx_s): Add arg FLAGS to LEARN_STATUS.
205 Change all implementors.
206 * app-p15.c (do_learn_status): Take care of flag bit 0.
207 * app-nks.c (do_learn_status, do_learn_status_core): Ditto.
209 2009-03-10 Werner Koch <wk@g10code.com>
211 * app-openpgp.c (send_key_attr): New.
212 (do_getattr): New attribute KEY_ATTR.
213 * command.c (send_status_direct): New.
215 2009-03-06 Werner Koch <wk@g10code.com>
217 * app-nks.c (do_learn_status): Factor code out to..
218 (do_learn_status_core): .. new.
219 (do_readcert, do_sign, do_decipher): Switch to SigG if needed.
220 (verify_pin): Use DESC also for keypad based verify.
222 2009-03-05 Werner Koch <wk@g10code.com>
224 * app-openpgp.c (verify_a_chv): Remove special case for keypads.
225 (verify_chv3): Ditto.
227 * app-nks.c (get_chv_status): New.
228 (parse_pwidstr): New.
229 (verify_pin): Add args PWID and DESC and use them. Remove the
231 (do_change_pin): Allow PIN selection and add reset mode.
232 (do_learn_status): Use NKS-NKS3 tag for TCOS 3 cards.
233 (do_readcert, do_sign): Allow NKS-NKS3 tag.
235 2009-03-04 Werner Koch <wk@g10code.com>
237 * app-nks.c (do_getattr): New.
238 (app_select_nks): Register it.
239 (verify_pin): Factor some code out to...
240 (basic_pin_checks): New.
241 (do_change_pin): Call the basic check.
242 (app_select_nks): Move AID to ..
245 (switch_application): New.
246 (do_getattr, do_learn_status, do_readcert, do_sign, do_decipher)
247 (do_change_pin, do_check_pin): Make sure we are in NKS mode.
249 2009-03-03 Werner Koch <wk@g10code.com>
251 * command.c (scd_command_handler): Remove dereference of STOPME
254 2009-02-27 Werner Koch <wk@g10code.com>
256 * app.c (get_supported_applications): New.
257 * command.c (cmd_getinfo): New subcommand "app_list"
259 (register_commands): Register command KILLSCD.
260 (struct server_local_s): Add field STOPME.
261 (scd_command_handler): Act upon this.
263 2009-02-25 Werner Koch <wk@g10code.com>
265 * apdu.c (apdu_get_status): Factor all code out to ...
266 (apdu_private_get_status): .. new. Add arg NO_ATR_RESET.
267 (apdu_connect): Call new function.
269 * scdaemon.c: New option --debug-log-tid.
270 (tid_log_callback): New.
271 (main): Move debug-wait code after debug stream init.
273 2009-02-24 Werner Koch <wk@g10code.com>
275 * ccid-driver.c (ccid_get_atr): Move debug output to ..
276 (print_r2p_parameters): .. new.
277 (print_r2p_header, print_pr_data, print_r2p_unknown)
278 (print_r2p_datablock, print_r2p_slotstatus, print_r2p_escape)
279 (print_r2p_datarate): New.
280 (bulk_in): Call parameter printing.
281 (ccid_set_debug_level): Add debug level 3.
282 (convert_le_u16): New.
283 (print_p2r_header, print_p2r_iccpoweron, print_p2r_iccpoweroff)
284 (print_p2r_getslotstatus, print_p2r_xfrblock)
285 (print_p2r_getparameters, print_p2r_resetparameters)
286 (print_p2r_setparameters, print_p2r_escape, print_p2r_iccclock)
287 (print_p2r_to0apdu, print_p2r_secure, print_p2r_mechanical)
288 (print_p2r_abort, print_p2r_setdatarate, print_r2p_unknown): New.
289 (bulk_out): Add arg NO_DEBUG and change all callers to pass 0.
290 Call parameter printing.
291 (ccid_slot_status): Call with NO_DEBUG set.
292 (abort_cmd, send_escape_cmd, ccid_get_atr, ccid_get_atr)
293 (ccid_transceive_apdu_level, ccid_transceive)
294 (ccid_transceive_secure): Remove old debug print code.
296 2009-02-12 Werner Koch <wk@g10code.com>
298 * command.c (cmd_getinfo): Add new subcommand "deny_admin".
300 2009-01-28 Werner Koch <wk@g10code.com>
302 * scdaemon.c (main): Make --allow-admin the default and make the
305 2009-01-27 Werner Koch <wk@g10code.com>
307 * app-geldkarte.c: Changed to use an AID.
309 * app.c (app_munge_serialno): Add case for no serialno.
310 (app_get_serial_and_stamp): Ditto.
312 2009-01-26 Werner Koch <wk@g10code.com>
314 * app-geldkarte.c: New.
315 * Makefile.am (card_apps): Add new file.
316 * app.c (select_application): Test for geldkarte.
318 2009-01-12 Werner Koch <wk@g10code.com>
320 * command.c (send_client_notifications) [HAVE_W32_SYSTEM]: Fix
323 2009-01-08 Werner Koch <wk@g10code.com>
325 * iso7816.c (iso7816_read_record, iso7816_read_binary): Pass 0 for
326 L_e because the problem with the CCID driver has gone.
327 (iso7816_apdu_direct): New.
329 * app-nks.c (filelist): Add NKS_VER field. Add NKS 3 specific
331 (app_local_s, do_deinit): New.
332 (get_nks_version): New.
333 (app_select_nks): Setup local data.
334 (keygripstr_from_pk_file): Replace SLOT by APP and take care of
336 (do_learn_status): Take care of NKS version.
338 2009-01-05 Werner Koch <wk@g10code.com>
340 * apdu.c (apdu_get_status): Save the last status.
342 2008-12-18 Werner Koch <wk@g10code.com>
344 * ccid-driver.c (abort_cmd): New.
345 (bulk_in): Call abort_cmd after severe errors.
347 * apdu.c (reader_table_s): Add field ANY_STATUS.
348 (new_reader_slot): Clear it.
349 (apdu_get_status): Use ANY_STATUS to update the change counter.
350 Remove the use of the flag bit from LAST_STATUS everywhere.
351 * command.c (update_reader_status_file): Factor code out to ...
352 (send_client_notifications): New. Track signals already sent.
353 (update_reader_status_file): Shutdown the reader after a failed
356 2008-12-09 Werner Koch <wk@g10code.com>
358 * scdaemon.c (main): Call i18n_init before init_common_subsystems.
360 2008-12-08 Werner Koch <wk@g10code.com>
362 * scdaemon.c (handle_connections): Sync ticker to the next full
364 (TIMERTICK_INTERVAL_USEC): Change to 500ms.
366 2008-12-05 Werner Koch <wk@g10code.com>
368 * app-openpgp.c (app_local_s): Add field ALGO_ATTR_CHANGE.
369 (app_select_openpgp): Parse new capability.
370 (show_caps): Show new capability.
372 2008-12-03 Werner Koch <wk@g10code.com>
374 * scdaemon.c (opts): Use ARGPARSE_ macros. Add option
376 * command.c (update_reader_status_file): Implement it.
378 2008-11-18 Werner Koch <wk@g10code.com>
380 * scdaemon.c (make_libversion): New.
381 (my_strusage): Print libgcrypt and libksba version.
383 2008-11-03 Werner Koch <wk@g10code.com>
385 * command.c (server_local_s): Add field DISCONNECT_ALLOWED.
386 (cmd_disconnect): Implement command.
387 (open_card): Reset disconnect flag.
388 (update_reader_status_file): Disconnect if allowed.
390 * app-common.h (app_ctx_s): Remove INITIALIZED. Make REF_COUNT
392 * app.c (select_application): Remove INITIALIZED.
393 (app_write_learn_status, app_readcert, app_readkey, app_getattr)
394 (app_setattr, app_sign, app_decipher, app_writecert)
395 (app_writekey, app_get_challenge, app_change_pin, app_check_pin):
396 Replace INITIALIZED by REF_COUNT check.
397 (application_notify_card_removed): Rename to ..
398 (application_notify_card_reset): .. this. Change all callers.
399 * command.c (do_reset): Call application_notify_card_reset after
401 (update_reader_status_file): Add arg SET_CARD_REMOVED.
402 (scd_update_reader_status_file): Pass true for new flag.
403 (do_reset): Pass false for new flag.
405 * app.c (app_get_serial_and_stamp): Use bin2hex.
406 * app-help.c (app_help_get_keygrip_string): Ditto.
407 * app-p15.c (send_certinfo, send_keypairinfo, do_getattr): Ditto.
408 * app-openpgp.c (send_fpr_if_not_null, send_key_data)
409 (retrieve_fpr_from_card, send_keypair_info): Ditto.
410 * app-nks.c (keygripstr_from_pk_file): Ditto.
411 * command.c (cmd_apdu): Ditto.
413 2008-10-21 Marcus Brinkmann <marcus@g10code.com>
415 * command.c (open_card): If connect error is SW_HOST_NO_CARD,
416 return a more descriptive error.
418 2008-10-20 Werner Koch <wk@g10code.com>
420 * pcsc-wrapper.c (read_32): Use provided arg and not stdin. Is
421 called with stdin, though.
422 (handle_close): Mark unused arg.
423 (handle_status, handle_reset): Ditto.
425 * ccid-driver.c (ccid_check_card_presence): Mark not yet used arg.
427 * scdaemon.c (scd_deinit_default_ctrl): Mark unused arg.
428 * command.c (cmd_unlock, cmd_restart, cmd_disconnect): Ditto.
429 * apdu.c (ct_get_status): Ditto.
430 (ct_send_apdu, pcsc_send_apdu_wrapped)
431 (apdu_open_remote_reader): Ditto.
432 * app.c (select_application): Ditto.
433 * app-openpgp.c (do_writecert, do_change_pin, do_writekey): Ditto.
434 * app-nks.c (do_change_pin, do_check_pin): Ditto.
436 2008-10-16 Werner Koch <wk@g10code.com>
438 * command.c (cmd_disconnect): New dummy command.
439 (register_commands): Register command.
441 2008-10-15 Werner Koch <wk@g10code.com>
443 * command.c (scd_command_handler): Return true if there is no more
445 * scdaemon.c (start_connection_thread): Set shutdown flag if
446 requested by command handler.
447 (main): Make PIPE_SERVER module global.
448 (handle_connections): Disable listen_fd if a shutdown is pending.
450 2008-10-14 Werner Koch <wk@g10code.com>
452 * apdu.c (reader_table_s): Add fields connect_card and
454 (new_reader_slot): Set them to NULL.
455 (apdu_connect, apdu_disconnect): New.
456 (apdu_close_reader, apdu_shutdown_reader): Call apdu_disconnect.
457 (connect_pcsc_card, disconnect_pcsc_card): new.
458 (reset_pcsc_reader_direct): Implement in terms of
459 disconnect_pcsc_card and connect_pcsc_card.
460 (apdu_get_atr): Return NULL if there is no ATR.
461 * sc-copykeys.c (main): Add call to apdu_connect.
462 * command.c (open_card): Ditto.
464 * apdu.h (SW_HOST_ALREADY_CONNECTED): New.
465 (APDU_CARD_USABLE, APDU_CARD_PRESENT, APDU_CARD_ACTIVE): New.
466 * apdu.c: Replace constants by the new macros.
467 (open_pcsc_reader): Factor code out to ...
468 (open_pcsc_reader_direct, open_pcsc_reader_wrapped): New.
469 (reset_pcsc_reader): Factor code out to ...
470 (reset_pcsc_reader_direct, reset_pcsc_reader_wrapped): New.
471 (pcsc_get_status): Factor code out to ...
472 (pcsc_get_status_direct, pcsc_get_status_wrapped): New.
473 (pcsc_send_apdu): Factor code out to ...
474 (pcsc_send_apdu_direct, pcsc_send_apdu_wrapped): New.
475 (close_pcsc_reader): Factor code out to ...
476 (close_pcsc_reader_direct, close_pcsc_reader_wrapped): New.
478 * command.c (update_reader_status_file): Open the reader if not
481 * scdaemon.c (TIMERTICK_INTERVAL_SEC, TIMERTICK_INTERVAL_USEC):
482 New to replace TIMERTICK_INTERVAL. Chnage from 2s (4 under W32)
485 2008-10-13 Werner Koch <wk@g10code.com>
487 * command.c (option_handler) [W32]: Use strtoul with base 16.
488 (update_reader_status_file) [W32]: Set Event.
489 (scd_command_handler): Use INT2FD to silent warning.
491 2008-09-29 Werner Koch <wk@g10code.com>
493 * scdaemon.h (GCRY_MD_USER): Rename to GCRY_MODULE_ID_USER.
494 (GCRY_MD_USER_TLS_MD5SHA1): Rename to MD_USER_TLS_MD5SHA1 and
497 2008-09-28 Marcus Brinkmann <marcus@g10code.com>
499 * apdu.c (pcsc_get_status): Fix last change.
501 2008-09-25 Werner Koch <wk@g10code.com>
503 * app-openpgp.c (do_setattr): Do not allow setting of the reset
505 (do_change_pin): Allow setting of the reset code.
507 2008-09-24 Werner Koch <wk@g10code.com>
509 * app-openpgp.c (verify_chv3): Set the did_chv3 flag which was
510 accidently removed on 2008-03-26.
511 (verify_chv2): Revert last change.
512 (do_change_pin): Do not change CHV2. Add reset code logic for v2
514 * iso7816.c (iso7816_reset_retry_counter_with_rc): New.
516 * app-openpgp.c (add_tlv, build_privkey_template): New.
517 (do_writekey): Support v2 keys and other key lengths than 1024.
518 * iso7816.c (iso7816_put_data_odd): New.
520 2008-09-23 Werner Koch <wk@g10code.com>
522 * app-openpgp.c (do_sign): Support SHA-2 digests.
523 (verify_chv2): No CHV auto-sync for v2 cards.
524 (do_auth): Allow 2048 bit keys.
525 (parse_algorithm_attribute): New.
526 (rsa_key_format_t): New.
527 (struct app_local_s): Add struct KEYATTR.
529 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
531 * apdu.c (pcsc_get_status): Be more relaxed with the usable flag
534 2008-09-23 Werner Koch <wk@g10code.com>
536 * app-openpgp.c (do_setattr): Use command chaining for long
538 * iso7816.c (iso7816_put_data): Add arg EXTENDED_MODE. Change all
540 * apdu.c (apdu_send_simple): Add arg EXTENDED_MODE. Change all
542 (send_le): Implement command chaining.
543 * ccid-driver.c (ccid_transceive_apdu_level): Increase allowed
545 (ccid_transceive): Alow for APDUS of up to 259 bytes.
546 * apdu.h: Add new SW_ codes.
548 2008-09-16 Werner Koch <wk@g10code.com>
550 * command.c (cmd_writecert): New.
551 (register_commands): Register it.
552 * app-common.h (app_ctx_s): Add member WRITECERT.
553 * app.c (app_writecert): New.
554 * app-openpgp.c (do_writecert): New.
555 (parse_historical): New.
557 (dump_all_do): Print only the length of longs DOs.
558 * command.c (cmd_writekey, cmd_apdu, cmd_pksign)
559 (cmd_passwd): Replace open coding by skip_options.
561 2008-08-30 Moritz <moritz@gnu.org>
563 * scdaemon.c (main): Use estream_asprintf instead of asprintf.
564 * command.c (update_reader_status_file): Likewise.
565 (cmd_serialno): Use estream_asprintf instead of asprintf
566 and xfree instead of free to release memory allocated
567 through (estream_)asprintf.
568 (cmd_learn): Likewise.
570 * app-openpgp.c (get_public_key): Likewise.
572 2008-08-18 Werner Koch <wk@g10code.com>
574 * app-openpgp.c (do_setattr): Fix test for v2 cards.
576 2008-08-11 Werner Koch <wk@g10code.com>
578 * apdu.c (reset_pcsc_reader, open_pcsc_reader)
579 (reset_rapdu_reader, open_rapdu_reader): Allow ATRs of up to 33
580 bytes. Provide maximum size of ATR buffer using DIM. Such long
581 ATR are never seen in reality but the PC/SC library of MAC OS X is
582 just too buggy. Reported by Ludovic Rousseau. Fixes bug #948.
584 2008-07-30 Werner Koch <wk@g10code.com>
586 * app-openpgp.c (verify_a_chv): Use xtrymalloc and make the prompt
587 for CHV2 more user friendly.
589 2008-07-03 Werner Koch <wk@g10code.com>
591 * app-openpgp.c (do_readcert): New.
592 (app_local_s): Add fields IS_V2 and MAX_CERTLEN_3.
593 (app_select_openpgp): Set them and register do_readcert.
594 (do_setattr): Allow storing of the certificate.
596 2008-06-25 Werner Koch <wk@g10code.com>
598 * app-dinsig.c (do_sign): Allow for SHA256.
600 2008-06-24 Werner Koch <wk@g10code.com>
602 * app-common.h (app_ctx_s): Renamed reset_mode parameter of
603 change_pin to mode_Flags and make it an unsigned int.
604 (APP_CHANGE_FLAG_RESET, APP_CHANGE_FLAG_NULLPIN): New.
605 * app-openpgp.c (do_change_pin): Adjust for that.
607 * command.c (cmd_passwd): Add option --nullpin.
608 * app-nks.c (do_check_pin, do_change_pin): New.
609 (app_select_nks): Register new functions.
611 2008-04-21 Moritz Schulte <mo@g10code.com> (wk)
613 * app-openpgp.c (verify_a_chv): Make use of the default CHV flag.
615 2008-03-26 Werner Koch <wk@g10code.com>
617 * app-openpgp.c (verify_chv3): Support the keypad.
619 2008-02-09 Marcus Brinkmann <marcus@g10code.de>
621 * scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
622 in gpgconf-list output.
624 2007-12-10 Werner Koch <wk@g10code.com>
626 * app-openpgp.c (do_decipher): Take care of cryptograms shorter
627 that 128 bytes. Fixes bug#851.
629 2007-11-14 Werner Koch <wk@g10code.com>
631 * scdaemon.c (main): Pass STANDARD_SOCKET flag to
632 create_server_socket.
634 2007-11-13 Werner Koch <wk@g10code.com>
636 * scdaemon.c (start_connection_thread): Do not call
637 assuan_sock_check_nonce if we are running in --server mode.
639 2007-11-07 Werner Koch <wk@g10code.com>
641 * scdaemon.h: Remove errors.h.
643 2007-10-02 Werner Koch <wk@g10code.com>
645 * command.c (cmd_getinfo): Add "pid" subcommand.
647 2007-10-01 Werner Koch <wk@g10code.com>
649 * scdaemon.c (create_server_socket): Use Assuan socket wrappers
650 and remove Windows specific code.
652 (start_connection_thread): Check nonce.
654 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
656 * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
657 W32 targets. Use it for create_socket_name.
659 2007-08-07 Werner Koch <wk@g10code.com>
661 * tlv.c, tlv.h: Move to ../common/.
663 2007-08-02 Werner Koch <wk@g10code.com>
665 * scdaemon.c: Include gc-opt-flags.h and remove their definition
668 2007-08-01 Werner Koch <wk@g10code.com>
670 * apdu.c (send_le): Implement exact length hack. Suggested by
673 2007-07-05 Werner Koch <wk@g10code.com>
675 * command.c (has_option_name, skip_options): New.
676 (cmd_genkey): Add option --timestamp.
677 (cmd_writekey): Enter confidential mode while inquiring the key data.
679 * app.c (app_genkey): Add arg CREATETIME.
680 * app-common.h (app_ctx_s): Likewise
681 * app-openpgp.c (do_genkey): Ditto. Use it.
684 2007-07-04 Werner Koch <wk@g10code.com>
686 * command.c (cmd_getinfo): New subcommand "version".
688 * scdaemon.c (TIMERTICK_INTERVAL): New.
689 (handle_connections) [W32]: Enable a dummy sigs event.
690 (handle_connections): Use a proper count for select and not
692 (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
694 2007-06-21 Werner Koch <wk@g10code.com>
696 * scdaemon.h (ctrl_t): Remove. It is now declared in ../common/util.h.
698 2007-06-18 Marcus Brinkmann <marcus@g10code.de>
700 * scdaemon.c (main): Percent escape output of --gpgconf-list.
702 2007-06-12 Werner Koch <wk@g10code.com>
704 * scdaemon.c (main): Replace some calls by init_common_subsystems.
706 2007-06-11 Werner Koch <wk@g10code.com>
708 * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
710 * command.c (initialize_module_command): New.
711 * scdaemon.c (main) [W32]: Do not use sigpipe code.
712 (main): Call initialize_module_command.
714 2007-06-06 Werner Koch <wk@g10code.com>
716 * app-openpgp.c (do_sign): Fix arithmetic on void*.
718 * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
720 * apdu.c: Remove dynload.h.
722 * scdaemon.c (i18n_init): Remove.
724 2007-04-20 Werner Koch <wk@g10code.com>
726 * sc-copykeys.c (my_gcry_logger): Removed.
727 (main): Call setup_libgcrypt_logging helper.
728 * scdaemon.c (my_gcry_logger): Removed.
729 (main): Call setup_libgcrypt_logging helper.
731 2007-04-03 Werner Koch <wk@g10code.com>
733 * command.c (cmd_getinfo): New subcommand "reader_list".
734 * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
735 for special transports.
737 2007-03-07 Werner Koch <wk@g10code.com>
739 * app-dinsig.c: Include i18n.h.
740 (verify_pin): Support PIN pads.
741 * app-nks.c (verify_pin): Ditto.
743 * ccid-driver.c (bulk_in): Handle time extension before checking
745 (ccid_transceive_secure): Support the Cherry XX44 keyboard.
746 Kudos to the nice folks at Cherry for helping with that.
748 2007-02-18 Werner Koch <wk@g10code.com>
750 * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
752 2007-01-25 Werner Koch <wk@g10code.com>
754 * Makefile.am (scdaemon_LDADD): Added LIBICONV. Noted by Billy
757 2006-12-21 Werner Koch <wk@g10code.com>
759 * app-openpgp.c (verify_chv2): Factored most code out into...
760 (verify_a_chv): ... new.
761 (do_sign): Factored verification code out to new function and
762 take care of a keypad entered PIN.
763 (compare_fingerprint): Print an additional diagnostic.
765 2006-11-28 Werner Koch <wk@g10code.com>
767 * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
768 allow for full 256 byte and the status word. This might break
769 some old PC/SC drivers or cards, but we will see. Suggested by
772 2006-11-23 Werner Koch <wk@g10code.com>
774 * command.c (scd_command_handler): Fixed use of CTRL.
776 2006-11-21 Werner Koch <wk@g10code.com>
778 * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
779 Renamed to gnupg-pcsc-wrapper.
780 * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
781 wrapper. Suggested by Eric Dorland.
783 2006-11-20 Werner Koch <wk@g10code.com>
785 * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
787 * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
790 2006-11-17 Werner Koch <wk@g10code.com>
792 * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
793 log_debug. Removed few other log_debug.
795 * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
797 * command.c (pin_cb): New mode to prompt for a keypad entry.
799 * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
801 2006-11-15 Werner Koch <wk@g10code.com>
803 * app-p15.c (read_ef_odf): Cast one printf arg.
805 * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
806 * command.c (scd_command_handler): Add new arg CTRL.
807 * scdaemon.c (scd_init_default_ctrl): Made static.
808 (scd_deinit_default_ctrl): New.
809 (start_connection_thread): Call init/deinit of ctrl.
810 (handle_connections): Allocate CTRL.
812 * apdu.c (PCSC_ERR_MASK): New.
813 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
814 (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
815 values. Reported by Henrik Nordstrom. Fixes bug #724.
817 2006-10-24 Werner Koch <wk@g10code.com>
819 * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
820 (MAX_DIGEST_LEN): Increased to 36.
821 * app-p15.c (do_sign): Support for TLS_MD5SHA1.
822 (do_auth): Detect TLS_MD5SHA1.
823 (do_sign): Tweaks for that digest.
825 2006-10-23 Werner Koch <wk@g10code.com>
827 * scdaemon.c (main): New command --gpgconf-test.
829 2006-10-17 Werner Koch <wk@g10code.com>
831 * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
833 2006-10-12 Werner Koch <wk@g10code.com>
835 * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
838 2006-10-11 Werner Koch <wk@g10code.com>
840 * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
842 2006-10-06 Werner Koch <wk@g10code.com>
844 * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
845 (scdaemon_LDADD): Ditto.
847 * scdaemon.h (send_status_info): Mark with sentinel attribute.
849 2006-10-02 Marcus Brinkmann <marcus@g10code.de>
851 * command.c (update_reader_status_file): Increase buffer of
852 NUMBUF2 (fixing typo).
854 2006-09-24 Marcus Brinkmann <marcus@g10code.de>
856 * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
859 2006-09-14 Werner Koch <wk@g10code.com>
861 Replaced all call gpg_error_from_errno(errno) by
862 gpg_error_from_syserror().
864 * command.c (scd_command_handler): Replaced
865 init_connected_socket_server by init_socket_server_ext.
867 2006-09-07 Werner Koch <wk@g10code.com>
869 * command.c (update_reader_status_file): Execute an event handler
872 2006-09-06 Werner Koch <wk@g10code.com>
874 * apdu.c (pcsc_end_transaction):
875 * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
876 Reported by Bob Dunlop.
878 * scdaemon.h (CTRL,APP): Removed and changed everywhere to
881 Replaced all Assuan error codes by libgpg-error codes. Removed
882 all map_to_assuan_status and map_assuan_err.
884 * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
885 switch to gpg-error codes.
886 * command.c (set_error): Adjusted.
888 2006-09-02 Marcus Brinkmann <marcus@g10code.de>
890 * command.c (get_reader_slot): Return the slot_table index, not
891 the APDU slot number.
892 (update_reader_status_file): Use the slot_table index in the
893 update_card_removed invocation.
895 2006-09-01 Marcus Brinkmann <marcus@g10code.de>
897 * command.c (cmd_getinfo): Handle status command.
899 2006-08-30 Marcus Brinkmann <marcus@g10code.de>
901 * command.c (do_reset): Delay resetting CTRL->reader_slot until
902 after update_card_removed invocation.
904 2006-08-28 Marcus Brinkmann <marcus@g10code.de>
906 * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
907 resp. "OPENPGP.1" for KEYIDSTR.
909 2006-08-21 Werner Koch <wk@g10code.com>
911 * pcsc-wrapper.c (handle_open, handle_close): Reset card and
912 protocol on error/close.
913 (handle_status): Don't set the state if the state is unknown.
914 (handle_reset): Ignore an error if already disconnected. May
915 happen due to system wake-up after hibernation. Suggested by Bob
918 2006-06-28 Werner Koch <wk@g10code.com>
920 * app-openpgp.c (do_writekey): Fixed computation of memmove
921 length. This led to garbled keys if E was larger than one byte.
922 Thanks to Achim Pietig for hinting at the garbled E.
924 2006-06-09 Marcus Brinkmann <marcus@g10code.de>
926 * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
928 2006-04-14 Marcus Brinkmann <marcus@g10code.de>
930 * app.c (select_application): Cover up a slot mismatch error in
931 case it happens (it shouldn't happen).
932 (release_application): Use APP->slot. Lock the reader.
933 (application_notify_card_removed): Lock the reader.
935 2006-04-11 Werner Koch <wk@g10code.com>
937 * command.c (hex_to_buffer): New.
940 2006-04-03 Werner Koch <wk@g10code.com>
942 * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
944 2006-03-21 Werner Koch <wk@g10code.com>
946 * command.c (cmd_pksign): Add --hash option.
948 2006-03-01 Werner Koch <wk@g10code.com>
950 * command.c (status_file_update_lock): New.
951 (scd_update_reader_status_file): Use lock and factor existing code
953 (update_reader_status_file): .. this.
954 (do_reset): Use the lock and call update_reader_status_file.
956 2006-02-20 Werner Koch <wk@g10code.com>
958 * apdu.c (open_pcsc_reader): Fixed double free. Thanks to Moritz.
960 2006-02-09 Werner Koch <wk@g10code.com>
962 * command.c (get_reader_slot, do_reset)
963 (scd_update_reader_status_file): Rewrote.
965 * app.c (release_application): Factored code out to ..
966 (deallocate_app): new function.
967 (select_application): Introduce new saved application stuff.
968 (application_notify_card_removed): New.
969 * command.c (update_card_removed): Call it here.
970 (do_reset): And here.
972 * app.c (check_application_conflict): New.
973 * command.c (open_card): Use it here.
974 (cmd_restart): New command.
976 * command.c (cmd_lock): Fixed --wait option to actually terminate.
978 2006-02-08 Werner Koch <wk@g10code.com>
980 * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
981 using these parameters.
982 (scan_or_find_devices): Check for NULL r_fd.
984 2006-02-02 Werner Koch <wk@g10code.com>
986 * ccid-driver.c (special_transport): New
987 (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
988 (bulk_out, bulk_in): Add support for CardMan 4040 reader.
990 * ccid-driver.c (scan_or_find_devices): Factored most code out to
991 (scan_or_find_usb_device): .. new.
992 (make_reader_id): Fixed vendor mask.
994 2006-01-01 Werner Koch <wk@g10code.com>
996 * app-openpgp.c (do_sign): Give user error if hash algorithm is
997 not supported by the card.
999 2005-12-06 Werner Koch <wk@g10code.com>
1001 * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
1004 2005-11-23 Werner Koch <wk@g10code.com>
1006 * app-nks.c (verify_pin): Give a special error message for a Nullpin.
1008 2005-10-29 Werner Koch <wk@g10code.com>
1010 * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
1011 RESULTMAX. Changed all callers.
1012 (ccid_transceive_escape): New.
1014 2005-10-27 Werner Koch <wk@g10code.com>
1016 * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
1017 Suggested by John P. Clizbe.
1018 * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
1020 2005-10-19 Werner Koch <wk@g10code.com>
1022 * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
1023 * apdu.h (SW_HOST_NO_KEYPAD): New.
1024 * iso7816.h (struct iso7816_pininfo_s): New.
1025 * iso7816.c (map_sw): Support new code.
1026 (iso7816_check_keypad): New.
1027 (iso7816_verify_kp, iso7816_change_reference_data_kp)
1028 (iso7816_reset_retry_counter_kp): New. Extended versions of the
1030 * apdu.c (host_sw_string): Support new code.
1031 (reader_table_s): New field CHECK_KEYPAD.
1032 (new_reader_slot, open_ct_reader, open_pcsc_reader)
1033 (open_ccid_reader, open_rapdu_reader): Initialize it.
1034 (check_ccid_keypad): New.
1035 (apdu_check_keypad): New.
1036 (apdu_send_le): Factored all code out to ...
1037 (send_le): .. new. Takes an additional arg; changed all callers
1038 of the orginal function to use this one with a NULL for the new
1040 (apdu_send_simple_kp): New.
1041 (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu)
1042 (send_apdu_ccid): New arg PININFO.
1043 (send_apdu_ccid): Use the new arg.
1045 * scdaemon.c: New option --disable-keypad.
1047 2005-10-08 Marcus Brinkmann <marcus@g10code.de>
1049 * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
1050 ../common/libcommon.a.
1052 2005-09-20 Werner Koch <wk@g10code.com>
1054 * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
1056 * iso7816.c (iso7816_select_application): Add arg FLAGS. Changed
1057 all callers to pass 0.
1058 * app-openpgp.c (app_select_openpgp): But this one requires a
1061 * app-p15.c (app_select_p15): Don't use select application for the
1064 2005-09-09 Werner Koch <wk@g10code.com>
1066 * pcsc-wrapper.c (main): Removed bogus free.
1068 * app-p15.c (do_auth): New.
1069 (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
1070 * app-openpgp.c (do_getattr): Ditto.
1072 2005-09-08 Werner Koch <wk@g10code.com>
1074 * app-openpgp.c (do_getattr): New key $AUTHKEYID.
1076 2005-09-06 Werner Koch <wk@g10code.com>
1078 * app-p15.c (do_sign): Tweaked for BELPIC cards.
1079 (read_home_df): New arg R_BELPIC.
1080 (app_select_p15): Set card type for BELPIC.
1082 2005-09-05 Werner Koch <wk@g10code.com>
1084 * iso7816.c (iso7816_select_path): New.
1085 * app-p15.c (select_ef_by_path): Allow for direct path selection.
1086 (app_select_p15): Try using the Belgian variant of pkcs#15.
1087 (read_home_df): New.
1088 (read_ef_odf): Generalized.
1089 (read_ef_tokeninfo): New.
1090 (read_p15_info): Set serialnumber from TokenInfo.
1091 (app_select_p15): Don't munge serialNumber - that must be done
1094 * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
1095 data. Handle 6C00 error and take 6B00 as indication for EOF.
1096 * apdu.h (SW_EXACT_LENGTH_P): New.
1097 * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status)
1098 (open_pcsc_reader): Set new reader state IS_T0.
1099 (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
1100 Problem reported by Carl Meijer.
1101 (apdu_send_direct): Initialize RESULTLEN.
1102 * pcsc-wrapper.c (handle_status): Return the current protocol as
1105 2005-08-05 Werner Koch <wk@g10code.com>
1107 * apdu.c (open_rapdu_reader): Set the reader number.
1109 2005-07-05 Werner Koch <wk@g10code.com>
1111 * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
1112 required by the description. Thanks to Moritz for tracking this
1115 2005-06-21 Werner Koch <wk@g10code.com>
1117 * scdaemon.c (main): ifdef call to ccid_set_debug_level.
1119 * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
1122 2005-06-06 Werner Koch <wk@g10code.com>
1124 * scdaemon.c (main): New option --debug-allow-core-dump.
1126 2005-06-03 Werner Koch <wk@g10code.com>
1128 * scdaemon.c (handle_connections): Make sure that the signals we
1129 are handling are not blocked.Block signals while creating new
1131 (handle_connections): Include the file descriptor into the name of
1134 2005-06-02 Werner Koch <wk@g10code.com>
1136 * app.c (app_dump_state, dump_mutex_state): New.
1137 * scdaemon.c (handle_signal): Print it on SIGUSR1.
1139 * app-openpgp.c (do_writekey): Typo fix.
1141 * command.c (open_card): Check for locked state even if an
1142 application context is available.
1144 * app-common.h: Add REF_COUNT field.
1145 * app.c (release_application, select_application): Implement
1146 reference counting to share the context beween connections.
1148 * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
1149 argument. Changed all callers.
1150 (select_application): Unlock the reader on error. This should fix
1151 the hangs I noticed last week.
1153 * scdaemon.h: Removed card_ctx_t cruft.
1155 2005-06-01 Werner Koch <wk@g10code.com>
1157 * scdaemon.c: Include mkdtemp.h.
1159 2005-05-31 Werner Koch <wk@g10code.com>
1161 * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
1162 including a gnupg 1.4 header.
1164 2005-05-30 Werner Koch <wk@g10code.com>
1166 * tlv.c: Add hack to compile without gpg-error.h when used with
1169 2005-05-23 Werner Koch <wk@g10code.com>
1171 * Makefile.am: Do not build sc-copykeys anymore.
1173 * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
1174 (app_openpgp_cardinfo): Removed.
1176 * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
1178 (do_close_reader): Never do a reset. The caller should instead
1179 make sure that the reader has been closed properly. The new retry
1180 code in ccid_slot_status will make sure that the readersatrts up
1181 fine even if the last process didn't closed the USB connection
1183 (ccid_get_atr): For certain readers try switching to ISO mode.
1184 Thanks to Ludovic Rousseau for this hint and the magic numbers.
1185 (print_command_failed): New.
1186 (bulk_in): Use it here. Add new arg NO_DEBUG.
1187 (ccid_slot_status): Disabled debugging.
1189 2005-05-21 Werner Koch <wk@g10code.com>
1191 * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
1193 2005-05-20 Werner Koch <wk@g10code.com>
1195 * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
1196 (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
1197 (ccid_transceive): Arghhh. The seqno is another bit in the
1198 R-block than in the I block, this was wrong at one place.
1200 * scdaemon.c: New options --debug-ccid-driver and
1201 --debug-disable-ticker.
1203 * app-openpgp.c (do_genkey, do_writekey): Factored code to check
1204 for existing key out into ..
1205 (does_key_exist): .. New function.
1207 2005-05-19 Werner Koch <wk@g10code.com>
1209 * tlv.c (parse_sexp): New.
1211 * command.c (cmd_writekey): New.
1212 * app.c (app_writekey): New.
1213 * app-common.c (app_t): Add function ptr WRITEKEY.
1214 * app-openpgp.c (do_writekey): New.
1216 * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
1217 * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
1218 store the Assuan context.
1220 2005-05-17 Werner Koch <wk@g10code.com>
1222 * scdaemon.c: Removed non-pth code paths.
1223 (create_socket_name, create_server_socket): New. Taken from
1225 (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
1226 (ticker_thread): Always use pth_event_occurred; it is again
1227 defined for all decent PTH versions.
1228 (handle_connections): New. Based on the gpg-agent code.
1229 (start_connection_thread): Ditto.
1230 (ticker_thread): Removed.
1231 (cleanup_sh): Removed.
1232 (main): Run the handler for the pipe server in a separate
1233 thread. This replaces the old ticker thread.
1234 (scd_get_socket_name): New.
1235 * command.c (cmd_getinfo): New command GETINFO.
1236 (scd_command_handler): Renamed argument and changed code to use an
1237 already connected FD.
1239 2005-05-15 Werner Koch <wk@g10code.com>
1241 * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
1242 * app-openpgp.c: Change most function return types from int to
1244 * command.c (pin_cb): Ditto.
1245 * sc-copykeys.c (pincb): Ditto.
1247 * app.c (lock_reader, unlock_reader): New. Changed call handler
1248 wrappers to make use of these functions.
1250 2005-05-07 Werner Koch <wk@g10code.com>
1252 * ccid-driver.c (do_close_reader): Don't do a reset before close.
1253 Some folks reported that it makes the SCR335 hang less often.
1254 Look at the source on how to re-enable it.
1256 2005-04-27 Werner Koch <wk@g10code.com>
1258 * app-p15.c (micardo_mse): New.
1260 * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
1261 NULL to indicate an empty Lc.
1262 * tlv.c (find_tlv): Check that a found object fits into the
1264 (find_tlv_unchecked): New as replacement for the old non-checking
1266 * app.c (select_application): Keep on using the non-checking
1268 * app-openpgp.c (get_one_do, dump_all_do): Ditto.
1271 Removal of the old OpenSC based code.
1273 * app-p15.c: New. Basic support for pkcs15 cards without OpenSC.
1274 There are quite a couple of things missing but at least I can use
1275 my old TCOS cards from the Aegypten-1 development for signing.
1276 * app.c (select_application): Detect pkcs15 applications.
1277 * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
1278 and card-p15.c because they are now obsolete. Added app-p15.c.
1279 Removed all OpenSC stuff.
1280 * command.c (do_reset, open_card, cmd_serialno, cmd_learn)
1281 (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
1282 all special cases for the old card.c based mechanisms.
1283 * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
1285 2005-04-20 Werner Koch <wk@g10code.com>
1287 * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
1289 2005-04-14 Werner Koch <wk@g10code.com>
1291 * app-openpgp.c (retrieve_key_material): Rewritten. Return a
1293 (retrieve_next_token): Removed.
1294 (retrieve_fpr_from_card): Rewritten to make use of DO caching and
1295 to take the KEYNO as arg.
1296 (get_public_key): Renamed variable for clarity.
1298 2005-04-12 Werner Koch <wk@g10code.com>
1300 Basic support for several sessions.
1302 * command.c (scd_command_handler): Replace the primary_connection
1303 stuff by a real connection list. Release the local context on
1305 (scd_update_reader_status_file): Update accordingly. Send signal
1306 to all connections who registered an event signal.
1307 (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
1309 (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr)
1310 (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
1312 (do_reset): Handle locking.
1313 (open_card): Ditto. Share the reader slot with other sessions.
1314 (get_reader_slot): New.
1315 (update_card_removed): New. Use it in the TEST_CARD_REMOVAL macro.
1317 2005-04-07 Werner Koch <wk@g10code.com>
1319 * app-openpgp.c (do_check_pin): Add hack to allow verification of
1321 (get_public_key): Don't use gcry functions to create S-expressions.
1322 (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
1325 2005-03-29 Moritz Schulte <moritz@g10code.com>
1327 * app-openpgp.c (retrieve_fpr_from_card): New function.
1328 (retrieve_next_token): New function.
1329 (retrieve_key_material): New function.
1330 (get_public_key): Implement retrival of key through expernal
1331 helper (gpg) in case the openpgp card is not cooperative enough.
1333 2005-03-16 Werner Koch <wk@g10code.com>
1335 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1336 reader type specific.
1337 (scan_or_find_devices): Do not check the interface subclass in the
1338 SPR532 kludge, as this depends on the firmware version.
1339 (ccid_get_atr): Get the Slot status first. This solves the
1340 problem with readers hanging on recent Linux 2.6.x.
1341 (bulk_in): Add argument TIMEOUT and changed all callers to pass an
1342 appropriate one. Change the standard timeout from 10 to 5 seconds.
1343 (ccid_slot_status): Add a retry code with an initial short timeout.
1344 (do_close_reader): Do an usb_reset before closing the reader.
1346 2005-02-25 Werner Koch <wk@g10code.com>
1348 * app-openpgp.c (get_public_key): Make sure not to return negative
1350 (do_sign): Allow passing of indata with algorithm prefix.
1351 (do_auth): Allow OPENPGP.3 as an alternative ID.
1353 * app.c (app_getattr): Return just the S/N but not the timestamp.
1355 2005-02-24 Werner Koch <wk@g10code.com>
1357 * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
1358 application does dot support the getattr call.
1360 * app-openpgp.c (get_one_do): Never try to get a non cacheable
1361 object from the cache.
1362 (get_one_do): Add new arg to return an error code. Changed all
1364 (do_getattr): Let it return a proper error code.
1366 * app.c (select_application): Return an error code and the
1367 application context in an new arg.
1368 * command.c (open_card): Adjusted for that. Don't use the
1369 fallback if no card is present. Return an error if the card has
1370 been removed without a reset.
1371 (do_reset, cmd_serialno): Clear that error flag.
1372 (TEST_CARD_REMOVAL): New. Use it with all command handlers.
1373 (scd_update_reader_status_file): Set the error flag on all changes.
1375 * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
1377 * apdu.c: Added some PCSC error codes.
1378 (pcsc_error_to_sw): New.
1379 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
1380 (open_pcsc_reader): Do proper error code mapping.
1382 2005-03-16 Werner Koch <wk@g10code.com>
1384 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1385 reader type specific.
1386 (scan_or_find_devices): Do not check the interface subclass in the
1387 SPR532 kludge, as this depends on the firmware version.
1388 (ccid_get_atr): Get the Slot status first. This solves the
1389 problem with readers hanging on recent Linux 2.6.x.
1391 2005-02-22 Werner Koch <wk@g10code.com>
1393 * app-openpgp.c (app_local_s): New field PK.
1394 (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
1395 (get_public_key, send_keypair_info): New.
1396 (do_learn_status): Send KEYPAIR info
1398 * app-common.h (app_ctx_t): Add function pointer READKEY.
1399 * app.c (app_readkey): New.
1400 * command.c (cmd_readkey): Use READKEY function if possible.
1402 2005-01-26 Werner Koch <wk@g10code.com>
1404 * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
1405 also for newer firmware versions. Need to get a list of fixed
1406 firmware versions and use that.
1408 2005-01-25 Werner Koch <wk@g10code.com>
1410 * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
1413 * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
1414 the cache. Changed all callers.
1415 (get_one_do): Bypass the cache if the value would have been read
1416 directly for v1.1 cards.It makes things a bit slower but obnly for
1417 1.0 cards and there are not that many cards out in the wild. This
1418 is required to fix a caching bug when generating new keys; as a
1419 side effect of the retrieval of the the C4 DO from the 6E DO the
1420 cached fingerprint will get updated to the old value and later
1421 when signing the generated key the checking of the fingerprint
1422 fails because it won't match the new one. Thanks to Moritz for
1423 analyzing this problem.
1424 (verify_chv3): Removed the CHV status reread logic because we
1425 won't cache the C4 DO anymore.
1427 2004-12-28 Werner Koch <wk@g10code.com>
1429 * ccid-driver.c (find_endpoint): New.
1430 (scan_or_find_devices): Add new args to return endpoint info and
1432 (ccid_open_reader, ccid_shutdown_reader): Take care of these new
1434 (bulk_in, bulk_out): Use the correct endpoints.
1435 (ccid_transceive_apdu_level): New.
1436 (ccid_transceive): Divert to above.
1437 (parse_ccid_descriptor): Allow APDU level exchange mode.
1438 (do_close_reader): Pass the interface number to usb_release_interface.
1440 2004-12-21 Werner Koch <wk@g10code.com>
1442 * scdaemon.c (main): Use default_homedir().
1444 2004-12-18 Werner Koch <wk@g10code.com>
1446 * scdaemon.c (main) [W32]: Remove special Pth initialize..
1448 * scdaemon.h (map_assuan_err): Define in terms of
1449 map_assuan_err_with_source.
1451 2004-12-15 Werner Koch <wk@g10code.com>
1453 * scdaemon.c [W32]: Various hacks to make it run under W32.
1455 * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
1457 * apdu.c [W32]: Disable use of pcsc_wrapper.
1459 * Makefile.am (scdaemon_LDADD): Reorder libs.
1460 (sc_copykeys_LDADD): Add libassuan because it is needed for W32.
1462 2004-12-06 Werner Koch <wk@g10code.com>
1464 * Makefile.am (pkglib_PROGRAMS): Build only for W32.
1466 2004-10-22 Werner Koch <wk@g10code.com>
1468 * app-openpgp.c (verify_chv3): The minium length for CHV3 is
1469 8. Changed string to match the other ones.
1471 2004-10-21 Werner Koch <wk@g10code.com>
1473 * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
1474 This avoids problems with missing vasprintf implementations in
1477 * app-common.h (app_openpgp_storekey: Add prototype.
1479 2004-10-20 Werner Koch <wk@g10code.com>
1481 * sc-investigate: Removed.
1482 * Makefile.am (sc_investigate): Removed.
1484 * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
1485 (handle_open): Succeed even without a present card.
1486 (handle_status, handle_reset): New.
1488 * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
1489 (pcsc_get_status): Implemented.
1490 (reset_pcsc_reader): Implemented.
1491 (open_pcsc_reader): Succeed even with no card inserted.
1492 (open_ccid_reader): Set LAST_STATUS.
1494 * iso7816.c (iso7816_select_application): Always use 0 for P1.
1496 2004-10-18 Werner Koch <wk@g10code.com>
1498 * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
1500 2004-10-14 Werner Koch <wk@g10code.com>
1502 * app-openpgp.c (parse_login_data): New.
1503 (app_select_openpgp): Call it.
1504 (do_setattr): Reparse it after change.
1506 2004-10-06 Werner Koch <wk@g10code.de>
1508 * ccid-driver.c (ccid_open_reader): Store the vendor ID.
1509 (ccid_transceive_secure): New.
1510 (parse_ccid_descriptor): Workaround for an SCM reader problem.
1512 2004-10-04 Werner Koch <wk@g10code.de>
1514 * ccid-driver.c (send_escape_cmd): New.
1516 2004-09-30 Werner Koch <wk@g10code.com>
1518 * Makefile.am: Adjusted for gettext 0.14.
1520 * app-openpgp.c (do_sign): Add the error string to the verify
1523 2004-09-27 Werner Koch <wk@g10code.com>
1527 * app-openpgp.c: Made all strings translatable.
1528 (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
1529 available for use in gnupg 2.
1530 (verify_chv3): Reimplemented countdown showing to use only
1531 functions from this module. Flush the CVH status cache on a
1533 (get_one_do): Hack to bypass the cache for cards versions > 1.0.
1534 (store_fpr): Store the creation date for card version > 1.0.
1536 * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
1537 (get_cached_data): Move local data initialization to ..
1538 (app_select_openpgp): .. here. Read some flags for later use.
1539 (do_getattr): New read-only attribute EXTCAP.
1541 * apdu.c (open_pcsc_reader): Do not print empty reader string.
1543 * ccid-driver.c (do_close_reader): Factored some code out from ...
1544 (ccid_close_reader): ..here.
1545 (ccid_shutdown_reader): New.
1547 * apdu.c (apdu_shutdown_reader): New.
1548 (shutdown_ccid_reader): New.
1550 * apdu.c (open_ccid_reader): New arg PORTSTR. Pass it to
1552 (apdu_open_reader): Pass portstr to open_ccid_reader.
1553 (apdu_open_reader): No fallback if a full CCID reader id has been
1556 * ccid-driver.c (ccid_get_reader_list): New.
1557 (ccid_open_reader): Changed API to take a string for the reader.
1558 Removed al the cruft for the libusb development vesion which seems
1559 not to be maintained anymore and there are no packages anyway.
1560 The stable library works just fine.
1561 (struct ccid_reader_id_s): Deleted and replaced everywhere by a
1563 (usb_get_string_simple): Removed.
1564 (bulk_in): Do valgrind hack here and not just everywhere.
1566 * ccid-driver.c (read_device_info): Removed.
1567 (make_reader_id, scan_or_find_devices): New.
1568 (ccid_open_reader): Simplified by make use of the new functions.
1569 (ccid_set_debug_level): New. Changed the macros to make use of
1570 it. It has turned out that it is often useful to enable debugging
1571 at runtime so I added this option.
1573 From gnupg 1.3 - David Shaw <dshaw@jabberwocky.com>
1575 * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
1576 admin PINs can be entered before the card is locked.
1578 * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
1579 breaks us when using --enable-m-guard.
1581 * ccid-driver.c (usb_get_string_simple): Replacement function to
1582 work with older libusb.
1584 * ccid-driver.c (read_device_info): Fix segfault when usb device
1586 (ccid_open_reader): Allow working with an even older version of
1587 libusb (usb_busses global instead of usb_get_busses()).
1589 2004-09-11 Werner Koch <wk@g10code.com>
1591 * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
1592 not app_number_serialno.
1594 2004-08-20 Werner Koch <wk@g10code.de>
1596 * app.c (select_application): Fixed serial number extraction and
1597 added the BMI card workaround.
1598 (app_munge_serialno): New.
1599 * app-openpgp.c (app_select_openpgp): Try munging serialno.
1601 2004-08-05 Werner Koch <wk@g10code.de>
1603 * scdaemon.c (main): New option --disable-application.
1604 * app.c (is_app_allowed): New.
1605 (select_application): Use it to check for disabled applications.
1607 * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
1608 * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
1610 (ccid_get_atr): Handle short messages.
1612 * apdu.c (my_rapdu_get_status): Implemented.
1614 2004-07-27 Moritz Schulte <moritz@g10code.com>
1616 * apdu.c: Include <signal.h>.
1618 * Makefile.am: Use @DL_LIBS@ instead of -ldl.
1620 2004-07-22 Werner Koch <wk@g10code.de>
1622 * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1624 * apdu.c: Don't use Pth if we use OpenSC.
1625 * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.
1627 * scdaemon.c (main): Bumbed thread stack size up to 512k.
1629 2004-07-16 Werner Koch <wk@gnupg.org>
1631 * apdu.c (reader_table_s): Add function pointers for the backends.
1632 (apdu_close_reader, apdu_get_status, apdu_activate)
1633 (send_apdu): Make use of them.
1634 (new_reader_slot): Intialize them to NULL.
1635 (dump_ccid_reader_status, ct_dump_reader_status): New.
1636 (dump_pcsc_reader_status): New.
1637 (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1638 (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1639 (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu)
1640 (error_string): Removed. Replaced by apdu_strerror.
1641 (get_ccid_error_string): Removed.
1642 (ct_activate_card): Remove the unused loop.
1643 (reset_ct_reader): Implemented.
1644 (ct_send_apdu): Activate the card if not yet done.
1645 (pcsc_send_apdu): Ditto.
1647 2004-07-15 Werner Koch <wk@gnupg.org>
1649 * ccid-driver.h: Add error codes.
1650 * ccid-driver.c: Implement more or less proper error codes all
1653 * apdu.c (apdu_send_direct): New.
1654 (get_ccid_error_string): Add some error code mappings.
1655 (send_apdu): Pass error codes along for drivers already supporting
1657 (host_sw_string): New.
1658 (get_ccid_error_string): Use above.
1659 (send_apdu_ccid): Reset the reader if it has not yet been done.
1660 (open_ccid_reader): Don't care if the ATR can't be read.
1661 (apdu_activate_card): New.
1662 (apdu_strerror): New.
1663 (dump_reader_status): Only enable it with opt.VERBOSE.
1664 * iso7816.c (map_sw): Add mappings for the new error codes.
1666 2004-07-02 Werner Koch <wk@gnupg.org>
1668 * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1669 (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1672 2004-07-01 Werner Koch <wk@gnupg.org>
1674 * sc-investigate.c: Initialize Pth which is now required.
1675 (interactive_shell): New command "readpk".
1677 * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1679 2004-06-30 Werner Koch <wk@gnupg.org>
1681 * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1684 2004-06-18 Werner Koch <wk@g10code.com>
1686 * sc-investigate.c (my_read_line): Renamed from read_line.
1688 2004-06-16 Werner Koch <wk@gnupg.org>
1690 * apdu.c (osc_get_status): Fixed type in function name. Noted by
1691 Axel Thimm. Yes, I didn't tested it with OpenSC :-(.
1693 2004-04-28 Werner Koch <wk@gnupg.org>
1695 * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1697 2004-04-27 Werner Koch <wk@gnupg.org>
1699 * app-common.h: Do not include ksba.h for gnupg 1.
1701 2004-04-26 Werner Koch <wk@gnupg.org>
1703 * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1704 * app.c (release_application): Call new deconstructor.
1705 * app-openpgp.c (do_deinit): New.
1706 (get_cached_data, flush_cache_item, flush_cache_after_error)
1708 (get_one_do): Replaced arg SLOT by APP. Make used of cached data.
1709 (verify_chv2, verify_chv3): Flush some cache item after error.
1710 (do_change_pin): Ditto.
1712 (do_setattr): Flush cache item.
1713 (do_genkey): Flush the entire cache.
1714 (compare_fingerprint): Use cached data.
1716 * scdaemon.c (main): Do the last change the usual way. This is so
1717 that we can easily test for versioned config files above.
1719 2004-04-26 Marcus Brinkmann <marcus@g10code.de>
1721 * scdaemon.c (main): For now, always print default filename for
1722 --gpgconf-list, and never /dev/null.
1724 2004-04-21 Werner Koch <wk@gnupg.org>
1726 * command.c (scd_update_reader_status_file): Send a signal back to
1728 (option_handler): Parse the new event-signal option.
1730 * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1731 changing the verbosity.
1733 2004-04-20 Werner Koch <wk@gnupg.org>
1735 * command.c (scd_update_reader_status_file): Write status files.
1737 * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1740 * pcsc-wrapper.c: New.
1741 * Makefile.am (pkglib_PROGRAMS): Install it here.
1742 * apdu.c (writen, readn): New.
1743 (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1744 pcsc-wrapper if we are using Pth.
1745 (apdu_send_le): Reinitialize RESULTLEN. Handle SW_EOF_REACHED
1748 2004-04-19 Werner Koch <wk@gnupg.org>
1750 * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1751 features away. New arg HANDLE
1752 (read_device_info): New arg HANDLE. Changed caller.
1753 (bulk_in): Handle time extension requests.
1754 (ccid_get_atr): Setup parameters and the IFSD.
1755 (compute_edc): New. Factored out code.
1756 (ccid_transceive): Use default NADs when required.
1758 2004-04-14 Werner Koch <wk@gnupg.org>
1760 * scdaemon.h (server_control_s): Add member READER_SLOT.
1761 * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
1762 * command.c (open_card): Reuse an open slot.
1763 (reset_notify): Just reset the slot if supported by the reader.
1764 (do_reset): Factored code from above out.
1765 (scd_command_handler): Use it for cleanup.
1767 * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
1768 SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
1769 * iso7816.c (map_sw): Map it.
1771 * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
1772 * apdu.c (apdu_get_status): New.
1773 (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
1774 (get_status_ccid): New.
1776 (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
1777 (reset_ccid_reader): New.
1778 (apdu_enum_reader): New.
1780 * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
1781 (new_reader_slot) [USE_GNU_PTH]: Init mutex.
1782 (apdu_reset, apdu_get_status, apdu_send_le): Run functions
1785 * command.c (scd_update_reader_status_file): New.
1786 * scdaemon.c (handle_tick): Call it.
1788 2004-04-13 Werner Koch <wk@gnupg.org>
1790 * scdaemon.c: Convert to a Pth application.
1791 (handle_signal, ticker_thread, handle_tick): New.
1792 (main): Fire up the ticker thread in server mode.
1794 2004-03-23 Werner Koch <wk@gnupg.org>
1796 * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
1798 2004-03-17 Werner Koch <wk@gnupg.org>
1800 * tlv.c (parse_ber_header): Do not check for tag overflow - it
1801 does not make sense. Simplified the check for length overflow.
1803 * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
1805 2004-03-16 Werner Koch <wk@gnupg.org>
1807 * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
1808 * app-nks.c (get_length_of_cert): Removed.
1810 (app_help_read_length_of_cert): New. Code taken from above. New
1811 optional arg R_CERTOFF.
1813 * card-dinsig.c: Removed.
1814 * card.c (card_get_serial_and_stamp): Do not bind to the old and
1815 never finsiged card-dinsig.c.
1817 * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
1819 2004-03-11 Werner Koch <wk@gnupg.org>
1821 * scdaemon.h (out_of_core): Removed. Replaced callers by standard
1824 * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
1825 to include a header defined by the compiler. This helps us to
1826 reuse the source in other software.
1828 2004-03-10 Werner Koch <wk@gnupg.org>
1830 * iso7816.c (iso7816_read_record): New arg SHORT_EF. Changed all
1833 2004-02-18 Werner Koch <wk@gnupg.org>
1835 * sc-investigate.c (main): Setup the used character set.
1836 * scdaemon.c (main): Ditto.
1838 * scdaemon.c (set_debug): New. Add option --debug-level.
1839 (main): Add option --gpgconf-list.
1841 2004-02-12 Werner Koch <wk@gnupg.org>
1843 * Makefile.am: Include cmacros.am for common flags.
1845 2004-01-29 Werner Koch <wk@gnupg.org>
1847 * command.c (reset_notify): Release the application context and
1850 2004-01-28 Werner Koch <wk@gnupg.org>
1852 * iso7816.c (iso7816_manage_security_env): New.
1853 (iso7816_decipher): Add PADIND argument.
1855 2004-01-27 Werner Koch <wk@gnupg.org>
1857 * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
1859 * app-common.h (app_ctx_s): Added readcert field.
1860 * app.c (app_readcert): New.
1861 * tlv.c (parse_ber_header): Added; taken from libksba.
1863 2004-01-26 Werner Koch <wk@gnupg.org>
1865 * card.c (map_sc_err): Use SCD as the error source.
1867 * command.c (open_card): ADD arg NAME to allow requesting a
1868 specific application. Changed all callers.
1869 (cmd_serialno): Allow optional argument to select the desired
1874 * scdaemon.h (opt): Add READER_PORT.
1875 * scdaemon.c (main): Set it here.
1876 * app.c (app_set_default_reader_port): Removed.
1877 (select_application): Add NAME arg and figure out a
1878 default serial number from the GDO. Add SLOT arg and remove all
1880 (release_application): New.
1881 (app_write_learn_status): Output an APPTYPE status line.
1882 * command.c (open_card): Adapt for select_application change.
1883 * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
1884 and set it directly. Changed all callers.
1886 2004-01-25 Werner Koch <wk@gnupg.org>
1888 * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
1890 * app-openpgp.c (find_tlv): Factor out this function to ..
1891 * tlv.c, tlv.h: .. new.
1893 * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
1896 2004-01-21 Werner Koch <wk@gnupg.org>
1898 * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
1900 2004-01-20 Werner Koch <wk@gnupg.org>
1902 * iso7816.c (iso7816_read_binary): New.
1903 (iso7816_select_file): New.
1904 (iso7816_list_directory): New.
1906 * sc-investigate.c: Add option -i.
1907 (select_app, read_line, interactive_shell): New.
1909 2004-01-16 Werner Koch <wk@gnupg.org>
1911 * apdu.h: Add SW_FILE_NOT_FOUND.
1912 * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
1913 * iso7816.c (iso7816_select_file): New.
1915 * app-dinsig.c: New file w/o any real code yet.
1916 * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
1918 * sc-investigate.c: Add option --disable-ccid.
1920 2003-12-19 Werner Koch <wk@gnupg.org>
1922 * apdu.c (apdu_send_le): Send a get_response with the indicated
1923 length and not the 64 bytes we used for testing.
1925 * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
1926 minimum length of the passphrase, so that we don't need to
1927 decrement the retry counter.
1929 2003-12-17 Werner Koch <wk@gnupg.org>
1931 * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
1932 * card-dinsig.c (dinsig_enum_keypairs): Ditto.
1934 2003-12-16 Werner Koch <wk@gnupg.org>
1936 * scdaemon.c (main): Set the prefixes for assuan logging.
1938 2003-11-17 Werner Koch <wk@gnupg.org>
1940 * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
1941 * app-openpgp.c (verify_chv3): Check it here.
1943 2003-11-12 Werner Koch <wk@gnupg.org>
1945 Adjusted for API changes in Libksba.
1947 2003-10-30 Werner Koch <wk@gnupg.org>
1949 * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
1950 (get_ccid_error_string): New. Not very useful messages, though.
1952 2003-10-25 Werner Koch <wk@gnupg.org>
1954 * ccid-driver.c (ccid_open_reader): Return an error if no USB
1957 * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
1960 * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
1962 2003-10-20 Werner Koch <wk@gnupg.org>
1964 * command.c (cmd_checkpin): New.
1965 (register_commands): Add command CHECKPIN.
1966 * app.c (app_check_pin): New.
1967 * app-openpgp.c (check_against_given_fingerprint): New. Factored
1968 out that code elsewhere.
1969 (do_check_pin): New.
1971 2003-10-10 Werner Koch <wk@gnupg.org>
1973 * ccid-driver.c (ccid_close_reader): New.
1975 * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
1976 (close_osc_reader, apdu_close_reader): New. Not all are properly
1979 2003-10-09 Werner Koch <wk@gnupg.org>
1981 * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
1983 2003-10-08 Werner Koch <wk@gnupg.org>
1985 * app-openpgp.c (do_getattr): Support SERIALNO and AID.
1987 2003-10-01 Werner Koch <wk@gnupg.org>
1989 * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
1991 * app-openpgp.c: Ditto.
1993 (generate_keypair): Renamed to ..
1994 (do_generate_keypair): .. this.
1995 * app-common.h [GNUPG_MAJOR_VERSION]: New.
1996 * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
1998 2003-09-30 Werner Koch <wk@gnupg.org>
2000 * command.c (cmd_getattr): New command GETATTR.
2001 * app.c (app_setattr): New.
2003 (do_learn_status): Reimplemented in terms of do_getattr.
2005 * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
2007 (verify_chv2, verify_chv3): New. Factored out common code.
2008 (do_setattr, do_sign, do_auth, do_decipher): Change the names of
2009 the prompts to match that we have only 2 different PINs.
2010 (app_select_openpgp): Check whether the card enforced CHV1.
2011 (convert_sig_counter_value): New. Factor out code from
2014 2003-09-28 Werner Koch <wk@gnupg.org>
2016 * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
2018 2003-09-19 Werner Koch <wk@gnupg.org>
2020 * ccid-driver.c (parse_ccid_descriptor): New.
2021 (read_device_info): New.
2022 (ccid_open_reader): Check that the device has all required features.
2024 2003-09-06 Werner Koch <wk@gnupg.org>
2026 * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
2027 David Corcoran was so kind to remove the GPL incompatible
2028 advertisng clause from pcsclite.
2029 * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
2031 2003-09-05 Werner Koch <wk@gnupg.org>
2033 * ccid-driver.c: More work, data can now actually be retrieved.
2034 * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
2037 2003-09-02 Werner Koch <wk@gnupg.org>
2039 * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
2040 * ccid-driver.c, ccid-driver.h: New but far from being useful.
2041 * Makefile.am: Add above.
2042 * apdu.c: Add support for that ccid driver.
2044 2003-08-26 Timo Schulz <twoaday@freakmail.de>
2046 * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
2049 2003-08-25 Werner Koch <wk@gnupg.org>
2051 * command.c (cmd_setattr): Use a copy of LINE.
2052 (cmd_genkey): Use a copy of KEYNO.
2053 (cmd_passwd): Use a copy of CHVNOSTR.
2054 (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
2056 2003-08-19 Werner Koch <wk@gnupg.org>
2058 * scdaemon.c, scdaemon.h: New option --pcsc-driver.
2059 * apdu.c (apdu_open_reader): Use that option here instead of a
2062 2003-08-18 Werner Koch <wk@gnupg.org>
2064 * Makefile.am: Add OPENSC_LIBS to all programs.
2066 * scdaemon.c, scdaemon.h: New option --disable-opensc.
2067 * card.c (card_open): Implement it.
2068 * apdu.c (open_osc_reader, osc_send_apdu): New.
2069 (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
2071 (error_string) [HAVE_OPENSC]: Use sc_strerror.
2072 (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
2074 * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
2077 2003-08-14 Timo Schulz <twoaday@freakmail.de>
2079 * apdu.c (ct_activate_card): Change the code a little to avoid
2080 problems with other readers.
2081 * Always use 'dynload.h' instead of 'dlfcn.h'.
2083 2003-08-05 Werner Koch <wk@gnupg.org>
2085 * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
2088 2003-08-04 Werner Koch <wk@gnupg.org>
2090 * app.c (app_set_default_reader_port): New.
2091 (select_application): Use it here.
2092 * scdaemon.c (main): and here.
2093 * sc-copykeys.c: --reader-port does now take a string.
2094 * sc-investigate.c, scdaemon.c: Ditto.
2095 * apdu.c (apdu_open_reader): Ditto. Load pcsclite if no ctapi
2096 driver is configured. Always include code for ctapi.
2097 (new_reader_slot): Don't test for already used ports and remove
2099 (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
2100 (apdu_send_le): Changed RC to long to cope with PC/SC.
2102 * scdaemon.c, scdaemon.h: New option --ctapi-driver.
2103 * sc-investigate.c, sc-copykeys.c: Ditto.
2105 2003-07-31 Werner Koch <wk@gnupg.org>
2107 * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
2109 2003-07-28 Werner Koch <wk@gnupg.org>
2111 * app-openpgp.c (do_setattr): Change implementation. Allow all
2114 2003-07-27 Werner Koch <wk@gnupg.org>
2116 Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
2118 2003-07-24 Werner Koch <wk@gnupg.org>
2120 * app-openpgp.c (do_learn_status): Print more status information.
2121 (app_select_openpgp): Store the card version.
2122 (store_fpr): Add argument card_version and fix DOs for old cards.
2123 (app_openpgp_storekey): Likewise.
2125 2003-07-23 Werner Koch <wk@gnupg.org>
2127 * command.c (cmd_pkauth): New.
2128 (cmd_setdata): Check whether data was given at all to avoid
2129 passing 0 to malloc.
2131 * app.c (app_auth): New.
2132 * app-openpgp.c (do_auth): New.
2134 2003-07-22 Werner Koch <wk@gnupg.org>
2136 * command.c (cmd_passwd): New.
2137 * app.c (app_change_pin): New.
2138 * app-openpgp.c (do_change_pin): New.
2139 * iso7816.c (iso7816_reset_retry_counter): Implemented.
2141 * sc-investigate.c (main): New option --gen-random.
2142 * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
2143 length larger than 255.
2145 2003-07-17 Werner Koch <wk@gnupg.org>
2147 * command.c (cmd_random): New command RANDOM.
2149 * iso7816.c (map_sw): New. Use it in this file to return
2150 meaningful error messages. Changed all public fucntions to return
2152 (iso7816_change_reference_data): New.
2153 * apdu.c (apdu_open_reader): Use faked status words for soem
2156 2003-07-16 Werner Koch <wk@gnupg.org>
2158 * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
2159 specify not to send Le as it should be.
2161 2003-07-15 Werner Koch <wk@gnupg.org>
2163 * Makefile.am: Add sc-copykeys program.
2164 * sc-copykeys.c: New.
2165 * app-openpgp.c (app_openpgp_storekey): New.
2166 (app_openpgp_cardinfo): New.
2168 (store_fpr): And use it here to get the actual length in bit.
2170 2003-07-03 Werner Koch <wk@gnupg.org>
2172 * app-openpgp.c (do_setattr): Add setting of the URL.
2173 (app_select_openpgp): Dump card data only in very verbose mode.
2176 2003-07-02 Werner Koch <wk@gnupg.org>
2178 * app-openpgp.c (get_sig_counter): New.
2179 (do_sign): Print the signature counter and enable the PIN callback.
2180 (do_genkey): Implement the PIN callback.
2182 2003-07-01 Werner Koch <wk@gnupg.org>
2184 * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
2186 2003-06-26 Werner Koch <wk@gnupg.org>
2188 * app-openpgp.c (find_tlv): Fixed length header parsing.
2190 * app.c (app_genkey): New.
2191 * command.c (cmd_genkey): New.
2193 2003-06-25 Werner Koch <wk@gnupg.org>
2195 * command.c (percent_plus_unescape): New.
2198 2003-06-24 Werner Koch <wk@gnupg.org>
2200 * command.c (send_status_info): New.
2202 * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
2203 and setup the function pointers in APP on success. Changed callers.
2205 * app-common.h: New.
2206 * scdaemon.h (APP): New type to handle applications.
2207 (server_control_s): Add an APP context field.
2209 * command.c (cmd_serialno): Handle applications.
2210 (cmd_pksign): Ditto.
2211 (cmd_pkdecrypt): Ditto.
2212 (reset_notify): Ditto.
2213 (cmd_learn): For now return error for application contexts.
2214 (cmd_readcert): Ditto.
2215 (cmd_readkey): Ditto.
2217 2003-06-04 Werner Koch <wk@gnupg.org>
2219 * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
2221 Renamed error codes from INVALID to INV and removed _ERROR suffixes.
2223 2003-06-03 Werner Koch <wk@gnupg.org>
2225 Changed all error codes in all files to the new libgpg-error scheme.
2227 * scdaemon.h: Include gpg-error.h and errno.h
2228 * card.c (map_sc_err): Use unknown for the error source.
2229 * Makefile.am: Link with libgpg-error
2231 2003-05-14 Werner Koch <wk@gnupg.org>
2233 * atr.c, atr.h: New.
2234 * sc-investigate.c: Dump the ATR in a human readable format.
2236 2003-05-08 Werner Koch <wk@gnupg.org>
2238 * scdaemon.h (DBG_CARD_IO_VALUE): New.
2240 * sc-investigate.c: New.
2241 * scdaemon.c (main): Removed --print-atr option.
2243 * iso7816.c, iso7816.h, app-openpgp.c: New.
2245 2003-04-29 Werner Koch <wk@gnupg.org>
2247 * scdaemon.c: New options --print-atr and --reader-port
2248 * apdu.c, apdu.h: New
2250 * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
2252 * Makefile.am (LDFLAGS): Removed.
2254 * command.c (register_commands): Adjusted for new Assuan semantics.
2256 2002-08-21 Werner Koch <wk@gnupg.org>
2258 * scdaemon.c (main): New option --daemon so that the program is
2259 not accidently started in the background.
2261 2002-08-16 Werner Koch <wk@gnupg.org>
2263 * scdaemon.c: Include i18n.h.
2265 * card-common.h (struct p15_private_s): Forward declaration. Add
2267 * card.c (card_close): Make sure private data is released.
2268 (card_enum_certs): New.
2269 * card-p15.c (p15_release_private_data): New.
2270 (init_private_data): New to work around an OpenSC weirdness.
2271 (p15_enum_keypairs): Do an OpenSC get_objects only once.
2272 (p15_enum_certs): New.
2273 (card_p15_bind): Bind new function.
2274 * command.c (cmd_learn): Return information about the certificates.
2276 2002-08-09 Werner Koch <wk@gnupg.org>
2278 * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
2279 number as a fallback. Add a special prefix for serial numbers.
2281 2002-07-30 Werner Koch <wk@gnupg.org>
2283 Changes to cope with OpenSC 0.7.0:
2285 * card.c: Removed the check for the packed opensc version.
2286 Changed include file names of opensc.
2287 (map_sc_err): Adjusted error codes for new opensc version.
2288 * card-p15.c: Changed include filename of opensc.
2289 * card-dinsig.c: Ditto.
2291 * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
2293 2002-07-24 Werner Koch <wk@gnupg.org>
2295 * card.c (find_simple_tlv, find_iccsn): New.
2296 (card_get_serial_and_stamp): Improved serial number parser.
2298 2002-06-27 Werner Koch <wk@gnupg.org>
2300 * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
2302 2002-06-15 Werner Koch <wk@gnupg.org>
2304 * card-dinsig.c: Documented some stuff from the DIN norm.
2306 2002-04-15 Werner Koch <wk@gnupg.org>
2308 * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
2310 2002-04-12 Werner Koch <wk@gnupg.org>
2312 * scdaemon.c: New option --debug-sc N.
2313 * card.c (card_open): set it here.
2315 * card-p15.c (p15_prepare_key): Factored out common code from ...
2316 (p15_sign, p15_decipher): here and made the decryption work the
2319 2002-04-10 Werner Koch <wk@gnupg.org>
2321 * card.c (card_open): Return immediately when no reader is available.
2323 2002-03-27 Werner Koch <wk@gnupg.org>
2325 * card.c (card_open, card_close): Adjusted for changes in OpenSC.
2327 2002-03-10 Werner Koch <wk@gnupg.org>
2329 * card-p15.c, card-dinsig.c, card-common.h: New.
2330 * card.c: Factored most code out to the new modules, so that we
2331 can better support different types of card applications.
2333 2002-01-26 Werner Koch <wk@gnupg.org>
2335 * scdaemon.c scdaemon.h, command.c: New. Based on the code from
2339 Copyright 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
2341 This file is free software; as a special exception the author gives
2342 unlimited permission to copy and/or distribute it, with or without
2343 modifications, as long as this notice is preserved.
2345 This file is distributed in the hope that it will be useful, but
2346 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
2347 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.