1 2009-07-10 Werner Koch <wk@g10code.com>
3 * iso7816.c (iso7816_compute_ds): Add args EXTENDED_MODE and LE.
4 Change all callers to use 0.
5 (iso7816_internal_authenticate): Add args EXTENDED_MODE and LE.
6 * app-openpgp.c (do_sign): Take exmode and Le from card
7 capabilities and pass them to iso7816_compute_ds.
8 (do_auth): Ditto for iso7816_internal_authenticate.
10 2009-07-09 Werner Koch <wk@g10code.com>
12 * app-openpgp.c (change_keyattr): New.
13 (do_writekey): Call it.
15 * app-openpgp.c (does_key_exist): Add arg GENERATING. Change
18 2009-06-30 Werner Koch <wk@g10code.com>
20 * ccid-driver.c (ccid_transceive): Set RESYNCING flag.
22 2009-06-29 Werner Koch <wk@g10code.com>
24 * ccid-driver.c (ccid_transceive): Add a hack to support extended
25 length for Omnikey readers.
27 (parse_ccid_descriptor): Track short+extended apdu exchange level.
29 2009-06-18 Werner Koch <wk@g10code.com>
31 * app-openpgp.c (verify_chv2): Remove special case for v2 cards.
32 (get_public_key): Use extended mode.
34 2009-06-17 Werner Koch <wk@g10code.com>
36 * iso7816.c (iso7816_get_data): Add arg EXTENDED_MODE. Change all
38 * app-openpgp.c (data_objects): Use bit flags. Add flag
40 (get_cached_data): Add arg TRY_EXTLEN and use it for iso7816_get_data.
41 (get_one_do): Use extended length APDU if necessary.
43 2009-06-10 Werner Koch <wk@g10code.com>
45 * app-openpgp.c (store_fpr): Change first arg to app_t; adjust
46 callers. Flush the cache.
48 2009-06-09 Werner Koch <wk@g10code.com>
50 * app-openpgp.c (do_readcert): Return NOT_FOUND if the retrieved
51 data has a length of zero.
52 (do_getattr): Add EXTCAP subkey "sm".
54 2009-05-20 Werner Koch <wk@g10code.com>
56 * app-openpgp.c (verify_chv2): Add case for v2 cards.
57 (verify_chv3): Factor some code out to ..
58 (build_enter_admin_pin_prompt): .. new.
59 (do_change_pin): Properly handle v2 cards.
61 2009-05-19 Werner Koch <wk@g10code.com>
63 * scdaemon.c (create_server_socket): Use SUN_LEN.
64 (JNLIB_NEED_AFLOCAL): Define.
66 2009-05-13 Werner Koch <wk@g10code.com>
68 * ccid-driver.c (abort_cmd): Add arg SEQNO and change callers.
69 (bulk_in): Retry on seqno mismatch.
71 * apdu.c (send_le): Release result_buffer.
72 (apdu_send_direct): Implemend extended length.
73 * command.c (cmd_apdu): Add option "--exlen".
75 2009-05-11 Werner Koch <wk@g10code.com>
77 * apdu.c (send_le): Replace log_error by log_info.
79 2009-05-08 Werner Koch <wk@g10code.com>
81 * app-openpgp.c (do_genkey): Allow larger key sizes.
83 * iso7816.c (do_generate_keypair): Add arg EXTENDED_MODE an LE.
84 (iso7816_generate_keypair, iso7816_read_public_key): Ditto.
86 * apdu.c (send_le): Implement extended length return values.
88 * ccid-driver.c (bulk_in): Retry on EAGAIN.
89 (abort_cmd): Change seqno handling.
91 2009-04-28 Werner Koch <wk@g10code.com>
93 * app-help.c (app_help_count_bits): New.
95 * app-nks.c (switch_application): Detect mass signature cards.
96 Take care of new NEED_APP_SELECT flag.
97 (do_sign): Don't allow mass signature cards.
100 (app_select_nks): Register do_readkey.
102 2009-04-01 Werner Koch <wk@g10code.com>
104 * app-openpgp.c (do_setattr, do_writekey): Prepare for extended
107 2009-03-31 Werner Koch <wk@g10code.com>
109 * command.c (percent_plus_unescape): Remove.
110 (cmd_setattr): Use percent_plus_unescape_inplace.
112 2009-03-30 Werner Koch <wk@g10code.com>
114 * app-nks.c (do_decipher): Make it work for TCOS 3.
115 * iso7816.c (iso7816_decipher): Add arg EXTENDED_MODE.
116 * apdu.c (apdu_send): Add arg EXTENDED_MODE and change all callers.
117 (apdu_send_le): Ditto.
118 (apdu_send_direct): Ditto, but not yet functional.
119 (send_le): Fix command chaining. Implement extended length option.
120 * ccid-driver.c (ccid_transceive): Remove restriction on apdu length.
121 (struct ccid_driver_s): Add field IFSC.
122 (ccid_get_atr): Set IFSC.
123 (ccid_transceive): Use negotiated IFSC and support S(IFS) command.
125 2009-03-26 Werner Koch <wk@g10code.com>
127 * command.c (cmd_pksign): Allow more hash algorithms.
129 * scdaemon.h (MAX_DIGEST_LEN): Change to 64.
131 * apdu.c (open_ccid_reader): Clear the is_to flag.
133 * app-nks.c (filelist): Add field KID.
134 (do_getattr): Change standard authentication key.
135 (do_sign): Setup a security environment for TCOS 3 cards and support
136 all SHA-2 algorithms.
138 2009-03-24 Werner Koch <wk@g10code.com>
140 * command.c (struct server_local_s): Add flag
141 APP_CTX_MARKED_FOR_RELEASE.
142 (do_reset): Set the flag.
143 (open_card): Act on this flag.
144 * app-common.h (struct app_ctx_s): Add flag NO_REUSE.
145 (application_notify_card_reset): Set the flag.
146 * app.c (select_application, release_application): Take care of
149 2009-03-20 Werner Koch <wk@g10code.com>
151 * app-nks.c (keygripstr_from_pk_file): Fix for TCOS 3 cards.
153 2009-03-18 Werner Koch <wk@g10code.com>
155 * apdu.c (open_pcsc_reader_wrapped): Use close_all_fds.
157 * command.c (cmd_learn): Add option --keypairinfo.
158 * app.c (app_write_learn_status): Add arg FLAGS.
159 * app-common.h (struct app_ctx_s): Add arg FLAGS to LEARN_STATUS.
160 Change all implementors.
161 * app-p15.c (do_learn_status): Take care of flag bit 0.
162 * app-nks.c (do_learn_status, do_learn_status_core): Ditto.
164 2009-03-10 Werner Koch <wk@g10code.com>
166 * app-openpgp.c (send_key_attr): New.
167 (do_getattr): New attribute KEY_ATTR.
168 * command.c (send_status_direct): New.
170 2009-03-06 Werner Koch <wk@g10code.com>
172 * app-nks.c (do_learn_status): Factor code out to..
173 (do_learn_status_core): .. new.
174 (do_readcert, do_sign, do_decipher): Switch to SigG if needed.
175 (verify_pin): Use DESC also for keypad based verify.
177 2009-03-05 Werner Koch <wk@g10code.com>
179 * app-openpgp.c (verify_a_chv): Remove special case for keypads.
180 (verify_chv3): Ditto.
182 * app-nks.c (get_chv_status): New.
183 (parse_pwidstr): New.
184 (verify_pin): Add args PWID and DESC and use them. Remove the
186 (do_change_pin): Allow PIN selection and add reset mode.
187 (do_learn_status): Use NKS-NKS3 tag for TCOS 3 cards.
188 (do_readcert, do_sign): Allow NKS-NKS3 tag.
190 2009-03-04 Werner Koch <wk@g10code.com>
192 * app-nks.c (do_getattr): New.
193 (app_select_nks): Register it.
194 (verify_pin): Factor some code out to...
195 (basic_pin_checks): New.
196 (do_change_pin): Call the basic check.
197 (app_select_nks): Move AID to ..
200 (switch_application): New.
201 (do_getattr, do_learn_status, do_readcert, do_sign, do_decipher)
202 (do_change_pin, do_check_pin): Make sure we are in NKS mode.
204 2009-03-03 Werner Koch <wk@g10code.com>
206 * command.c (scd_command_handler): Remove dereference of STOPME
209 2009-02-27 Werner Koch <wk@g10code.com>
211 * app.c (get_supported_applications): New.
212 * command.c (cmd_getinfo): New subcommand "app_list"
214 (register_commands): Register command KILLSCD.
215 (struct server_local_s): Add field STOPME.
216 (scd_command_handler): Act upon this.
218 2009-02-25 Werner Koch <wk@g10code.com>
220 * apdu.c (apdu_get_status): Factor all code out to ...
221 (apdu_private_get_status): .. new. Add arg NO_ATR_RESET.
222 (apdu_connect): Call new function.
224 * scdaemon.c: New option --debug-log-tid.
225 (tid_log_callback): New.
226 (main): Move debug-wait code after debug stream init.
228 2009-02-24 Werner Koch <wk@g10code.com>
230 * ccid-driver.c (ccid_get_atr): Move debug output to ..
231 (print_r2p_parameters): .. new.
232 (print_r2p_header, print_pr_data, print_r2p_unknown)
233 (print_r2p_datablock, print_r2p_slotstatus, print_r2p_escape)
234 (print_r2p_datarate): New.
235 (bulk_in): Call parameter printing.
236 (ccid_set_debug_level): Add debug level 3.
237 (convert_le_u16): New.
238 (print_p2r_header, print_p2r_iccpoweron, print_p2r_iccpoweroff)
239 (print_p2r_getslotstatus, print_p2r_xfrblock)
240 (print_p2r_getparameters, print_p2r_resetparameters)
241 (print_p2r_setparameters, print_p2r_escape, print_p2r_iccclock)
242 (print_p2r_to0apdu, print_p2r_secure, print_p2r_mechanical)
243 (print_p2r_abort, print_p2r_setdatarate, print_r2p_unknown): New.
244 (bulk_out): Add arg NO_DEBUG and change all callers to pass 0.
245 Call parameter printing.
246 (ccid_slot_status): Call with NO_DEBUG set.
247 (abort_cmd, send_escape_cmd, ccid_get_atr, ccid_get_atr)
248 (ccid_transceive_apdu_level, ccid_transceive)
249 (ccid_transceive_secure): Remove old debug print code.
251 2009-02-12 Werner Koch <wk@g10code.com>
253 * command.c (cmd_getinfo): Add new subcommand "deny_admin".
255 2009-01-28 Werner Koch <wk@g10code.com>
257 * scdaemon.c (main): Make --allow-admin the default and make the
260 2009-01-27 Werner Koch <wk@g10code.com>
262 * app-geldkarte.c: Changed to use an AID.
264 * app.c (app_munge_serialno): Add case for no serialno.
265 (app_get_serial_and_stamp): Ditto.
267 2009-01-26 Werner Koch <wk@g10code.com>
269 * app-geldkarte.c: New.
270 * Makefile.am (card_apps): Add new file.
271 * app.c (select_application): Test for geldkarte.
273 2009-01-12 Werner Koch <wk@g10code.com>
275 * command.c (send_client_notifications) [HAVE_W32_SYSTEM]: Fix
278 2009-01-08 Werner Koch <wk@g10code.com>
280 * iso7816.c (iso7816_read_record, iso7816_read_binary): Pass 0 for
281 L_e because the problem with the CCID driver has gone.
282 (iso7816_apdu_direct): New.
284 * app-nks.c (filelist): Add NKS_VER field. Add NKS 3 specific
286 (app_local_s, do_deinit): New.
287 (get_nks_version): New.
288 (app_select_nks): Setup local data.
289 (keygripstr_from_pk_file): Replace SLOT by APP and take care of
291 (do_learn_status): Take care of NKS version.
293 2009-01-05 Werner Koch <wk@g10code.com>
295 * apdu.c (apdu_get_status): Save the last status.
297 2008-12-18 Werner Koch <wk@g10code.com>
299 * ccid-driver.c (abort_cmd): New.
300 (bulk_in): Call abort_cmd after severe errors.
302 * apdu.c (reader_table_s): Add field ANY_STATUS.
303 (new_reader_slot): Clear it.
304 (apdu_get_status): Use ANY_STATUS to update the change counter.
305 Remove the use of the flag bit from LAST_STATUS everywhere.
306 * command.c (update_reader_status_file): Factor code out to ...
307 (send_client_notifications): New. Track signals already sent.
308 (update_reader_status_file): Shutdown the reader after a failed
311 2008-12-09 Werner Koch <wk@g10code.com>
313 * scdaemon.c (main): Call i18n_init before init_common_subsystems.
315 2008-12-08 Werner Koch <wk@g10code.com>
317 * scdaemon.c (handle_connections): Sync ticker to the next full
319 (TIMERTICK_INTERVAL_USEC): Change to 500ms.
321 2008-12-05 Werner Koch <wk@g10code.com>
323 * app-openpgp.c (app_local_s): Add field ALGO_ATTR_CHANGE.
324 (app_select_openpgp): Parse new capability.
325 (show_caps): Show new capability.
327 2008-12-03 Werner Koch <wk@g10code.com>
329 * scdaemon.c (opts): Use ARGPARSE_ macros. Add option
331 * command.c (update_reader_status_file): Implement it.
333 2008-11-18 Werner Koch <wk@g10code.com>
335 * scdaemon.c (make_libversion): New.
336 (my_strusage): Print libgcrypt and libksba version.
338 2008-11-03 Werner Koch <wk@g10code.com>
340 * command.c (server_local_s): Add field DISCONNECT_ALLOWED.
341 (cmd_disconnect): Implement command.
342 (open_card): Reset disconnect flag.
343 (update_reader_status_file): Disconnect if allowed.
345 * app-common.h (app_ctx_s): Remove INITIALIZED. Make REF_COUNT
347 * app.c (select_application): Remove INITIALIZED.
348 (app_write_learn_status, app_readcert, app_readkey, app_getattr)
349 (app_setattr, app_sign, app_decipher, app_writecert)
350 (app_writekey, app_get_challenge, app_change_pin, app_check_pin):
351 Replace INITIALIZED by REF_COUNT check.
352 (application_notify_card_removed): Rename to ..
353 (application_notify_card_reset): .. this. Change all callers.
354 * command.c (do_reset): Call application_notify_card_reset after
356 (update_reader_status_file): Add arg SET_CARD_REMOVED.
357 (scd_update_reader_status_file): Pass true for new flag.
358 (do_reset): Pass false for new flag.
360 * app.c (app_get_serial_and_stamp): Use bin2hex.
361 * app-help.c (app_help_get_keygrip_string): Ditto.
362 * app-p15.c (send_certinfo, send_keypairinfo, do_getattr): Ditto.
363 * app-openpgp.c (send_fpr_if_not_null, send_key_data)
364 (retrieve_fpr_from_card, send_keypair_info): Ditto.
365 * app-nks.c (keygripstr_from_pk_file): Ditto.
366 * command.c (cmd_apdu): Ditto.
368 2008-10-21 Marcus Brinkmann <marcus@g10code.com>
370 * command.c (open_card): If connect error is SW_HOST_NO_CARD,
371 return a more descriptive error.
373 2008-10-20 Werner Koch <wk@g10code.com>
375 * pcsc-wrapper.c (read_32): Use provided arg and not stdin. Is
376 called with stdin, though.
377 (handle_close): Mark unused arg.
378 (handle_status, handle_reset): Ditto.
380 * ccid-driver.c (ccid_check_card_presence): Mark not yet used arg.
382 * scdaemon.c (scd_deinit_default_ctrl): Mark unused arg.
383 * command.c (cmd_unlock, cmd_restart, cmd_disconnect): Ditto.
384 * apdu.c (ct_get_status): Ditto.
385 (ct_send_apdu, pcsc_send_apdu_wrapped)
386 (apdu_open_remote_reader): Ditto.
387 * app.c (select_application): Ditto.
388 * app-openpgp.c (do_writecert, do_change_pin, do_writekey): Ditto.
389 * app-nks.c (do_change_pin, do_check_pin): Ditto.
391 2008-10-16 Werner Koch <wk@g10code.com>
393 * command.c (cmd_disconnect): New dummy command.
394 (register_commands): Register command.
396 2008-10-15 Werner Koch <wk@g10code.com>
398 * command.c (scd_command_handler): Return true if there is no more
400 * scdaemon.c (start_connection_thread): Set shutdown flag if
401 requested by command handler.
402 (main): Make PIPE_SERVER module global.
403 (handle_connections): Disable listen_fd if a shutdown is pending.
405 2008-10-14 Werner Koch <wk@g10code.com>
407 * apdu.c (reader_table_s): Add fields connect_card and
409 (new_reader_slot): Set them to NULL.
410 (apdu_connect, apdu_disconnect): New.
411 (apdu_close_reader, apdu_shutdown_reader): Call apdu_disconnect.
412 (connect_pcsc_card, disconnect_pcsc_card): new.
413 (reset_pcsc_reader_direct): Implement in terms of
414 disconnect_pcsc_card and connect_pcsc_card.
415 (apdu_get_atr): Return NULL if there is no ATR.
416 * sc-copykeys.c (main): Add call to apdu_connect.
417 * command.c (open_card): Ditto.
419 * apdu.h (SW_HOST_ALREADY_CONNECTED): New.
420 (APDU_CARD_USABLE, APDU_CARD_PRESENT, APDU_CARD_ACTIVE): New.
421 * apdu.c: Replace constants by the new macros.
422 (open_pcsc_reader): Factor code out to ...
423 (open_pcsc_reader_direct, open_pcsc_reader_wrapped): New.
424 (reset_pcsc_reader): Factor code out to ...
425 (reset_pcsc_reader_direct, reset_pcsc_reader_wrapped): New.
426 (pcsc_get_status): Factor code out to ...
427 (pcsc_get_status_direct, pcsc_get_status_wrapped): New.
428 (pcsc_send_apdu): Factor code out to ...
429 (pcsc_send_apdu_direct, pcsc_send_apdu_wrapped): New.
430 (close_pcsc_reader): Factor code out to ...
431 (close_pcsc_reader_direct, close_pcsc_reader_wrapped): New.
433 * command.c (update_reader_status_file): Open the reader if not
436 * scdaemon.c (TIMERTICK_INTERVAL_SEC, TIMERTICK_INTERVAL_USEC):
437 New to replace TIMERTICK_INTERVAL. Chnage from 2s (4 under W32)
440 2008-10-13 Werner Koch <wk@g10code.com>
442 * command.c (option_handler) [W32]: Use strtoul with base 16.
443 (update_reader_status_file) [W32]: Set Event.
444 (scd_command_handler): Use INT2FD to silent warning.
446 2008-09-29 Werner Koch <wk@g10code.com>
448 * scdaemon.h (GCRY_MD_USER): Rename to GCRY_MODULE_ID_USER.
449 (GCRY_MD_USER_TLS_MD5SHA1): Rename to MD_USER_TLS_MD5SHA1 and
452 2008-09-28 Marcus Brinkmann <marcus@g10code.com>
454 * apdu.c (pcsc_get_status): Fix last change.
456 2008-09-25 Werner Koch <wk@g10code.com>
458 * app-openpgp.c (do_setattr): Do not allow setting of the reset
460 (do_change_pin): Allow setting of the reset code.
462 2008-09-24 Werner Koch <wk@g10code.com>
464 * app-openpgp.c (verify_chv3): Set the did_chv3 flag which was
465 accidently removed on 2008-03-26.
466 (verify_chv2): Revert last change.
467 (do_change_pin): Do not change CHV2. Add reset code logic for v2
469 * iso7816.c (iso7816_reset_retry_counter_with_rc): New.
471 * app-openpgp.c (add_tlv, build_privkey_template): New.
472 (do_writekey): Support v2 keys and other key lengths than 1024.
473 * iso7816.c (iso7816_put_data_odd): New.
475 2008-09-23 Werner Koch <wk@g10code.com>
477 * app-openpgp.c (do_sign): Support SHA-2 digests.
478 (verify_chv2): No CHV auto-sync for v2 cards.
479 (do_auth): Allow 2048 bit keys.
480 (parse_algorithm_attribute): New.
481 (rsa_key_format_t): New.
482 (struct app_local_s): Add struct KEYATTR.
484 2008-09-23 Marcus Brinkmann <marcus@g10code.com>
486 * apdu.c (pcsc_get_status): Be more relaxed with the usable flag
489 2008-09-23 Werner Koch <wk@g10code.com>
491 * app-openpgp.c (do_setattr): Use command chaining for long
493 * iso7816.c (iso7816_put_data): Add arg EXTENDED_MODE. Change all
495 * apdu.c (apdu_send_simple): Add arg EXTENDED_MODE. Change all
497 (send_le): Implement command chaining.
498 * ccid-driver.c (ccid_transceive_apdu_level): Increase allowed
500 (ccid_transceive): Alow for APDUS of up to 259 bytes.
501 * apdu.h: Add new SW_ codes.
503 2008-09-16 Werner Koch <wk@g10code.com>
505 * command.c (cmd_writecert): New.
506 (register_commands): Register it.
507 * app-common.h (app_ctx_s): Add member WRITECERT.
508 * app.c (app_writecert): New.
509 * app-openpgp.c (do_writecert): New.
510 (parse_historical): New.
512 (dump_all_do): Print only the length of longs DOs.
513 * command.c (cmd_writekey, cmd_apdu, cmd_pksign)
514 (cmd_passwd): Replace open coding by skip_options.
516 2008-08-30 Moritz <moritz@gnu.org>
518 * scdaemon.c (main): Use estream_asprintf instead of asprintf.
519 * command.c (update_reader_status_file): Likewise.
520 (cmd_serialno): Use estream_asprintf instead of asprintf
521 and xfree instead of free to release memory allocated
522 through (estream_)asprintf.
523 (cmd_learn): Likewise.
525 * app-openpgp.c (get_public_key): Likewise.
527 2008-08-18 Werner Koch <wk@g10code.com>
529 * app-openpgp.c (do_setattr): Fix test for v2 cards.
531 2008-08-11 Werner Koch <wk@g10code.com>
533 * apdu.c (reset_pcsc_reader, open_pcsc_reader)
534 (reset_rapdu_reader, open_rapdu_reader): Allow ATRs of up to 33
535 bytes. Provide maximum size of ATR buffer using DIM. Such long
536 ATR are never seen in reality but the PC/SC library of MAC OS X is
537 just too buggy. Reported by Ludovic Rousseau. Fixes bug #948.
539 2008-07-30 Werner Koch <wk@g10code.com>
541 * app-openpgp.c (verify_a_chv): Use xtrymalloc and make the prompt
542 for CHV2 more user friendly.
544 2008-07-03 Werner Koch <wk@g10code.com>
546 * app-openpgp.c (do_readcert): New.
547 (app_local_s): Add fields IS_V2 and MAX_CERTLEN_3.
548 (app_select_openpgp): Set them and register do_readcert.
549 (do_setattr): Allow storing of the certificate.
551 2008-06-25 Werner Koch <wk@g10code.com>
553 * app-dinsig.c (do_sign): Allow for SHA256.
555 2008-06-24 Werner Koch <wk@g10code.com>
557 * app-common.h (app_ctx_s): Renamed reset_mode parameter of
558 change_pin to mode_Flags and make it an unsigned int.
559 (APP_CHANGE_FLAG_RESET, APP_CHANGE_FLAG_NULLPIN): New.
560 * app-openpgp.c (do_change_pin): Adjust for that.
562 * command.c (cmd_passwd): Add option --nullpin.
563 * app-nks.c (do_check_pin, do_change_pin): New.
564 (app_select_nks): Register new functions.
566 2008-04-21 Moritz Schulte <mo@g10code.com> (wk)
568 * app-openpgp.c (verify_a_chv): Make use of the default CHV flag.
570 2008-03-26 Werner Koch <wk@g10code.com>
572 * app-openpgp.c (verify_chv3): Support the keypad.
574 2008-02-09 Marcus Brinkmann <marcus@g10code.de>
576 * scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
577 in gpgconf-list output.
579 2007-12-10 Werner Koch <wk@g10code.com>
581 * app-openpgp.c (do_decipher): Take care of cryptograms shorter
582 that 128 bytes. Fixes bug#851.
584 2007-11-14 Werner Koch <wk@g10code.com>
586 * scdaemon.c (main): Pass STANDARD_SOCKET flag to
587 create_server_socket.
589 2007-11-13 Werner Koch <wk@g10code.com>
591 * scdaemon.c (start_connection_thread): Do not call
592 assuan_sock_check_nonce if we are running in --server mode.
594 2007-11-07 Werner Koch <wk@g10code.com>
596 * scdaemon.h: Remove errors.h.
598 2007-10-02 Werner Koch <wk@g10code.com>
600 * command.c (cmd_getinfo): Add "pid" subcommand.
602 2007-10-01 Werner Koch <wk@g10code.com>
604 * scdaemon.c (create_server_socket): Use Assuan socket wrappers
605 and remove Windows specific code.
607 (start_connection_thread): Check nonce.
609 2007-09-14 Marcus Brinkmann <marcus@g10code.de>
611 * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
612 W32 targets. Use it for create_socket_name.
614 2007-08-07 Werner Koch <wk@g10code.com>
616 * tlv.c, tlv.h: Move to ../common/.
618 2007-08-02 Werner Koch <wk@g10code.com>
620 * scdaemon.c: Include gc-opt-flags.h and remove their definition
623 2007-08-01 Werner Koch <wk@g10code.com>
625 * apdu.c (send_le): Implement exact length hack. Suggested by
628 2007-07-05 Werner Koch <wk@g10code.com>
630 * command.c (has_option_name, skip_options): New.
631 (cmd_genkey): Add option --timestamp.
632 (cmd_writekey): Enter confidential mode while inquiring the key data.
634 * app.c (app_genkey): Add arg CREATETIME.
635 * app-common.h (app_ctx_s): Likewise
636 * app-openpgp.c (do_genkey): Ditto. Use it.
639 2007-07-04 Werner Koch <wk@g10code.com>
641 * command.c (cmd_getinfo): New subcommand "version".
643 * scdaemon.c (TIMERTICK_INTERVAL): New.
644 (handle_connections) [W32]: Enable a dummy sigs event.
645 (handle_connections): Use a proper count for select and not
647 (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
649 2007-06-21 Werner Koch <wk@g10code.com>
651 * scdaemon.h (ctrl_t): Remove. It is now declared in ../common/util.h.
653 2007-06-18 Marcus Brinkmann <marcus@g10code.de>
655 * scdaemon.c (main): Percent escape output of --gpgconf-list.
657 2007-06-12 Werner Koch <wk@g10code.com>
659 * scdaemon.c (main): Replace some calls by init_common_subsystems.
661 2007-06-11 Werner Koch <wk@g10code.com>
663 * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
665 * command.c (initialize_module_command): New.
666 * scdaemon.c (main) [W32]: Do not use sigpipe code.
667 (main): Call initialize_module_command.
669 2007-06-06 Werner Koch <wk@g10code.com>
671 * app-openpgp.c (do_sign): Fix arithmetic on void*.
673 * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
675 * apdu.c: Remove dynload.h.
677 * scdaemon.c (i18n_init): Remove.
679 2007-04-20 Werner Koch <wk@g10code.com>
681 * sc-copykeys.c (my_gcry_logger): Removed.
682 (main): Call setup_libgcrypt_logging helper.
683 * scdaemon.c (my_gcry_logger): Removed.
684 (main): Call setup_libgcrypt_logging helper.
686 2007-04-03 Werner Koch <wk@g10code.com>
688 * command.c (cmd_getinfo): New subcommand "reader_list".
689 * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
690 for special transports.
692 2007-03-07 Werner Koch <wk@g10code.com>
694 * app-dinsig.c: Include i18n.h.
695 (verify_pin): Support PIN pads.
696 * app-nks.c (verify_pin): Ditto.
698 * ccid-driver.c (bulk_in): Handle time extension before checking
700 (ccid_transceive_secure): Support the Cherry XX44 keyboard.
701 Kudos to the nice folks at Cherry for helping with that.
703 2007-02-18 Werner Koch <wk@g10code.com>
705 * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
707 2007-01-25 Werner Koch <wk@g10code.com>
709 * Makefile.am (scdaemon_LDADD): Added LIBICONV. Noted by Billy
712 2006-12-21 Werner Koch <wk@g10code.com>
714 * app-openpgp.c (verify_chv2): Factored most code out into...
715 (verify_a_chv): ... new.
716 (do_sign): Factored verification code out to new function and
717 take care of a keypad entered PIN.
718 (compare_fingerprint): Print an additional diagnostic.
720 2006-11-28 Werner Koch <wk@g10code.com>
722 * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
723 allow for full 256 byte and the status word. This might break
724 some old PC/SC drivers or cards, but we will see. Suggested by
727 2006-11-23 Werner Koch <wk@g10code.com>
729 * command.c (scd_command_handler): Fixed use of CTRL.
731 2006-11-21 Werner Koch <wk@g10code.com>
733 * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
734 Renamed to gnupg-pcsc-wrapper.
735 * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
736 wrapper. Suggested by Eric Dorland.
738 2006-11-20 Werner Koch <wk@g10code.com>
740 * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
742 * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
745 2006-11-17 Werner Koch <wk@g10code.com>
747 * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
748 log_debug. Removed few other log_debug.
750 * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
752 * command.c (pin_cb): New mode to prompt for a keypad entry.
754 * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
756 2006-11-15 Werner Koch <wk@g10code.com>
758 * app-p15.c (read_ef_odf): Cast one printf arg.
760 * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
761 * command.c (scd_command_handler): Add new arg CTRL.
762 * scdaemon.c (scd_init_default_ctrl): Made static.
763 (scd_deinit_default_ctrl): New.
764 (start_connection_thread): Call init/deinit of ctrl.
765 (handle_connections): Allocate CTRL.
767 * apdu.c (PCSC_ERR_MASK): New.
768 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
769 (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
770 values. Reported by Henrik Nordstrom. Fixes bug #724.
772 2006-10-24 Werner Koch <wk@g10code.com>
774 * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
775 (MAX_DIGEST_LEN): Increased to 36.
776 * app-p15.c (do_sign): Support for TLS_MD5SHA1.
777 (do_auth): Detect TLS_MD5SHA1.
778 (do_sign): Tweaks for that digest.
780 2006-10-23 Werner Koch <wk@g10code.com>
782 * scdaemon.c (main): New command --gpgconf-test.
784 2006-10-17 Werner Koch <wk@g10code.com>
786 * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
788 2006-10-12 Werner Koch <wk@g10code.com>
790 * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
793 2006-10-11 Werner Koch <wk@g10code.com>
795 * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
797 2006-10-06 Werner Koch <wk@g10code.com>
799 * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
800 (scdaemon_LDADD): Ditto.
802 * scdaemon.h (send_status_info): Mark with sentinel attribute.
804 2006-10-02 Marcus Brinkmann <marcus@g10code.de>
806 * command.c (update_reader_status_file): Increase buffer of
807 NUMBUF2 (fixing typo).
809 2006-09-24 Marcus Brinkmann <marcus@g10code.de>
811 * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
814 2006-09-14 Werner Koch <wk@g10code.com>
816 Replaced all call gpg_error_from_errno(errno) by
817 gpg_error_from_syserror().
819 * command.c (scd_command_handler): Replaced
820 init_connected_socket_server by init_socket_server_ext.
822 2006-09-07 Werner Koch <wk@g10code.com>
824 * command.c (update_reader_status_file): Execute an event handler
827 2006-09-06 Werner Koch <wk@g10code.com>
829 * apdu.c (pcsc_end_transaction):
830 * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
831 Reported by Bob Dunlop.
833 * scdaemon.h (CTRL,APP): Removed and changed everywhere to
836 Replaced all Assuan error codes by libgpg-error codes. Removed
837 all map_to_assuan_status and map_assuan_err.
839 * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
840 switch to gpg-error codes.
841 * command.c (set_error): Adjusted.
843 2006-09-02 Marcus Brinkmann <marcus@g10code.de>
845 * command.c (get_reader_slot): Return the slot_table index, not
846 the APDU slot number.
847 (update_reader_status_file): Use the slot_table index in the
848 update_card_removed invocation.
850 2006-09-01 Marcus Brinkmann <marcus@g10code.de>
852 * command.c (cmd_getinfo): Handle status command.
854 2006-08-30 Marcus Brinkmann <marcus@g10code.de>
856 * command.c (do_reset): Delay resetting CTRL->reader_slot until
857 after update_card_removed invocation.
859 2006-08-28 Marcus Brinkmann <marcus@g10code.de>
861 * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
862 resp. "OPENPGP.1" for KEYIDSTR.
864 2006-08-21 Werner Koch <wk@g10code.com>
866 * pcsc-wrapper.c (handle_open, handle_close): Reset card and
867 protocol on error/close.
868 (handle_status): Don't set the state if the state is unknown.
869 (handle_reset): Ignore an error if already disconnected. May
870 happen due to system wake-up after hibernation. Suggested by Bob
873 2006-06-28 Werner Koch <wk@g10code.com>
875 * app-openpgp.c (do_writekey): Fixed computation of memmove
876 length. This led to garbled keys if E was larger than one byte.
877 Thanks to Achim Pietig for hinting at the garbled E.
879 2006-06-09 Marcus Brinkmann <marcus@g10code.de>
881 * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
883 2006-04-14 Marcus Brinkmann <marcus@g10code.de>
885 * app.c (select_application): Cover up a slot mismatch error in
886 case it happens (it shouldn't happen).
887 (release_application): Use APP->slot. Lock the reader.
888 (application_notify_card_removed): Lock the reader.
890 2006-04-11 Werner Koch <wk@g10code.com>
892 * command.c (hex_to_buffer): New.
895 2006-04-03 Werner Koch <wk@g10code.com>
897 * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
899 2006-03-21 Werner Koch <wk@g10code.com>
901 * command.c (cmd_pksign): Add --hash option.
903 2006-03-01 Werner Koch <wk@g10code.com>
905 * command.c (status_file_update_lock): New.
906 (scd_update_reader_status_file): Use lock and factor existing code
908 (update_reader_status_file): .. this.
909 (do_reset): Use the lock and call update_reader_status_file.
911 2006-02-20 Werner Koch <wk@g10code.com>
913 * apdu.c (open_pcsc_reader): Fixed double free. Thanks to Moritz.
915 2006-02-09 Werner Koch <wk@g10code.com>
917 * command.c (get_reader_slot, do_reset)
918 (scd_update_reader_status_file): Rewrote.
920 * app.c (release_application): Factored code out to ..
921 (deallocate_app): new function.
922 (select_application): Introduce new saved application stuff.
923 (application_notify_card_removed): New.
924 * command.c (update_card_removed): Call it here.
925 (do_reset): And here.
927 * app.c (check_application_conflict): New.
928 * command.c (open_card): Use it here.
929 (cmd_restart): New command.
931 * command.c (cmd_lock): Fixed --wait option to actually terminate.
933 2006-02-08 Werner Koch <wk@g10code.com>
935 * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
936 using these parameters.
937 (scan_or_find_devices): Check for NULL r_fd.
939 2006-02-02 Werner Koch <wk@g10code.com>
941 * ccid-driver.c (special_transport): New
942 (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
943 (bulk_out, bulk_in): Add support for CardMan 4040 reader.
945 * ccid-driver.c (scan_or_find_devices): Factored most code out to
946 (scan_or_find_usb_device): .. new.
947 (make_reader_id): Fixed vendor mask.
949 2006-01-01 Werner Koch <wk@g10code.com>
951 * app-openpgp.c (do_sign): Give user error if hash algorithm is
952 not supported by the card.
954 2005-12-06 Werner Koch <wk@g10code.com>
956 * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
959 2005-11-23 Werner Koch <wk@g10code.com>
961 * app-nks.c (verify_pin): Give a special error message for a Nullpin.
963 2005-10-29 Werner Koch <wk@g10code.com>
965 * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
966 RESULTMAX. Changed all callers.
967 (ccid_transceive_escape): New.
969 2005-10-27 Werner Koch <wk@g10code.com>
971 * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
972 Suggested by John P. Clizbe.
973 * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
975 2005-10-19 Werner Koch <wk@g10code.com>
977 * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
978 * apdu.h (SW_HOST_NO_KEYPAD): New.
979 * iso7816.h (struct iso7816_pininfo_s): New.
980 * iso7816.c (map_sw): Support new code.
981 (iso7816_check_keypad): New.
982 (iso7816_verify_kp, iso7816_change_reference_data_kp)
983 (iso7816_reset_retry_counter_kp): New. Extended versions of the
985 * apdu.c (host_sw_string): Support new code.
986 (reader_table_s): New field CHECK_KEYPAD.
987 (new_reader_slot, open_ct_reader, open_pcsc_reader)
988 (open_ccid_reader, open_rapdu_reader): Initialize it.
989 (check_ccid_keypad): New.
990 (apdu_check_keypad): New.
991 (apdu_send_le): Factored all code out to ...
992 (send_le): .. new. Takes an additional arg; changed all callers
993 of the orginal function to use this one with a NULL for the new
995 (apdu_send_simple_kp): New.
996 (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu)
997 (send_apdu_ccid): New arg PININFO.
998 (send_apdu_ccid): Use the new arg.
1000 * scdaemon.c: New option --disable-keypad.
1002 2005-10-08 Marcus Brinkmann <marcus@g10code.de>
1004 * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
1005 ../common/libcommon.a.
1007 2005-09-20 Werner Koch <wk@g10code.com>
1009 * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
1011 * iso7816.c (iso7816_select_application): Add arg FLAGS. Changed
1012 all callers to pass 0.
1013 * app-openpgp.c (app_select_openpgp): But this one requires a
1016 * app-p15.c (app_select_p15): Don't use select application for the
1019 2005-09-09 Werner Koch <wk@g10code.com>
1021 * pcsc-wrapper.c (main): Removed bogus free.
1023 * app-p15.c (do_auth): New.
1024 (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
1025 * app-openpgp.c (do_getattr): Ditto.
1027 2005-09-08 Werner Koch <wk@g10code.com>
1029 * app-openpgp.c (do_getattr): New key $AUTHKEYID.
1031 2005-09-06 Werner Koch <wk@g10code.com>
1033 * app-p15.c (do_sign): Tweaked for BELPIC cards.
1034 (read_home_df): New arg R_BELPIC.
1035 (app_select_p15): Set card type for BELPIC.
1037 2005-09-05 Werner Koch <wk@g10code.com>
1039 * iso7816.c (iso7816_select_path): New.
1040 * app-p15.c (select_ef_by_path): Allow for direct path selection.
1041 (app_select_p15): Try using the Belgian variant of pkcs#15.
1042 (read_home_df): New.
1043 (read_ef_odf): Generalized.
1044 (read_ef_tokeninfo): New.
1045 (read_p15_info): Set serialnumber from TokenInfo.
1046 (app_select_p15): Don't munge serialNumber - that must be done
1049 * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
1050 data. Handle 6C00 error and take 6B00 as indication for EOF.
1051 * apdu.h (SW_EXACT_LENGTH_P): New.
1052 * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status)
1053 (open_pcsc_reader): Set new reader state IS_T0.
1054 (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
1055 Problem reported by Carl Meijer.
1056 (apdu_send_direct): Initialize RESULTLEN.
1057 * pcsc-wrapper.c (handle_status): Return the current protocol as
1060 2005-08-05 Werner Koch <wk@g10code.com>
1062 * apdu.c (open_rapdu_reader): Set the reader number.
1064 2005-07-05 Werner Koch <wk@g10code.com>
1066 * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
1067 required by the description. Thanks to Moritz for tracking this
1070 2005-06-21 Werner Koch <wk@g10code.com>
1072 * scdaemon.c (main): ifdef call to ccid_set_debug_level.
1074 * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
1077 2005-06-06 Werner Koch <wk@g10code.com>
1079 * scdaemon.c (main): New option --debug-allow-core-dump.
1081 2005-06-03 Werner Koch <wk@g10code.com>
1083 * scdaemon.c (handle_connections): Make sure that the signals we
1084 are handling are not blocked.Block signals while creating new
1086 (handle_connections): Include the file descriptor into the name of
1089 2005-06-02 Werner Koch <wk@g10code.com>
1091 * app.c (app_dump_state, dump_mutex_state): New.
1092 * scdaemon.c (handle_signal): Print it on SIGUSR1.
1094 * app-openpgp.c (do_writekey): Typo fix.
1096 * command.c (open_card): Check for locked state even if an
1097 application context is available.
1099 * app-common.h: Add REF_COUNT field.
1100 * app.c (release_application, select_application): Implement
1101 reference counting to share the context beween connections.
1103 * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
1104 argument. Changed all callers.
1105 (select_application): Unlock the reader on error. This should fix
1106 the hangs I noticed last week.
1108 * scdaemon.h: Removed card_ctx_t cruft.
1110 2005-06-01 Werner Koch <wk@g10code.com>
1112 * scdaemon.c: Include mkdtemp.h.
1114 2005-05-31 Werner Koch <wk@g10code.com>
1116 * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
1117 including a gnupg 1.4 header.
1119 2005-05-30 Werner Koch <wk@g10code.com>
1121 * tlv.c: Add hack to compile without gpg-error.h when used with
1124 2005-05-23 Werner Koch <wk@g10code.com>
1126 * Makefile.am: Do not build sc-copykeys anymore.
1128 * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
1129 (app_openpgp_cardinfo): Removed.
1131 * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
1133 (do_close_reader): Never do a reset. The caller should instead
1134 make sure that the reader has been closed properly. The new retry
1135 code in ccid_slot_status will make sure that the readersatrts up
1136 fine even if the last process didn't closed the USB connection
1138 (ccid_get_atr): For certain readers try switching to ISO mode.
1139 Thanks to Ludovic Rousseau for this hint and the magic numbers.
1140 (print_command_failed): New.
1141 (bulk_in): Use it here. Add new arg NO_DEBUG.
1142 (ccid_slot_status): Disabled debugging.
1144 2005-05-21 Werner Koch <wk@g10code.com>
1146 * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
1148 2005-05-20 Werner Koch <wk@g10code.com>
1150 * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
1151 (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
1152 (ccid_transceive): Arghhh. The seqno is another bit in the
1153 R-block than in the I block, this was wrong at one place.
1155 * scdaemon.c: New options --debug-ccid-driver and
1156 --debug-disable-ticker.
1158 * app-openpgp.c (do_genkey, do_writekey): Factored code to check
1159 for existing key out into ..
1160 (does_key_exist): .. New function.
1162 2005-05-19 Werner Koch <wk@g10code.com>
1164 * tlv.c (parse_sexp): New.
1166 * command.c (cmd_writekey): New.
1167 * app.c (app_writekey): New.
1168 * app-common.c (app_t): Add function ptr WRITEKEY.
1169 * app-openpgp.c (do_writekey): New.
1171 * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
1172 * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
1173 store the Assuan context.
1175 2005-05-17 Werner Koch <wk@g10code.com>
1177 * scdaemon.c: Removed non-pth code paths.
1178 (create_socket_name, create_server_socket): New. Taken from
1180 (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
1181 (ticker_thread): Always use pth_event_occurred; it is again
1182 defined for all decent PTH versions.
1183 (handle_connections): New. Based on the gpg-agent code.
1184 (start_connection_thread): Ditto.
1185 (ticker_thread): Removed.
1186 (cleanup_sh): Removed.
1187 (main): Run the handler for the pipe server in a separate
1188 thread. This replaces the old ticker thread.
1189 (scd_get_socket_name): New.
1190 * command.c (cmd_getinfo): New command GETINFO.
1191 (scd_command_handler): Renamed argument and changed code to use an
1192 already connected FD.
1194 2005-05-15 Werner Koch <wk@g10code.com>
1196 * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
1197 * app-openpgp.c: Change most function return types from int to
1199 * command.c (pin_cb): Ditto.
1200 * sc-copykeys.c (pincb): Ditto.
1202 * app.c (lock_reader, unlock_reader): New. Changed call handler
1203 wrappers to make use of these functions.
1205 2005-05-07 Werner Koch <wk@g10code.com>
1207 * ccid-driver.c (do_close_reader): Don't do a reset before close.
1208 Some folks reported that it makes the SCR335 hang less often.
1209 Look at the source on how to re-enable it.
1211 2005-04-27 Werner Koch <wk@g10code.com>
1213 * app-p15.c (micardo_mse): New.
1215 * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
1216 NULL to indicate an empty Lc.
1217 * tlv.c (find_tlv): Check that a found object fits into the
1219 (find_tlv_unchecked): New as replacement for the old non-checking
1221 * app.c (select_application): Keep on using the non-checking
1223 * app-openpgp.c (get_one_do, dump_all_do): Ditto.
1226 Removal of the old OpenSC based code.
1228 * app-p15.c: New. Basic support for pkcs15 cards without OpenSC.
1229 There are quite a couple of things missing but at least I can use
1230 my old TCOS cards from the Aegypten-1 development for signing.
1231 * app.c (select_application): Detect pkcs15 applications.
1232 * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
1233 and card-p15.c because they are now obsolete. Added app-p15.c.
1234 Removed all OpenSC stuff.
1235 * command.c (do_reset, open_card, cmd_serialno, cmd_learn)
1236 (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
1237 all special cases for the old card.c based mechanisms.
1238 * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
1240 2005-04-20 Werner Koch <wk@g10code.com>
1242 * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
1244 2005-04-14 Werner Koch <wk@g10code.com>
1246 * app-openpgp.c (retrieve_key_material): Rewritten. Return a
1248 (retrieve_next_token): Removed.
1249 (retrieve_fpr_from_card): Rewritten to make use of DO caching and
1250 to take the KEYNO as arg.
1251 (get_public_key): Renamed variable for clarity.
1253 2005-04-12 Werner Koch <wk@g10code.com>
1255 Basic support for several sessions.
1257 * command.c (scd_command_handler): Replace the primary_connection
1258 stuff by a real connection list. Release the local context on
1260 (scd_update_reader_status_file): Update accordingly. Send signal
1261 to all connections who registered an event signal.
1262 (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
1264 (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr)
1265 (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
1267 (do_reset): Handle locking.
1268 (open_card): Ditto. Share the reader slot with other sessions.
1269 (get_reader_slot): New.
1270 (update_card_removed): New. Use it in the TEST_CARD_REMOVAL macro.
1272 2005-04-07 Werner Koch <wk@g10code.com>
1274 * app-openpgp.c (do_check_pin): Add hack to allow verification of
1276 (get_public_key): Don't use gcry functions to create S-expressions.
1277 (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
1280 2005-03-29 Moritz Schulte <moritz@g10code.com>
1282 * app-openpgp.c (retrieve_fpr_from_card): New function.
1283 (retrieve_next_token): New function.
1284 (retrieve_key_material): New function.
1285 (get_public_key): Implement retrival of key through expernal
1286 helper (gpg) in case the openpgp card is not cooperative enough.
1288 2005-03-16 Werner Koch <wk@g10code.com>
1290 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1291 reader type specific.
1292 (scan_or_find_devices): Do not check the interface subclass in the
1293 SPR532 kludge, as this depends on the firmware version.
1294 (ccid_get_atr): Get the Slot status first. This solves the
1295 problem with readers hanging on recent Linux 2.6.x.
1296 (bulk_in): Add argument TIMEOUT and changed all callers to pass an
1297 appropriate one. Change the standard timeout from 10 to 5 seconds.
1298 (ccid_slot_status): Add a retry code with an initial short timeout.
1299 (do_close_reader): Do an usb_reset before closing the reader.
1301 2005-02-25 Werner Koch <wk@g10code.com>
1303 * app-openpgp.c (get_public_key): Make sure not to return negative
1305 (do_sign): Allow passing of indata with algorithm prefix.
1306 (do_auth): Allow OPENPGP.3 as an alternative ID.
1308 * app.c (app_getattr): Return just the S/N but not the timestamp.
1310 2005-02-24 Werner Koch <wk@g10code.com>
1312 * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
1313 application does dot support the getattr call.
1315 * app-openpgp.c (get_one_do): Never try to get a non cacheable
1316 object from the cache.
1317 (get_one_do): Add new arg to return an error code. Changed all
1319 (do_getattr): Let it return a proper error code.
1321 * app.c (select_application): Return an error code and the
1322 application context in an new arg.
1323 * command.c (open_card): Adjusted for that. Don't use the
1324 fallback if no card is present. Return an error if the card has
1325 been removed without a reset.
1326 (do_reset, cmd_serialno): Clear that error flag.
1327 (TEST_CARD_REMOVAL): New. Use it with all command handlers.
1328 (scd_update_reader_status_file): Set the error flag on all changes.
1330 * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
1332 * apdu.c: Added some PCSC error codes.
1333 (pcsc_error_to_sw): New.
1334 (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
1335 (open_pcsc_reader): Do proper error code mapping.
1337 2005-03-16 Werner Koch <wk@g10code.com>
1339 * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1340 reader type specific.
1341 (scan_or_find_devices): Do not check the interface subclass in the
1342 SPR532 kludge, as this depends on the firmware version.
1343 (ccid_get_atr): Get the Slot status first. This solves the
1344 problem with readers hanging on recent Linux 2.6.x.
1346 2005-02-22 Werner Koch <wk@g10code.com>
1348 * app-openpgp.c (app_local_s): New field PK.
1349 (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
1350 (get_public_key, send_keypair_info): New.
1351 (do_learn_status): Send KEYPAIR info
1353 * app-common.h (app_ctx_t): Add function pointer READKEY.
1354 * app.c (app_readkey): New.
1355 * command.c (cmd_readkey): Use READKEY function if possible.
1357 2005-01-26 Werner Koch <wk@g10code.com>
1359 * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
1360 also for newer firmware versions. Need to get a list of fixed
1361 firmware versions and use that.
1363 2005-01-25 Werner Koch <wk@g10code.com>
1365 * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
1368 * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
1369 the cache. Changed all callers.
1370 (get_one_do): Bypass the cache if the value would have been read
1371 directly for v1.1 cards.It makes things a bit slower but obnly for
1372 1.0 cards and there are not that many cards out in the wild. This
1373 is required to fix a caching bug when generating new keys; as a
1374 side effect of the retrieval of the the C4 DO from the 6E DO the
1375 cached fingerprint will get updated to the old value and later
1376 when signing the generated key the checking of the fingerprint
1377 fails because it won't match the new one. Thanks to Moritz for
1378 analyzing this problem.
1379 (verify_chv3): Removed the CHV status reread logic because we
1380 won't cache the C4 DO anymore.
1382 2004-12-28 Werner Koch <wk@g10code.com>
1384 * ccid-driver.c (find_endpoint): New.
1385 (scan_or_find_devices): Add new args to return endpoint info and
1387 (ccid_open_reader, ccid_shutdown_reader): Take care of these new
1389 (bulk_in, bulk_out): Use the correct endpoints.
1390 (ccid_transceive_apdu_level): New.
1391 (ccid_transceive): Divert to above.
1392 (parse_ccid_descriptor): Allow APDU level exchange mode.
1393 (do_close_reader): Pass the interface number to usb_release_interface.
1395 2004-12-21 Werner Koch <wk@g10code.com>
1397 * scdaemon.c (main): Use default_homedir().
1399 2004-12-18 Werner Koch <wk@g10code.com>
1401 * scdaemon.c (main) [W32]: Remove special Pth initialize..
1403 * scdaemon.h (map_assuan_err): Define in terms of
1404 map_assuan_err_with_source.
1406 2004-12-15 Werner Koch <wk@g10code.com>
1408 * scdaemon.c [W32]: Various hacks to make it run under W32.
1410 * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
1412 * apdu.c [W32]: Disable use of pcsc_wrapper.
1414 * Makefile.am (scdaemon_LDADD): Reorder libs.
1415 (sc_copykeys_LDADD): Add libassuan because it is needed for W32.
1417 2004-12-06 Werner Koch <wk@g10code.com>
1419 * Makefile.am (pkglib_PROGRAMS): Build only for W32.
1421 2004-10-22 Werner Koch <wk@g10code.com>
1423 * app-openpgp.c (verify_chv3): The minium length for CHV3 is
1424 8. Changed string to match the other ones.
1426 2004-10-21 Werner Koch <wk@g10code.com>
1428 * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
1429 This avoids problems with missing vasprintf implementations in
1432 * app-common.h (app_openpgp_storekey: Add prototype.
1434 2004-10-20 Werner Koch <wk@g10code.com>
1436 * sc-investigate: Removed.
1437 * Makefile.am (sc_investigate): Removed.
1439 * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
1440 (handle_open): Succeed even without a present card.
1441 (handle_status, handle_reset): New.
1443 * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
1444 (pcsc_get_status): Implemented.
1445 (reset_pcsc_reader): Implemented.
1446 (open_pcsc_reader): Succeed even with no card inserted.
1447 (open_ccid_reader): Set LAST_STATUS.
1449 * iso7816.c (iso7816_select_application): Always use 0 for P1.
1451 2004-10-18 Werner Koch <wk@g10code.com>
1453 * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
1455 2004-10-14 Werner Koch <wk@g10code.com>
1457 * app-openpgp.c (parse_login_data): New.
1458 (app_select_openpgp): Call it.
1459 (do_setattr): Reparse it after change.
1461 2004-10-06 Werner Koch <wk@g10code.de>
1463 * ccid-driver.c (ccid_open_reader): Store the vendor ID.
1464 (ccid_transceive_secure): New.
1465 (parse_ccid_descriptor): Workaround for an SCM reader problem.
1467 2004-10-04 Werner Koch <wk@g10code.de>
1469 * ccid-driver.c (send_escape_cmd): New.
1471 2004-09-30 Werner Koch <wk@g10code.com>
1473 * Makefile.am: Adjusted for gettext 0.14.
1475 * app-openpgp.c (do_sign): Add the error string to the verify
1478 2004-09-27 Werner Koch <wk@g10code.com>
1482 * app-openpgp.c: Made all strings translatable.
1483 (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
1484 available for use in gnupg 2.
1485 (verify_chv3): Reimplemented countdown showing to use only
1486 functions from this module. Flush the CVH status cache on a
1488 (get_one_do): Hack to bypass the cache for cards versions > 1.0.
1489 (store_fpr): Store the creation date for card version > 1.0.
1491 * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
1492 (get_cached_data): Move local data initialization to ..
1493 (app_select_openpgp): .. here. Read some flags for later use.
1494 (do_getattr): New read-only attribute EXTCAP.
1496 * apdu.c (open_pcsc_reader): Do not print empty reader string.
1498 * ccid-driver.c (do_close_reader): Factored some code out from ...
1499 (ccid_close_reader): ..here.
1500 (ccid_shutdown_reader): New.
1502 * apdu.c (apdu_shutdown_reader): New.
1503 (shutdown_ccid_reader): New.
1505 * apdu.c (open_ccid_reader): New arg PORTSTR. Pass it to
1507 (apdu_open_reader): Pass portstr to open_ccid_reader.
1508 (apdu_open_reader): No fallback if a full CCID reader id has been
1511 * ccid-driver.c (ccid_get_reader_list): New.
1512 (ccid_open_reader): Changed API to take a string for the reader.
1513 Removed al the cruft for the libusb development vesion which seems
1514 not to be maintained anymore and there are no packages anyway.
1515 The stable library works just fine.
1516 (struct ccid_reader_id_s): Deleted and replaced everywhere by a
1518 (usb_get_string_simple): Removed.
1519 (bulk_in): Do valgrind hack here and not just everywhere.
1521 * ccid-driver.c (read_device_info): Removed.
1522 (make_reader_id, scan_or_find_devices): New.
1523 (ccid_open_reader): Simplified by make use of the new functions.
1524 (ccid_set_debug_level): New. Changed the macros to make use of
1525 it. It has turned out that it is often useful to enable debugging
1526 at runtime so I added this option.
1528 From gnupg 1.3 - David Shaw <dshaw@jabberwocky.com>
1530 * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
1531 admin PINs can be entered before the card is locked.
1533 * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
1534 breaks us when using --enable-m-guard.
1536 * ccid-driver.c (usb_get_string_simple): Replacement function to
1537 work with older libusb.
1539 * ccid-driver.c (read_device_info): Fix segfault when usb device
1541 (ccid_open_reader): Allow working with an even older version of
1542 libusb (usb_busses global instead of usb_get_busses()).
1544 2004-09-11 Werner Koch <wk@g10code.com>
1546 * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
1547 not app_number_serialno.
1549 2004-08-20 Werner Koch <wk@g10code.de>
1551 * app.c (select_application): Fixed serial number extraction and
1552 added the BMI card workaround.
1553 (app_munge_serialno): New.
1554 * app-openpgp.c (app_select_openpgp): Try munging serialno.
1556 2004-08-05 Werner Koch <wk@g10code.de>
1558 * scdaemon.c (main): New option --disable-application.
1559 * app.c (is_app_allowed): New.
1560 (select_application): Use it to check for disabled applications.
1562 * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
1563 * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
1565 (ccid_get_atr): Handle short messages.
1567 * apdu.c (my_rapdu_get_status): Implemented.
1569 2004-07-27 Moritz Schulte <moritz@g10code.com>
1571 * apdu.c: Include <signal.h>.
1573 * Makefile.am: Use @DL_LIBS@ instead of -ldl.
1575 2004-07-22 Werner Koch <wk@g10code.de>
1577 * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1579 * apdu.c: Don't use Pth if we use OpenSC.
1580 * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.
1582 * scdaemon.c (main): Bumbed thread stack size up to 512k.
1584 2004-07-16 Werner Koch <wk@gnupg.org>
1586 * apdu.c (reader_table_s): Add function pointers for the backends.
1587 (apdu_close_reader, apdu_get_status, apdu_activate)
1588 (send_apdu): Make use of them.
1589 (new_reader_slot): Intialize them to NULL.
1590 (dump_ccid_reader_status, ct_dump_reader_status): New.
1591 (dump_pcsc_reader_status): New.
1592 (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1593 (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1594 (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu)
1595 (error_string): Removed. Replaced by apdu_strerror.
1596 (get_ccid_error_string): Removed.
1597 (ct_activate_card): Remove the unused loop.
1598 (reset_ct_reader): Implemented.
1599 (ct_send_apdu): Activate the card if not yet done.
1600 (pcsc_send_apdu): Ditto.
1602 2004-07-15 Werner Koch <wk@gnupg.org>
1604 * ccid-driver.h: Add error codes.
1605 * ccid-driver.c: Implement more or less proper error codes all
1608 * apdu.c (apdu_send_direct): New.
1609 (get_ccid_error_string): Add some error code mappings.
1610 (send_apdu): Pass error codes along for drivers already supporting
1612 (host_sw_string): New.
1613 (get_ccid_error_string): Use above.
1614 (send_apdu_ccid): Reset the reader if it has not yet been done.
1615 (open_ccid_reader): Don't care if the ATR can't be read.
1616 (apdu_activate_card): New.
1617 (apdu_strerror): New.
1618 (dump_reader_status): Only enable it with opt.VERBOSE.
1619 * iso7816.c (map_sw): Add mappings for the new error codes.
1621 2004-07-02 Werner Koch <wk@gnupg.org>
1623 * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1624 (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1627 2004-07-01 Werner Koch <wk@gnupg.org>
1629 * sc-investigate.c: Initialize Pth which is now required.
1630 (interactive_shell): New command "readpk".
1632 * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1634 2004-06-30 Werner Koch <wk@gnupg.org>
1636 * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1639 2004-06-18 Werner Koch <wk@g10code.com>
1641 * sc-investigate.c (my_read_line): Renamed from read_line.
1643 2004-06-16 Werner Koch <wk@gnupg.org>
1645 * apdu.c (osc_get_status): Fixed type in function name. Noted by
1646 Axel Thimm. Yes, I didn't tested it with OpenSC :-(.
1648 2004-04-28 Werner Koch <wk@gnupg.org>
1650 * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1652 2004-04-27 Werner Koch <wk@gnupg.org>
1654 * app-common.h: Do not include ksba.h for gnupg 1.
1656 2004-04-26 Werner Koch <wk@gnupg.org>
1658 * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1659 * app.c (release_application): Call new deconstructor.
1660 * app-openpgp.c (do_deinit): New.
1661 (get_cached_data, flush_cache_item, flush_cache_after_error)
1663 (get_one_do): Replaced arg SLOT by APP. Make used of cached data.
1664 (verify_chv2, verify_chv3): Flush some cache item after error.
1665 (do_change_pin): Ditto.
1667 (do_setattr): Flush cache item.
1668 (do_genkey): Flush the entire cache.
1669 (compare_fingerprint): Use cached data.
1671 * scdaemon.c (main): Do the last change the usual way. This is so
1672 that we can easily test for versioned config files above.
1674 2004-04-26 Marcus Brinkmann <marcus@g10code.de>
1676 * scdaemon.c (main): For now, always print default filename for
1677 --gpgconf-list, and never /dev/null.
1679 2004-04-21 Werner Koch <wk@gnupg.org>
1681 * command.c (scd_update_reader_status_file): Send a signal back to
1683 (option_handler): Parse the new event-signal option.
1685 * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1686 changing the verbosity.
1688 2004-04-20 Werner Koch <wk@gnupg.org>
1690 * command.c (scd_update_reader_status_file): Write status files.
1692 * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1695 * pcsc-wrapper.c: New.
1696 * Makefile.am (pkglib_PROGRAMS): Install it here.
1697 * apdu.c (writen, readn): New.
1698 (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1699 pcsc-wrapper if we are using Pth.
1700 (apdu_send_le): Reinitialize RESULTLEN. Handle SW_EOF_REACHED
1703 2004-04-19 Werner Koch <wk@gnupg.org>
1705 * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1706 features away. New arg HANDLE
1707 (read_device_info): New arg HANDLE. Changed caller.
1708 (bulk_in): Handle time extension requests.
1709 (ccid_get_atr): Setup parameters and the IFSD.
1710 (compute_edc): New. Factored out code.
1711 (ccid_transceive): Use default NADs when required.
1713 2004-04-14 Werner Koch <wk@gnupg.org>
1715 * scdaemon.h (server_control_s): Add member READER_SLOT.
1716 * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
1717 * command.c (open_card): Reuse an open slot.
1718 (reset_notify): Just reset the slot if supported by the reader.
1719 (do_reset): Factored code from above out.
1720 (scd_command_handler): Use it for cleanup.
1722 * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
1723 SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
1724 * iso7816.c (map_sw): Map it.
1726 * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
1727 * apdu.c (apdu_get_status): New.
1728 (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
1729 (get_status_ccid): New.
1731 (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
1732 (reset_ccid_reader): New.
1733 (apdu_enum_reader): New.
1735 * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
1736 (new_reader_slot) [USE_GNU_PTH]: Init mutex.
1737 (apdu_reset, apdu_get_status, apdu_send_le): Run functions
1740 * command.c (scd_update_reader_status_file): New.
1741 * scdaemon.c (handle_tick): Call it.
1743 2004-04-13 Werner Koch <wk@gnupg.org>
1745 * scdaemon.c: Convert to a Pth application.
1746 (handle_signal, ticker_thread, handle_tick): New.
1747 (main): Fire up the ticker thread in server mode.
1749 2004-03-23 Werner Koch <wk@gnupg.org>
1751 * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
1753 2004-03-17 Werner Koch <wk@gnupg.org>
1755 * tlv.c (parse_ber_header): Do not check for tag overflow - it
1756 does not make sense. Simplified the check for length overflow.
1758 * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
1760 2004-03-16 Werner Koch <wk@gnupg.org>
1762 * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
1763 * app-nks.c (get_length_of_cert): Removed.
1765 (app_help_read_length_of_cert): New. Code taken from above. New
1766 optional arg R_CERTOFF.
1768 * card-dinsig.c: Removed.
1769 * card.c (card_get_serial_and_stamp): Do not bind to the old and
1770 never finsiged card-dinsig.c.
1772 * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
1774 2004-03-11 Werner Koch <wk@gnupg.org>
1776 * scdaemon.h (out_of_core): Removed. Replaced callers by standard
1779 * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
1780 to include a header defined by the compiler. This helps us to
1781 reuse the source in other software.
1783 2004-03-10 Werner Koch <wk@gnupg.org>
1785 * iso7816.c (iso7816_read_record): New arg SHORT_EF. Changed all
1788 2004-02-18 Werner Koch <wk@gnupg.org>
1790 * sc-investigate.c (main): Setup the used character set.
1791 * scdaemon.c (main): Ditto.
1793 * scdaemon.c (set_debug): New. Add option --debug-level.
1794 (main): Add option --gpgconf-list.
1796 2004-02-12 Werner Koch <wk@gnupg.org>
1798 * Makefile.am: Include cmacros.am for common flags.
1800 2004-01-29 Werner Koch <wk@gnupg.org>
1802 * command.c (reset_notify): Release the application context and
1805 2004-01-28 Werner Koch <wk@gnupg.org>
1807 * iso7816.c (iso7816_manage_security_env): New.
1808 (iso7816_decipher): Add PADIND argument.
1810 2004-01-27 Werner Koch <wk@gnupg.org>
1812 * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
1814 * app-common.h (app_ctx_s): Added readcert field.
1815 * app.c (app_readcert): New.
1816 * tlv.c (parse_ber_header): Added; taken from libksba.
1818 2004-01-26 Werner Koch <wk@gnupg.org>
1820 * card.c (map_sc_err): Use SCD as the error source.
1822 * command.c (open_card): ADD arg NAME to allow requesting a
1823 specific application. Changed all callers.
1824 (cmd_serialno): Allow optional argument to select the desired
1829 * scdaemon.h (opt): Add READER_PORT.
1830 * scdaemon.c (main): Set it here.
1831 * app.c (app_set_default_reader_port): Removed.
1832 (select_application): Add NAME arg and figure out a
1833 default serial number from the GDO. Add SLOT arg and remove all
1835 (release_application): New.
1836 (app_write_learn_status): Output an APPTYPE status line.
1837 * command.c (open_card): Adapt for select_application change.
1838 * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
1839 and set it directly. Changed all callers.
1841 2004-01-25 Werner Koch <wk@gnupg.org>
1843 * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
1845 * app-openpgp.c (find_tlv): Factor out this function to ..
1846 * tlv.c, tlv.h: .. new.
1848 * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
1851 2004-01-21 Werner Koch <wk@gnupg.org>
1853 * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
1855 2004-01-20 Werner Koch <wk@gnupg.org>
1857 * iso7816.c (iso7816_read_binary): New.
1858 (iso7816_select_file): New.
1859 (iso7816_list_directory): New.
1861 * sc-investigate.c: Add option -i.
1862 (select_app, read_line, interactive_shell): New.
1864 2004-01-16 Werner Koch <wk@gnupg.org>
1866 * apdu.h: Add SW_FILE_NOT_FOUND.
1867 * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
1868 * iso7816.c (iso7816_select_file): New.
1870 * app-dinsig.c: New file w/o any real code yet.
1871 * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
1873 * sc-investigate.c: Add option --disable-ccid.
1875 2003-12-19 Werner Koch <wk@gnupg.org>
1877 * apdu.c (apdu_send_le): Send a get_response with the indicated
1878 length and not the 64 bytes we used for testing.
1880 * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
1881 minimum length of the passphrase, so that we don't need to
1882 decrement the retry counter.
1884 2003-12-17 Werner Koch <wk@gnupg.org>
1886 * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
1887 * card-dinsig.c (dinsig_enum_keypairs): Ditto.
1889 2003-12-16 Werner Koch <wk@gnupg.org>
1891 * scdaemon.c (main): Set the prefixes for assuan logging.
1893 2003-11-17 Werner Koch <wk@gnupg.org>
1895 * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
1896 * app-openpgp.c (verify_chv3): Check it here.
1898 2003-11-12 Werner Koch <wk@gnupg.org>
1900 Adjusted for API changes in Libksba.
1902 2003-10-30 Werner Koch <wk@gnupg.org>
1904 * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
1905 (get_ccid_error_string): New. Not very useful messages, though.
1907 2003-10-25 Werner Koch <wk@gnupg.org>
1909 * ccid-driver.c (ccid_open_reader): Return an error if no USB
1912 * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
1915 * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
1917 2003-10-20 Werner Koch <wk@gnupg.org>
1919 * command.c (cmd_checkpin): New.
1920 (register_commands): Add command CHECKPIN.
1921 * app.c (app_check_pin): New.
1922 * app-openpgp.c (check_against_given_fingerprint): New. Factored
1923 out that code elsewhere.
1924 (do_check_pin): New.
1926 2003-10-10 Werner Koch <wk@gnupg.org>
1928 * ccid-driver.c (ccid_close_reader): New.
1930 * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
1931 (close_osc_reader, apdu_close_reader): New. Not all are properly
1934 2003-10-09 Werner Koch <wk@gnupg.org>
1936 * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
1938 2003-10-08 Werner Koch <wk@gnupg.org>
1940 * app-openpgp.c (do_getattr): Support SERIALNO and AID.
1942 2003-10-01 Werner Koch <wk@gnupg.org>
1944 * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
1946 * app-openpgp.c: Ditto.
1948 (generate_keypair): Renamed to ..
1949 (do_generate_keypair): .. this.
1950 * app-common.h [GNUPG_MAJOR_VERSION]: New.
1951 * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
1953 2003-09-30 Werner Koch <wk@gnupg.org>
1955 * command.c (cmd_getattr): New command GETATTR.
1956 * app.c (app_setattr): New.
1958 (do_learn_status): Reimplemented in terms of do_getattr.
1960 * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
1962 (verify_chv2, verify_chv3): New. Factored out common code.
1963 (do_setattr, do_sign, do_auth, do_decipher): Change the names of
1964 the prompts to match that we have only 2 different PINs.
1965 (app_select_openpgp): Check whether the card enforced CHV1.
1966 (convert_sig_counter_value): New. Factor out code from
1969 2003-09-28 Werner Koch <wk@gnupg.org>
1971 * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
1973 2003-09-19 Werner Koch <wk@gnupg.org>
1975 * ccid-driver.c (parse_ccid_descriptor): New.
1976 (read_device_info): New.
1977 (ccid_open_reader): Check that the device has all required features.
1979 2003-09-06 Werner Koch <wk@gnupg.org>
1981 * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
1982 David Corcoran was so kind to remove the GPL incompatible
1983 advertisng clause from pcsclite.
1984 * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
1986 2003-09-05 Werner Koch <wk@gnupg.org>
1988 * ccid-driver.c: More work, data can now actually be retrieved.
1989 * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
1992 2003-09-02 Werner Koch <wk@gnupg.org>
1994 * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
1995 * ccid-driver.c, ccid-driver.h: New but far from being useful.
1996 * Makefile.am: Add above.
1997 * apdu.c: Add support for that ccid driver.
1999 2003-08-26 Timo Schulz <twoaday@freakmail.de>
2001 * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
2004 2003-08-25 Werner Koch <wk@gnupg.org>
2006 * command.c (cmd_setattr): Use a copy of LINE.
2007 (cmd_genkey): Use a copy of KEYNO.
2008 (cmd_passwd): Use a copy of CHVNOSTR.
2009 (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
2011 2003-08-19 Werner Koch <wk@gnupg.org>
2013 * scdaemon.c, scdaemon.h: New option --pcsc-driver.
2014 * apdu.c (apdu_open_reader): Use that option here instead of a
2017 2003-08-18 Werner Koch <wk@gnupg.org>
2019 * Makefile.am: Add OPENSC_LIBS to all programs.
2021 * scdaemon.c, scdaemon.h: New option --disable-opensc.
2022 * card.c (card_open): Implement it.
2023 * apdu.c (open_osc_reader, osc_send_apdu): New.
2024 (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
2026 (error_string) [HAVE_OPENSC]: Use sc_strerror.
2027 (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
2029 * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
2032 2003-08-14 Timo Schulz <twoaday@freakmail.de>
2034 * apdu.c (ct_activate_card): Change the code a little to avoid
2035 problems with other readers.
2036 * Always use 'dynload.h' instead of 'dlfcn.h'.
2038 2003-08-05 Werner Koch <wk@gnupg.org>
2040 * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
2043 2003-08-04 Werner Koch <wk@gnupg.org>
2045 * app.c (app_set_default_reader_port): New.
2046 (select_application): Use it here.
2047 * scdaemon.c (main): and here.
2048 * sc-copykeys.c: --reader-port does now take a string.
2049 * sc-investigate.c, scdaemon.c: Ditto.
2050 * apdu.c (apdu_open_reader): Ditto. Load pcsclite if no ctapi
2051 driver is configured. Always include code for ctapi.
2052 (new_reader_slot): Don't test for already used ports and remove
2054 (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
2055 (apdu_send_le): Changed RC to long to cope with PC/SC.
2057 * scdaemon.c, scdaemon.h: New option --ctapi-driver.
2058 * sc-investigate.c, sc-copykeys.c: Ditto.
2060 2003-07-31 Werner Koch <wk@gnupg.org>
2062 * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
2064 2003-07-28 Werner Koch <wk@gnupg.org>
2066 * app-openpgp.c (do_setattr): Change implementation. Allow all
2069 2003-07-27 Werner Koch <wk@gnupg.org>
2071 Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
2073 2003-07-24 Werner Koch <wk@gnupg.org>
2075 * app-openpgp.c (do_learn_status): Print more status information.
2076 (app_select_openpgp): Store the card version.
2077 (store_fpr): Add argument card_version and fix DOs for old cards.
2078 (app_openpgp_storekey): Likewise.
2080 2003-07-23 Werner Koch <wk@gnupg.org>
2082 * command.c (cmd_pkauth): New.
2083 (cmd_setdata): Check whether data was given at all to avoid
2084 passing 0 to malloc.
2086 * app.c (app_auth): New.
2087 * app-openpgp.c (do_auth): New.
2089 2003-07-22 Werner Koch <wk@gnupg.org>
2091 * command.c (cmd_passwd): New.
2092 * app.c (app_change_pin): New.
2093 * app-openpgp.c (do_change_pin): New.
2094 * iso7816.c (iso7816_reset_retry_counter): Implemented.
2096 * sc-investigate.c (main): New option --gen-random.
2097 * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
2098 length larger than 255.
2100 2003-07-17 Werner Koch <wk@gnupg.org>
2102 * command.c (cmd_random): New command RANDOM.
2104 * iso7816.c (map_sw): New. Use it in this file to return
2105 meaningful error messages. Changed all public fucntions to return
2107 (iso7816_change_reference_data): New.
2108 * apdu.c (apdu_open_reader): Use faked status words for soem
2111 2003-07-16 Werner Koch <wk@gnupg.org>
2113 * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
2114 specify not to send Le as it should be.
2116 2003-07-15 Werner Koch <wk@gnupg.org>
2118 * Makefile.am: Add sc-copykeys program.
2119 * sc-copykeys.c: New.
2120 * app-openpgp.c (app_openpgp_storekey): New.
2121 (app_openpgp_cardinfo): New.
2123 (store_fpr): And use it here to get the actual length in bit.
2125 2003-07-03 Werner Koch <wk@gnupg.org>
2127 * app-openpgp.c (do_setattr): Add setting of the URL.
2128 (app_select_openpgp): Dump card data only in very verbose mode.
2131 2003-07-02 Werner Koch <wk@gnupg.org>
2133 * app-openpgp.c (get_sig_counter): New.
2134 (do_sign): Print the signature counter and enable the PIN callback.
2135 (do_genkey): Implement the PIN callback.
2137 2003-07-01 Werner Koch <wk@gnupg.org>
2139 * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
2141 2003-06-26 Werner Koch <wk@gnupg.org>
2143 * app-openpgp.c (find_tlv): Fixed length header parsing.
2145 * app.c (app_genkey): New.
2146 * command.c (cmd_genkey): New.
2148 2003-06-25 Werner Koch <wk@gnupg.org>
2150 * command.c (percent_plus_unescape): New.
2153 2003-06-24 Werner Koch <wk@gnupg.org>
2155 * command.c (send_status_info): New.
2157 * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
2158 and setup the function pointers in APP on success. Changed callers.
2160 * app-common.h: New.
2161 * scdaemon.h (APP): New type to handle applications.
2162 (server_control_s): Add an APP context field.
2164 * command.c (cmd_serialno): Handle applications.
2165 (cmd_pksign): Ditto.
2166 (cmd_pkdecrypt): Ditto.
2167 (reset_notify): Ditto.
2168 (cmd_learn): For now return error for application contexts.
2169 (cmd_readcert): Ditto.
2170 (cmd_readkey): Ditto.
2172 2003-06-04 Werner Koch <wk@gnupg.org>
2174 * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
2176 Renamed error codes from INVALID to INV and removed _ERROR suffixes.
2178 2003-06-03 Werner Koch <wk@gnupg.org>
2180 Changed all error codes in all files to the new libgpg-error scheme.
2182 * scdaemon.h: Include gpg-error.h and errno.h
2183 * card.c (map_sc_err): Use unknown for the error source.
2184 * Makefile.am: Link with libgpg-error
2186 2003-05-14 Werner Koch <wk@gnupg.org>
2188 * atr.c, atr.h: New.
2189 * sc-investigate.c: Dump the ATR in a human readable format.
2191 2003-05-08 Werner Koch <wk@gnupg.org>
2193 * scdaemon.h (DBG_CARD_IO_VALUE): New.
2195 * sc-investigate.c: New.
2196 * scdaemon.c (main): Removed --print-atr option.
2198 * iso7816.c, iso7816.h, app-openpgp.c: New.
2200 2003-04-29 Werner Koch <wk@gnupg.org>
2202 * scdaemon.c: New options --print-atr and --reader-port
2203 * apdu.c, apdu.h: New
2205 * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
2207 * Makefile.am (LDFLAGS): Removed.
2209 * command.c (register_commands): Adjusted for new Assuan semantics.
2211 2002-08-21 Werner Koch <wk@gnupg.org>
2213 * scdaemon.c (main): New option --daemon so that the program is
2214 not accidently started in the background.
2216 2002-08-16 Werner Koch <wk@gnupg.org>
2218 * scdaemon.c: Include i18n.h.
2220 * card-common.h (struct p15_private_s): Forward declaration. Add
2222 * card.c (card_close): Make sure private data is released.
2223 (card_enum_certs): New.
2224 * card-p15.c (p15_release_private_data): New.
2225 (init_private_data): New to work around an OpenSC weirdness.
2226 (p15_enum_keypairs): Do an OpenSC get_objects only once.
2227 (p15_enum_certs): New.
2228 (card_p15_bind): Bind new function.
2229 * command.c (cmd_learn): Return information about the certificates.
2231 2002-08-09 Werner Koch <wk@gnupg.org>
2233 * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
2234 number as a fallback. Add a special prefix for serial numbers.
2236 2002-07-30 Werner Koch <wk@gnupg.org>
2238 Changes to cope with OpenSC 0.7.0:
2240 * card.c: Removed the check for the packed opensc version.
2241 Changed include file names of opensc.
2242 (map_sc_err): Adjusted error codes for new opensc version.
2243 * card-p15.c: Changed include filename of opensc.
2244 * card-dinsig.c: Ditto.
2246 * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
2248 2002-07-24 Werner Koch <wk@gnupg.org>
2250 * card.c (find_simple_tlv, find_iccsn): New.
2251 (card_get_serial_and_stamp): Improved serial number parser.
2253 2002-06-27 Werner Koch <wk@gnupg.org>
2255 * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
2257 2002-06-15 Werner Koch <wk@gnupg.org>
2259 * card-dinsig.c: Documented some stuff from the DIN norm.
2261 2002-04-15 Werner Koch <wk@gnupg.org>
2263 * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
2265 2002-04-12 Werner Koch <wk@gnupg.org>
2267 * scdaemon.c: New option --debug-sc N.
2268 * card.c (card_open): set it here.
2270 * card-p15.c (p15_prepare_key): Factored out common code from ...
2271 (p15_sign, p15_decipher): here and made the decryption work the
2274 2002-04-10 Werner Koch <wk@gnupg.org>
2276 * card.c (card_open): Return immediately when no reader is available.
2278 2002-03-27 Werner Koch <wk@gnupg.org>
2280 * card.c (card_open, card_close): Adjusted for changes in OpenSC.
2282 2002-03-10 Werner Koch <wk@gnupg.org>
2284 * card-p15.c, card-dinsig.c, card-common.h: New.
2285 * card.c: Factored most code out to the new modules, so that we
2286 can better support different types of card applications.
2288 2002-01-26 Werner Koch <wk@gnupg.org>
2290 * scdaemon.c scdaemon.h, command.c: New. Based on the code from
2294 Copyright 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
2296 This file is free software; as a special exception the author gives
2297 unlimited permission to copy and/or distribute it, with or without
2298 modifications, as long as this notice is preserved.
2300 This file is distributed in the hope that it will be useful, but
2301 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
2302 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.