chiark / gitweb /
gnupg2 (2.1.17-3) unstable; urgency=medium
[gnupg2.git] / scd / ChangeLog-2011
1 2011-12-01  Werner Koch  <wk@g10code.com>
2
3         NB: ChangeLog files are no longer manually maintained.  Starting
4         on December 1st, 2011 we put change information only in the GIT
5         commit log, and generate a top-level ChangeLog file from logs at
6         "make dist".  See doc/HACKING for details.
7
8 2011-12-01  Niibe Yutaka  <gniibe@fsij.org>
9
10         * app-openpgp.c (do_change_pin): Fix pincb messages when
11         use_keypad == 1.
12
13 2011-11-29  Niibe Yutaka  <gniibe@fsij.org>
14
15         PC/SC pininput support for passphrase modification (2/2)
16         * apdu.h (apdu_send_simple_kp): Remove.
17
18         * apdu.c (pcsc_keypad_modify): Add bConfirmPIN handling.
19         (apdu_send_simple_kp): Remove.
20
21         * iso7816.h (iso7816_reset_retry_counter_kp): Remove arguments
22         of NEWCHV, and NEWCHVLEN.
23         (iso7816_reset_retry_counter_with_rc_kp, iso7816_put_data_kp): New.
24
25         * iso7816.c (iso7816_reset_retry_counter_with_rc_kp): New.
26         (iso7816_reset_retry_counter_kp): Call apdu_keypad_modify.  Only
27         handle the case with PININFO.
28         (iso7816_reset_retry_counter): Don't call
29         iso7816_reset_retry_counter_kp.
30         (iso7816_put_data_kp): New.
31
32         * app-openpgp.c (do_change_pin): Add with_resetcode.
33         Handle keypad for unblocking pass phrase with resetcode,
34         setting up of resetcode, and unblocking by admin.
35
36         PC/SC pininput support for passphrase modification (1/2)
37         * iso7816.h (iso7816_change_reference_data_kp): Remove arguments
38         of OLDCHV, OLDCHVLEN, NEWCHV, and NEWCHVLEN.
39
40         * iso7816.c (iso7816_change_reference_data_kp): Call
41         apdu_keypad_modify.
42         (iso7816_change_reference_data): Don't call
43         iso7816_change_reference_data_kp.
44
45         * apdu.h (apdu_keypad_modify): New.
46
47         * apdu.c (pcsc_keypad_modify, apdu_keypad_modify): New.
48         (struct reader_table_s): New memeber function keypad_modify.
49         (new_reader_slot, open_ct_reader, open_ccid_reader)
50         (open_rapdu_reader): Initialize keypad_modify.
51
52         * app-openpgp.c (do_change_pin): Handle keypad and call
53         iso7816_change_reference_data_kp if it is the case.
54
55 2011-11-28  Niibe Yutaka  <gniibe@fsij.org>
56
57         * iso7816.h (iso7816_verify_kp): Remove arguments of CHV and CHVLEN.
58
59         * iso7816.c (iso7816_verify_kp): Call apdu_keypad_verify. Only
60         handle the case with PININFO.
61         (iso7816_verify): Call apdu_send_simple.
62
63         * app-openpgp.c (verify_a_chv, verify_chv3): Follow the change of
64         iso7816_verify_kp.
65
66         * app-nks.c (verify_pin): Likewise.
67
68         * app-dinsig.c (verify_pin): Likewise.
69
70         * apdu.c: Include "iso7816.h".
71         (struct reader_table_s): New memeber function keypad_verify.
72         Add fields verify_ioctl and modify_ioctl in pcsc.
73         (CM_IOCTL_GET_FEATURE_REQUEST, FEATURE_VERIFY_PIN_DIRECT)
74         (FEATURE_MODIFY_PIN_DIRECT): New.
75         (pcsc_control): New.
76         (control_pcsc_direct, control_pcsc_wrapped, control_pcsc)
77         (check_pcsc_keypad, pcsc_keypad_verify): New.
78         (ccid_keypad_verify, apdu_keypad_verify): New.
79         (new_reader_slot): Initialize with check_pcsc_keypad,
80         pcsc_keypad_verify, verify_ioctl and modify_ioctl.
81         (open_ct_reader): Initialize keypad_verify with NULL.
82         (open_ccid_reader): Initialize keypad_verify.
83         (open_rapdu_reader): Initialize keypad_verify with NULL.
84         (apdu_open_reader): Initialize pcsc_control.
85
86         * pcsc-wrapper.c (load_pcsc_driver): Initialize pcsc_control.
87         (handle_control): New.
88         (main): Handle the case 6 of handle_control.
89
90 2011-08-10  Werner Koch  <wk@g10code.com>
91
92         * command.c (cmd_killscd): Use the new assuan force close flag
93         if available.
94
95 2011-08-08  Werner Koch  <wk@g10code.com>
96
97         * app-openpgp.c (do_decipher): Take care of accidentally passed
98         signed integer data with a leading 0.
99
100 2011-06-16  Werner Koch  <wk@g10code.com>
101
102         * app-openpgp.c (send_key_data): Implemented chunked mode.
103         (change_keyattr): Increase limit to 4096.
104         (do_decipher): Adjust padding for 4096 bit keys.
105
106 2011-02-23  Werner Koch  <wk@g10code.com>
107
108         * apdu.c (apdu_open_reader): Lock in to CCID if used once.
109
110 2011-01-25  NIIBE Yutaka <gniibe@fsij.org>,
111             Grant Olson <kgo@grant-olson.net>  (wk)
112
113         * command.c (do_reset, get_reader_slot)
114         (update_reader_status_file): Fix handling of the VALID flag for
115         unplugged readers.
116
117 2011-01-25  Werner Koch  <wk@g10code.com>
118
119         From 2.0 branch, 2010-03-17:
120
121         * command.c (open_card): Return GPG_ERR_NOT_OPERATIONAL if no
122         card services are available.
123         (get_reader_slot): Detect no services status.
124         (cmd_serialno): No reset if there are no services.
125         (scd_command_handler): Stop scdaemon in that case.
126         * apdu.c (pcsc_no_service): New.
127         (open_pcsc_reader_direct): Set it.
128         (apdu_open_reader): Add arg R_NO_SERVICE.
129
130 2011-01-05  Werner Koch  <wk@g10code.com>
131
132         * ccid-driver.c (ccid_transceive_secure): Support the gnuk token.
133
134 2010-11-16  Werner Koch  <wk@g10code.com>
135
136         * apdu.c (PCSC_UNKNOWN) [W32]: Fix all these values which don't
137         match those of libpcsc.  Reported by Michael Petig.
138
139 2010-10-27  Werner Koch  <wk@g10code.com>
140
141         * scdaemon.c (create_socket_name): Use TMPDIR.  Change callers.
142
143 2010-10-18  Werner Koch  <wk@g10code.com>
144
145         * app-openpgp.c (parse_algorithm_attribute): Remove extra const in
146         definition of DESC.
147
148 2010-08-16  Werner Koch  <wk@g10code.com>
149
150         * scdaemon.c: Replace remaining printf by es_printf.
151
152 2010-06-09  Werner Koch  <wk@g10code.com>
153
154         * scdaemon.c (main): s/log_set_get_tid_callback/log_set_pid_suffix_cb/.
155         (tid_log_callback): Adjust for this change.
156
157 2010-03-11  Werner Koch  <wk@g10code.com>
158
159         * scdaemon.c: Include "asshelp.h".
160         (main): Remove assuan_set_assuan_log_prefix.  Add
161         assuan_set_log_cb.
162         (handle_signal): Disable pth ctrl dumping.
163         * command.c (scd_command_handler): Remove assuan_set_log_stream.
164
165 2010-03-10  Werner Koch  <wk@g10code.com>
166
167         * Makefile.am (scdaemon_LDADD): Remove libjnlib.a.
168
169 2009-12-15  Werner Koch  <wk@g10code.com>
170
171         * iso7816.c (do_generate_keypair): s/readonly/read_only/ because
172         the first is a keyword in VMS C.
173
174 2009-12-03  Werner Koch  <wk@g10code.com>
175
176         * scdaemon.c (set_debug): Allow for numerical debug leveles.  Print
177         active debug flags.
178
179 2009-11-25  Marcus Brinkmann  <marcus@g10code.de>
180
181         * command.c (scd_command_handler): Use assuan_fd_t and
182         assuan_fdopen on fds.
183
184 2009-11-05  Marcus Brinkmann  <marcus@g10code.de>
185
186         * command.c (scd_command_handler): Call assuan_init_socket_server,
187         not assuan_init_socket_server_ext.
188
189 2009-11-04  Werner Koch  <wk@g10code.com>
190
191         * command.c (register_commands): Add help arg to
192         assuan_register_command.  Add help strings to all commands.
193
194 2009-11-02  Marcus Brinkmann  <marcus@g10code.de>
195
196         * command.c (reset_notify): Take LINE arg and return error.
197         (register_commands): Use assuan_handler_t type.
198
199 2009-10-25  Werner Koch  <wk@g10code.com>
200
201         * scdaemon.c (scd_deinit_default_ctrl): Release IN_DATA.
202         * command.c (cmd_setdata): Release IN_DATA.  Reported by Klaus
203         Flittner.
204
205 2009-10-16  Marcus Brinkmann  <marcus@g10code.com>
206
207         * AM_CFLAGS, scdaemon_LDADD: Use libassuan instead of libassuan-pth.
208         * scdaemon.c: Invoke ASSUAN_SYSTEM_PTH_IMPL.
209         (main): Call assuan_set_system_hooks and assuan_sock_init.
210
211 2009-09-23  Marcus Brinkmann  <marcus@g10code.de>
212
213         * command.c: Include "scdaemon.h" before <assuan.h> because of
214         GPG_ERR_SOURCE_DEFAULT check.
215         (option_handler, open_card, cmd_serialno, cmd_lean, cmd_readcert)
216         (cmd_readkey, cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt)
217         (cmd_getattr, cmd_setattr, cmd_writecert, cmd_writekey)
218         (cmd_genkey, cmd_random, cmd_passwd, cmd_checkpin, cmd_lock)
219         (cmd_unlock, cmd_getinfo, cmd_restart, cmd_disconnect, cmd_apdu)
220         (cmd_killscd): Return gpg_error_t instead of int.
221         (scd_command_handler): Allocate assuan context before starting server.
222         * scdaemon.c (main): Update to new Assuan API.
223
224 2009-09-03  Werner Koch  <wk@g10code.com>
225
226         * app-openpgp.c (do_decipher): Compute required Le.
227         * iso7816.c (iso7816_decipher): Add new arg LE.
228         * app-nks.c (do_decipher): Adjust for change.
229
230         * iso7816.c (iso7816_put_data, iso7816_put_data_odd): Turn DATA
231         into a void ptr.
232
233 2009-08-05  Werner Koch  <wk@g10code.com>
234
235         * app-openpgp.c (change_keyattr_from_string): New.
236         (do_setattr): Support KEY-ATTR.
237
238 2009-07-29  Marcus Brinkmann  <marcus@g10code.com>
239
240         * ccid-driver.c (print_pr_data): Fix 64 bit compat problem.
241
242 2009-07-24  Werner Koch  <wk@g10code.com>
243
244         * ccid-driver.c (parse_ccid_descriptor): Enable hack for SCR 3320.
245
246 2009-07-21  Werner Koch  <wk@g10code.com>
247
248         * ccid-driver.c [HAVE_PTH]: Include pth.h.
249         (my_sleep): New.
250         (bulk_in): s/gnupg_sleep/my_sleep/.
251
252 2009-07-20  Werner Koch  <wk@g10code.com>
253
254         * apdu.c [GNUPG_MAJOR_VERSION==1]: Include dynload.h.
255
256 2009-07-16  Werner Koch  <wk@g10code.com>
257
258         * command.c (update_reader_status_file): Test for unplugged reader.
259         (TEST_CARD_REMOVAL): Ditto.
260         * app.c (select_application): Ditto.
261         * ccid-driver.c (bulk_out): Return CCID_DRIVER_ERR_NO_READER if a
262         reader was unplugged.
263         (struct ccid_driver_s): Turn nonnull_nad into an unsigned char.
264         Turn apdu_level, auto_ifsd, powered_off, has_pinpad into
265         bitfields. Add enodev_seen.
266         * apdu.c (apdu_prepare_exit): New.
267         (get_status_ccid): Return the status word and nut just -1.
268         * scdaemon.c (scd_exit): Call it.
269
270 2009-07-13  Werner Koch  <wk@g10code.com>
271
272         * ccid-driver.c (struct ccid_driver_s): Add fields last_progress,
273         progress_cb and progress_cb_arg.
274         (ccid_set_progress_cb): New.
275         (print_progress): New.
276         (ccid_transceive): Call print_progress for wait time extensions.
277         * apdu.c (struct reader_table_s): Add field set_progress_cb.
278         (new_reader_slot): Clear that field.
279         (open_ccid_reader): Set it to ..
280         (set_progress_cb_ccid_reader): ... new fucntion.
281         * app.c (print_progress_line): New.
282         (lock_reader): Add arg CTRL to set a progress callback and
283         change all callers to provide it.
284         (unlock_reader): Remove the progress callback.
285
286 2009-07-10  Werner Koch  <wk@g10code.com>
287
288         * iso7816.c (iso7816_compute_ds): Add args EXTENDED_MODE and LE.
289         Change all callers to use 0.
290         (iso7816_internal_authenticate): Add args EXTENDED_MODE and LE.
291         * app-openpgp.c (do_sign): Take exmode and Le from card
292         capabilities and pass them to iso7816_compute_ds.
293         (do_auth): Ditto for iso7816_internal_authenticate.
294         (change_keyattr): Reset CHV verification status.
295
296 2009-07-09  Werner Koch  <wk@g10code.com>
297
298         * app-openpgp.c (change_keyattr): New.
299         (do_writekey): Call it.
300
301         * app-openpgp.c (does_key_exist): Add arg GENERATING.  Change
302         callers.
303
304 2009-06-30  Werner Koch  <wk@g10code.com>
305
306         * ccid-driver.c (ccid_transceive): Set RESYNCING flag.
307
308 2009-06-29  Werner Koch  <wk@g10code.com>
309
310         * ccid-driver.c (ccid_transceive): Add a hack to support extended
311         length for Omnikey readers.
312         (is_exlen_apdu): New.
313         (parse_ccid_descriptor): Track short+extended apdu exchange level.
314
315 2009-06-18  Werner Koch  <wk@g10code.com>
316
317         * app-openpgp.c (verify_chv2): Remove special case for v2 cards.
318         (get_public_key): Use extended mode.
319
320 2009-06-17  Werner Koch  <wk@g10code.com>
321
322         * iso7816.c (iso7816_get_data): Add arg EXTENDED_MODE.  Change all
323         callers.
324         * app-openpgp.c (data_objects): Use bit flags.  Add flag
325         TRY_EXTLENGTH.
326         (get_cached_data): Add arg TRY_EXTLEN and use it for iso7816_get_data.
327         (get_one_do): Use extended length APDU if necessary.
328
329 2009-06-10  Werner Koch  <wk@g10code.com>
330
331         * app-openpgp.c (store_fpr): Change first arg to app_t; adjust
332         callers.  Flush the cache.
333
334 2009-06-09  Werner Koch  <wk@g10code.com>
335
336         * app-openpgp.c (do_readcert): Return NOT_FOUND if the retrieved
337         data has a length of zero.
338         (do_getattr): Add EXTCAP subkey "sm".
339
340 2009-05-20  Werner Koch  <wk@g10code.com>
341
342         * app-openpgp.c (verify_chv2): Add case for v2 cards.
343         (verify_chv3): Factor some code out to ..
344         (build_enter_admin_pin_prompt): .. new.
345         (do_change_pin): Properly handle v2 cards.
346
347 2009-05-19  Werner Koch  <wk@g10code.com>
348
349         * scdaemon.c (create_server_socket): Use SUN_LEN.
350         (JNLIB_NEED_AFLOCAL): Define.
351
352 2009-05-13  Werner Koch  <wk@g10code.com>
353
354         * ccid-driver.c (abort_cmd): Add arg SEQNO and change callers.
355         (bulk_in): Retry on seqno mismatch.
356
357         * apdu.c (send_le): Release result_buffer.
358         (apdu_send_direct): Implemend extended length.
359         * command.c (cmd_apdu): Add option "--exlen".
360
361 2009-05-11  Werner Koch  <wk@g10code.com>
362
363         * apdu.c (send_le): Replace log_error by log_info.
364
365 2009-05-08  Werner Koch  <wk@g10code.com>
366
367         * app-openpgp.c (do_genkey): Allow larger key sizes.
368         (do_decipher): Ditto.
369         * iso7816.c (do_generate_keypair): Add arg EXTENDED_MODE an LE.
370         (iso7816_generate_keypair, iso7816_read_public_key): Ditto.
371         Changed all callers.
372         * apdu.c (send_le): Implement extended length return values.
373
374         * ccid-driver.c (bulk_in): Retry on EAGAIN.
375         (abort_cmd): Change seqno handling.
376
377 2009-04-28  Werner Koch  <wk@g10code.com>
378
379         * app-help.c (app_help_count_bits): New.
380
381         * app-nks.c (switch_application): Detect mass signature cards.
382         Take care of new NEED_APP_SELECT flag.
383         (do_sign): Don't allow mass signature cards.
384         (all_zero_p): New.
385         (do_readkey): New.
386         (app_select_nks): Register do_readkey.
387
388 2009-04-01  Werner Koch  <wk@g10code.com>
389
390         * app-openpgp.c (do_setattr, do_writekey): Prepare for extended
391         length cards.
392
393 2009-03-31  Werner Koch  <wk@g10code.com>
394
395         * command.c (percent_plus_unescape): Remove.
396         (cmd_setattr): Use percent_plus_unescape_inplace.
397
398 2009-03-30  Werner Koch  <wk@g10code.com>
399
400         * app-nks.c (do_decipher): Make it work for TCOS 3.
401         * iso7816.c (iso7816_decipher): Add arg EXTENDED_MODE.
402         * apdu.c (apdu_send): Add arg EXTENDED_MODE and change all callers.
403         (apdu_send_le):  Ditto.
404         (apdu_send_direct): Ditto, but not yet functional.
405         (send_le): Fix command chaining.  Implement extended length option.
406         * ccid-driver.c (ccid_transceive): Remove restriction on apdu length.
407         (struct ccid_driver_s): Add field IFSC.
408         (ccid_get_atr): Set IFSC.
409         (ccid_transceive): Use negotiated IFSC and support S(IFS) command.
410
411 2009-03-26  Werner Koch  <wk@g10code.com>
412
413         * command.c (cmd_pksign): Allow more hash algorithms.
414
415         * scdaemon.h (MAX_DIGEST_LEN): Change to 64.
416
417         * apdu.c (open_ccid_reader): Clear the is_to flag.
418
419         * app-nks.c (filelist): Add field KID.
420         (do_getattr): Change standard authentication key.
421         (do_sign): Setup a security environment for TCOS 3 cards and support
422         all SHA-2 algorithms.
423
424 2009-03-24  Werner Koch  <wk@g10code.com>
425
426         * command.c (struct server_local_s): Add flag
427         APP_CTX_MARKED_FOR_RELEASE.
428         (do_reset): Set the flag.
429         (open_card): Act on this flag.
430         * app-common.h (struct app_ctx_s): Add flag NO_REUSE.
431         (application_notify_card_reset): Set the flag.
432         * app.c (select_application, release_application): Take care of
433         that flag.
434
435 2009-03-20  Werner Koch  <wk@g10code.com>
436
437         * app-nks.c (keygripstr_from_pk_file): Fix for TCOS 3 cards.
438
439 2009-03-18  Werner Koch  <wk@g10code.com>
440
441         * apdu.c (open_pcsc_reader_wrapped): Use close_all_fds.
442
443         * command.c (cmd_learn): Add option --keypairinfo.
444         * app.c (app_write_learn_status): Add arg FLAGS.
445         * app-common.h (struct app_ctx_s): Add arg FLAGS to LEARN_STATUS.
446         Change all implementors.
447         * app-p15.c (do_learn_status): Take care of flag bit 0.
448         * app-nks.c (do_learn_status, do_learn_status_core): Ditto.
449
450 2009-03-10  Werner Koch  <wk@g10code.com>
451
452         * app-openpgp.c (send_key_attr): New.
453         (do_getattr): New attribute KEY_ATTR.
454         * command.c (send_status_direct): New.
455
456 2009-03-06  Werner Koch  <wk@g10code.com>
457
458         * app-nks.c (do_learn_status): Factor code out to..
459         (do_learn_status_core): .. new.
460         (do_readcert, do_sign, do_decipher): Switch to SigG if needed.
461         (verify_pin): Use DESC also for keypad based verify.
462
463 2009-03-05  Werner Koch  <wk@g10code.com>
464
465         * app-openpgp.c (verify_a_chv): Remove special case for keypads.
466         (verify_chv3): Ditto.
467
468         * app-nks.c (get_chv_status): New.
469         (parse_pwidstr): New.
470         (verify_pin): Add args PWID and DESC and use them.  Remove the
471         CHV1 caching.
472         (do_change_pin): Allow PIN selection and add reset mode.
473         (do_learn_status): Use NKS-NKS3 tag for TCOS 3 cards.
474         (do_readcert, do_sign): Allow NKS-NKS3 tag.
475
476 2009-03-04  Werner Koch  <wk@g10code.com>
477
478         * app-nks.c (do_getattr): New.
479         (app_select_nks): Register it.
480         (verify_pin): Factor some code out to...
481         (basic_pin_checks): New.
482         (do_change_pin): Call the basic check.
483         (app_select_nks): Move AID to ..
484         (aid_nks): .. new.
485         (aid_sigg): New.
486         (switch_application): New.
487         (do_getattr, do_learn_status, do_readcert, do_sign, do_decipher)
488         (do_change_pin, do_check_pin): Make sure we are in NKS mode.
489
490 2009-03-03  Werner Koch  <wk@g10code.com>
491
492         * command.c (scd_command_handler): Remove dereference of STOPME
493         after free.
494
495 2009-02-27  Werner Koch  <wk@g10code.com>
496
497         * app.c (get_supported_applications): New.
498         * command.c (cmd_getinfo): New subcommand "app_list"
499         (cmd_killscd): New.
500         (register_commands): Register command KILLSCD.
501         (struct server_local_s): Add field STOPME.
502         (scd_command_handler): Act upon this.
503
504 2009-02-25  Werner Koch  <wk@g10code.com>
505
506         * apdu.c (apdu_get_status): Factor all code out to ...
507         (apdu_private_get_status): .. new.  Add arg NO_ATR_RESET.
508         (apdu_connect): Call new function.
509
510         * scdaemon.c: New option --debug-log-tid.
511         (tid_log_callback): New.
512         (main): Move debug-wait code after debug stream init.
513
514 2009-02-24  Werner Koch  <wk@g10code.com>
515
516         * ccid-driver.c (ccid_get_atr): Move debug output to ..
517         (print_r2p_parameters): .. new.
518         (print_r2p_header, print_pr_data, print_r2p_unknown)
519         (print_r2p_datablock, print_r2p_slotstatus, print_r2p_escape)
520         (print_r2p_datarate): New.
521         (bulk_in): Call parameter printing.
522         (ccid_set_debug_level): Add debug level 3.
523         (convert_le_u16): New.
524         (print_p2r_header, print_p2r_iccpoweron, print_p2r_iccpoweroff)
525         (print_p2r_getslotstatus, print_p2r_xfrblock)
526         (print_p2r_getparameters, print_p2r_resetparameters)
527         (print_p2r_setparameters, print_p2r_escape, print_p2r_iccclock)
528         (print_p2r_to0apdu, print_p2r_secure, print_p2r_mechanical)
529         (print_p2r_abort, print_p2r_setdatarate, print_r2p_unknown): New.
530         (bulk_out): Add arg NO_DEBUG and change all callers to pass 0.
531         Call parameter printing.
532         (ccid_slot_status): Call with NO_DEBUG set.
533         (abort_cmd, send_escape_cmd, ccid_get_atr, ccid_get_atr)
534         (ccid_transceive_apdu_level, ccid_transceive)
535         (ccid_transceive_secure): Remove old debug print code.
536
537 2009-02-12  Werner Koch  <wk@g10code.com>
538
539         * command.c (cmd_getinfo): Add new subcommand "deny_admin".
540
541 2009-01-28  Werner Koch  <wk@g10code.com>
542
543         * scdaemon.c (main): Make --allow-admin the default and make the
544         option a dummy.
545
546 2009-01-27  Werner Koch  <wk@g10code.com>
547
548         * app-geldkarte.c: Changed to use an AID.
549
550         * app.c (app_munge_serialno): Add case for no serialno.
551         (app_get_serial_and_stamp): Ditto.
552
553 2009-01-26  Werner Koch  <wk@g10code.com>
554
555         * app-geldkarte.c: New.
556         * Makefile.am (card_apps): Add new file.
557         * app.c (select_application): Test for geldkarte.
558
559 2009-01-12  Werner Koch  <wk@g10code.com>
560
561         * command.c (send_client_notifications) [HAVE_W32_SYSTEM]: Fix
562         brackets.
563
564 2009-01-08  Werner Koch  <wk@g10code.com>
565
566         * iso7816.c (iso7816_read_record, iso7816_read_binary): Pass 0 for
567         L_e because the problem with the CCID driver has gone.
568         (iso7816_apdu_direct): New.
569
570         * app-nks.c (filelist): Add NKS_VER field.  Add NKS 3 specific
571         entries.
572         (app_local_s, do_deinit): New.
573         (get_nks_version): New.
574         (app_select_nks): Setup local data.
575         (keygripstr_from_pk_file): Replace SLOT by APP and take care of
576         NKS version > 2.
577         (do_learn_status): Take care of NKS version.
578
579 2009-01-05  Werner Koch  <wk@g10code.com>
580
581         * apdu.c (apdu_get_status): Save the last status.
582
583 2008-12-18  Werner Koch  <wk@g10code.com>
584
585         * ccid-driver.c (abort_cmd): New.
586         (bulk_in): Call abort_cmd after severe errors.
587
588         * apdu.c (reader_table_s): Add field ANY_STATUS.
589         (new_reader_slot): Clear it.
590         (apdu_get_status): Use ANY_STATUS to update the change counter.
591         Remove the use of the flag bit from LAST_STATUS everywhere.
592         * command.c (update_reader_status_file): Factor code out to ...
593         (send_client_notifications): New.  Track signals already sent.
594         (update_reader_status_file): Shutdown the reader  after a failed
595         apdu_get_status.
596
597 2008-12-09  Werner Koch  <wk@g10code.com>
598
599         * scdaemon.c (main): Call i18n_init before init_common_subsystems.
600
601 2008-12-08  Werner Koch  <wk@g10code.com>
602
603         * scdaemon.c (handle_connections): Sync ticker to the next full
604         interval.
605         (TIMERTICK_INTERVAL_USEC): Change to 500ms.
606
607 2008-12-05  Werner Koch  <wk@g10code.com>
608
609         * app-openpgp.c (app_local_s): Add field ALGO_ATTR_CHANGE.
610         (app_select_openpgp): Parse new capability.
611         (show_caps): Show new capability.
612
613 2008-12-03  Werner Koch  <wk@g10code.com>
614
615         * scdaemon.c (opts): Use ARGPARSE_ macros.  Add option
616         --card-timeout.
617         * command.c (update_reader_status_file): Implement it.
618
619 2008-11-18  Werner Koch  <wk@g10code.com>
620
621         * scdaemon.c (make_libversion): New.
622         (my_strusage): Print libgcrypt and libksba version.
623
624 2008-11-03  Werner Koch  <wk@g10code.com>
625
626         * command.c (server_local_s): Add field DISCONNECT_ALLOWED.
627         (cmd_disconnect): Implement command.
628         (open_card): Reset disconnect flag.
629         (update_reader_status_file): Disconnect if allowed.
630
631         * app-common.h (app_ctx_s): Remove INITIALIZED.  Make REF_COUNT
632         unsigned.
633         * app.c (select_application): Remove INITIALIZED.
634         (app_write_learn_status, app_readcert, app_readkey, app_getattr)
635         (app_setattr, app_sign, app_decipher, app_writecert)
636         (app_writekey, app_get_challenge, app_change_pin, app_check_pin):
637         Replace INITIALIZED by REF_COUNT check.
638         (application_notify_card_removed): Rename to ..
639         (application_notify_card_reset): .. this.  Change all callers.
640         * command.c (do_reset): Call application_notify_card_reset after
641         sending a reset.
642         (update_reader_status_file): Add arg SET_CARD_REMOVED.
643         (scd_update_reader_status_file): Pass true for new flag.
644         (do_reset): Pass false for new flag.
645
646         * app.c (app_get_serial_and_stamp): Use bin2hex.
647         * app-help.c (app_help_get_keygrip_string): Ditto.
648         * app-p15.c (send_certinfo, send_keypairinfo, do_getattr): Ditto.
649         * app-openpgp.c (send_fpr_if_not_null, send_key_data)
650         (retrieve_fpr_from_card, send_keypair_info): Ditto.
651         * app-nks.c (keygripstr_from_pk_file): Ditto.
652         * command.c (cmd_apdu): Ditto.
653
654 2008-10-21  Marcus Brinkmann  <marcus@g10code.com>
655
656         * command.c (open_card): If connect error is SW_HOST_NO_CARD,
657         return a more descriptive error.
658
659 2008-10-20  Werner Koch  <wk@g10code.com>
660
661         * pcsc-wrapper.c (read_32): Use provided arg and not stdin.  Is
662         called with stdin, though.
663         (handle_close): Mark unused arg.
664         (handle_status, handle_reset): Ditto.
665
666         * ccid-driver.c (ccid_check_card_presence): Mark not yet used arg.
667
668         * scdaemon.c (scd_deinit_default_ctrl): Mark unused arg.
669         * command.c (cmd_unlock, cmd_restart, cmd_disconnect): Ditto.
670         * apdu.c (ct_get_status): Ditto.
671         (ct_send_apdu, pcsc_send_apdu_wrapped)
672         (apdu_open_remote_reader): Ditto.
673         * app.c (select_application): Ditto.
674         * app-openpgp.c (do_writecert, do_change_pin, do_writekey): Ditto.
675         * app-nks.c (do_change_pin, do_check_pin): Ditto.
676
677 2008-10-16  Werner Koch  <wk@g10code.com>
678
679         * command.c (cmd_disconnect): New dummy command.
680         (register_commands): Register command.
681
682 2008-10-15  Werner Koch  <wk@g10code.com>
683
684         * command.c (scd_command_handler): Return true if there is no more
685         active session.
686         * scdaemon.c (start_connection_thread): Set shutdown flag if
687         requested by command handler.
688         (main): Make PIPE_SERVER module global.
689         (handle_connections): Disable listen_fd if a shutdown is pending.
690
691 2008-10-14  Werner Koch  <wk@g10code.com>
692
693         * apdu.c (reader_table_s): Add fields connect_card and
694         disconnect_card.
695         (new_reader_slot): Set them to NULL.
696         (apdu_connect, apdu_disconnect): New.
697         (apdu_close_reader, apdu_shutdown_reader): Call apdu_disconnect.
698         (connect_pcsc_card, disconnect_pcsc_card): new.
699         (reset_pcsc_reader_direct): Implement in terms of
700         disconnect_pcsc_card and connect_pcsc_card.
701         (apdu_get_atr): Return NULL if there is no ATR.
702         * sc-copykeys.c (main): Add call to apdu_connect.
703         * command.c (open_card): Ditto.
704
705         * apdu.h (SW_HOST_ALREADY_CONNECTED): New.
706         (APDU_CARD_USABLE, APDU_CARD_PRESENT, APDU_CARD_ACTIVE): New.
707         * apdu.c: Replace constants by the new macros.
708         (open_pcsc_reader): Factor  code out to ...
709         (open_pcsc_reader_direct, open_pcsc_reader_wrapped): New.
710         (reset_pcsc_reader): Factor code out to ...
711         (reset_pcsc_reader_direct, reset_pcsc_reader_wrapped): New.
712         (pcsc_get_status): Factor code out to ...
713         (pcsc_get_status_direct, pcsc_get_status_wrapped): New.
714         (pcsc_send_apdu): Factor code out to ...
715         (pcsc_send_apdu_direct, pcsc_send_apdu_wrapped): New.
716         (close_pcsc_reader): Factor code out to ...
717         (close_pcsc_reader_direct, close_pcsc_reader_wrapped): New.
718
719         * command.c (update_reader_status_file): Open the reader if not
720         yet done.
721
722         * scdaemon.c (TIMERTICK_INTERVAL_SEC, TIMERTICK_INTERVAL_USEC):
723         New to replace TIMERTICK_INTERVAL.  Chnage from 2s (4 under W32)
724         to 250ms.
725
726 2008-10-13  Werner Koch  <wk@g10code.com>
727
728         * command.c (option_handler) [W32]: Use strtoul with base 16.
729         (update_reader_status_file) [W32]: Set Event.
730         (scd_command_handler): Use INT2FD to silent warning.
731
732 2008-09-29  Werner Koch  <wk@g10code.com>
733
734         * scdaemon.h (GCRY_MD_USER): Rename to GCRY_MODULE_ID_USER.
735         (GCRY_MD_USER_TLS_MD5SHA1): Rename to MD_USER_TLS_MD5SHA1 and
736         change all users.
737
738 2008-09-28  Marcus Brinkmann  <marcus@g10code.com>
739
740         * apdu.c (pcsc_get_status): Fix last change.
741
742 2008-09-25  Werner Koch  <wk@g10code.com>
743
744         * app-openpgp.c (do_setattr): Do not allow setting of the reset
745         code.
746         (do_change_pin): Allow setting of the reset code.
747
748 2008-09-24  Werner Koch  <wk@g10code.com>
749
750         * app-openpgp.c (verify_chv3): Set the did_chv3 flag which was
751         accidently removed on 2008-03-26.
752         (verify_chv2): Revert last change.
753         (do_change_pin): Do not change CHV2. Add reset code logic for v2
754         cards.
755         * iso7816.c (iso7816_reset_retry_counter_with_rc): New.
756
757         * app-openpgp.c (add_tlv, build_privkey_template): New.
758         (do_writekey): Support v2 keys and other key lengths than 1024.
759         * iso7816.c (iso7816_put_data_odd): New.
760
761 2008-09-23  Werner Koch  <wk@g10code.com>
762
763         * app-openpgp.c (do_sign): Support SHA-2 digests.
764         (verify_chv2): No CHV auto-sync for v2 cards.
765         (do_auth): Allow 2048 bit keys.
766         (parse_algorithm_attribute): New.
767         (rsa_key_format_t): New.
768         (struct app_local_s): Add struct KEYATTR.
769
770 2008-09-23  Marcus Brinkmann  <marcus@g10code.com>
771
772         * apdu.c (pcsc_get_status): Be more relaxed with the usable flag
773         under Windows.
774
775 2008-09-23  Werner Koch  <wk@g10code.com>
776
777         * app-openpgp.c (do_setattr): Use command chaining for long
778         values.
779         * iso7816.c (iso7816_put_data): Add arg EXTENDED_MODE. Change all
780         callers.
781         * apdu.c (apdu_send_simple): Add arg EXTENDED_MODE. Change all
782         callers.
783         (send_le): Implement command chaining.
784         * ccid-driver.c (ccid_transceive_apdu_level): Increase allowed
785         APDU size.
786         (ccid_transceive): Alow for APDUS of up to 259 bytes.
787         * apdu.h: Add new SW_ codes.
788
789 2008-09-16  Werner Koch  <wk@g10code.com>
790
791         * command.c (cmd_writecert): New.
792         (register_commands): Register it.
793         * app-common.h (app_ctx_s): Add member WRITECERT.
794         * app.c (app_writecert): New.
795         * app-openpgp.c (do_writecert): New.
796         (parse_historical): New.
797         (show_extcap): New.
798         (dump_all_do): Print only the length of longs DOs.
799         * command.c (cmd_writekey, cmd_apdu, cmd_pksign)
800         (cmd_passwd): Replace open coding by skip_options.
801
802 2008-08-30  Moritz  <moritz@gnu.org>
803
804         * scdaemon.c (main): Use estream_asprintf instead of asprintf.
805         * command.c (update_reader_status_file): Likewise.
806         (cmd_serialno): Use estream_asprintf instead of asprintf
807         and xfree instead of free to release memory allocated
808         through (estream_)asprintf.
809         (cmd_learn): Likewise.
810         (pin_cb): Likewise.
811         * app-openpgp.c (get_public_key): Likewise.
812
813 2008-08-18  Werner Koch  <wk@g10code.com>
814
815         * app-openpgp.c (do_setattr): Fix test for v2 cards.
816
817 2008-08-11  Werner Koch  <wk@g10code.com>
818
819         * apdu.c (reset_pcsc_reader, open_pcsc_reader)
820         (reset_rapdu_reader, open_rapdu_reader): Allow ATRs of up to 33
821         bytes.  Provide maximum size of ATR buffer using DIM.  Such long
822         ATR are never seen in reality but the PC/SC library of MAC OS X is
823         just too buggy.  Reported by Ludovic Rousseau.  Fixes bug #948.
824
825 2008-07-30  Werner Koch  <wk@g10code.com>
826
827         * app-openpgp.c (verify_a_chv): Use xtrymalloc and make the prompt
828         for CHV2 more user friendly.
829
830 2008-07-03  Werner Koch  <wk@g10code.com>
831
832         * app-openpgp.c (do_readcert): New.
833         (app_local_s): Add fields IS_V2 and MAX_CERTLEN_3.
834         (app_select_openpgp): Set them and register do_readcert.
835         (do_setattr): Allow storing of the certificate.
836
837 2008-06-25  Werner Koch  <wk@g10code.com>
838
839         * app-dinsig.c (do_sign): Allow for SHA256.
840
841 2008-06-24  Werner Koch  <wk@g10code.com>
842
843         * app-common.h (app_ctx_s): Renamed reset_mode parameter of
844         change_pin to mode_Flags and make it an unsigned int.
845         (APP_CHANGE_FLAG_RESET, APP_CHANGE_FLAG_NULLPIN): New.
846         * app-openpgp.c (do_change_pin): Adjust for that.
847
848         * command.c (cmd_passwd): Add option --nullpin.
849         * app-nks.c (do_check_pin, do_change_pin): New.
850         (app_select_nks): Register new functions.
851
852 2008-04-21  Moritz Schulte  <mo@g10code.com>  (wk)
853
854         * app-openpgp.c (verify_a_chv): Make use of the default CHV flag.
855
856 2008-03-26  Werner Koch  <wk@g10code.com>
857
858         * app-openpgp.c (verify_chv3): Support the keypad.
859
860 2008-02-09  Marcus Brinkmann  <marcus@g10code.de>
861
862         * scdaemon.c (main): Use CONFIG_FILENAME as filename if it is set
863         in gpgconf-list output.
864
865 2007-12-10  Werner Koch  <wk@g10code.com>
866
867         * app-openpgp.c (do_decipher): Take care of cryptograms shorter
868         that 128 bytes.  Fixes bug#851.
869
870 2007-11-14  Werner Koch  <wk@g10code.com>
871
872         * scdaemon.c (main): Pass STANDARD_SOCKET flag to
873         create_server_socket.
874
875 2007-11-13  Werner Koch  <wk@g10code.com>
876
877         * scdaemon.c (start_connection_thread): Do not call
878         assuan_sock_check_nonce if we are running in --server mode.
879
880 2007-11-07  Werner Koch  <wk@g10code.com>
881
882         * scdaemon.h: Remove errors.h.
883
884 2007-10-02  Werner Koch  <wk@g10code.com>
885
886         * command.c (cmd_getinfo): Add "pid" subcommand.
887
888 2007-10-01  Werner Koch  <wk@g10code.com>
889
890         * scdaemon.c (create_server_socket): Use Assuan socket wrappers
891         and remove Windows specific code.
892         (socket_nonce): New.
893         (start_connection_thread): Check nonce.
894
895 2007-09-14  Marcus Brinkmann  <marcus@g10code.de>
896
897         * scdaemon.c (main): New variable STANDARD_SOCKET, which is 1 for
898         W32 targets.  Use it for create_socket_name.
899
900 2007-08-07  Werner Koch  <wk@g10code.com>
901
902         * tlv.c, tlv.h:  Move to ../common/.
903
904 2007-08-02  Werner Koch  <wk@g10code.com>
905
906         * scdaemon.c: Include gc-opt-flags.h and remove their definition
907         here.
908
909 2007-08-01  Werner Koch  <wk@g10code.com>
910
911         * apdu.c (send_le): Implement exact length hack.  Suggested by
912         Sten Lindgren.
913
914 2007-07-05  Werner Koch  <wk@g10code.com>
915
916         * command.c (has_option_name, skip_options): New.
917         (cmd_genkey): Add option --timestamp.
918         (cmd_writekey): Enter confidential mode while inquiring the key data.
919
920         * app.c (app_genkey): Add arg CREATETIME.
921         * app-common.h (app_ctx_s): Likewise
922         * app-openpgp.c (do_genkey): Ditto.  Use it.
923
924
925 2007-07-04  Werner Koch  <wk@g10code.com>
926
927         * command.c (cmd_getinfo): New subcommand "version".
928
929         * scdaemon.c (TIMERTICK_INTERVAL): New.
930         (handle_connections) [W32]: Enable a dummy sigs event.
931         (handle_connections): Use a proper count for select and not
932         FD_SETSIZE.
933         (fixed_gcry_pth_init, main): Kludge to fix pth initialization.
934
935 2007-06-21  Werner Koch  <wk@g10code.com>
936
937         * scdaemon.h (ctrl_t): Remove.  It is now declared in ../common/util.h.
938
939 2007-06-18  Marcus Brinkmann  <marcus@g10code.de>
940
941         * scdaemon.c (main): Percent escape output of --gpgconf-list.
942
943 2007-06-12  Werner Koch  <wk@g10code.com>
944
945         * scdaemon.c (main): Replace some calls by init_common_subsystems.
946
947 2007-06-11  Werner Koch  <wk@g10code.com>
948
949         * Makefile.am (scdaemon_LDADD): Use libcommonpth macro.
950
951         * command.c (initialize_module_command): New.
952         * scdaemon.c (main) [W32]: Do not use sigpipe code.
953         (main): Call initialize_module_command.
954
955 2007-06-06  Werner Koch  <wk@g10code.com>
956
957         * app-openpgp.c (do_sign): Fix arithmetic on void*.
958
959         * app.c (dump_mutex_state) [W32]: Handle the W32Pth case.
960
961         * apdu.c: Remove dynload.h.
962
963         * scdaemon.c (i18n_init): Remove.
964
965 2007-04-20  Werner Koch  <wk@g10code.com>
966
967         * sc-copykeys.c (my_gcry_logger): Removed.
968         (main): Call setup_libgcrypt_logging helper.
969         * scdaemon.c (my_gcry_logger): Removed.
970         (main): Call setup_libgcrypt_logging helper.
971
972 2007-04-03  Werner Koch  <wk@g10code.com>
973
974         * command.c (cmd_getinfo): New subcommand "reader_list".
975         * ccid-driver.c (scan_or_find_devices): Ignore EBUSY in scan mode
976         for special transports.
977
978 2007-03-07  Werner Koch  <wk@g10code.com>
979
980         * app-dinsig.c: Include i18n.h.
981         (verify_pin): Support PIN pads.
982         * app-nks.c (verify_pin): Ditto.
983
984         * ccid-driver.c (bulk_in): Handle time extension before checking
985         the message type.
986         (ccid_transceive_secure): Support the Cherry XX44 keyboard.
987         Kudos to the nice folks at Cherry for helping with that.
988
989 2007-02-18  Werner Koch  <wk@g10code.com>
990
991         * scdaemon.c (DEFAULT_PCSC_DRIVER): Add a default for OS X.
992
993 2007-01-25  Werner Koch  <wk@g10code.com>
994
995         * Makefile.am (scdaemon_LDADD): Added LIBICONV.  Noted by Billy
996         Halsey.
997
998 2006-12-21  Werner Koch  <wk@g10code.com>
999
1000         * app-openpgp.c (verify_chv2): Factored most code out into...
1001         (verify_a_chv): ... new.
1002         (do_sign): Factored verification code out to new function and
1003         take care of a keypad entered PIN.
1004         (compare_fingerprint): Print an additional diagnostic.
1005
1006 2006-11-28  Werner Koch  <wk@g10code.com>
1007
1008         * apdu.c (send_le, apdu_send_direct): Increase RESULTLEN to 258 to
1009         allow for full 256 byte and the status word.  This might break
1010         some old PC/SC drivers or cards, but we will see.  Suggested by
1011         Kenneth Wang.
1012
1013 2006-11-23  Werner Koch  <wk@g10code.com>
1014
1015         * command.c (scd_command_handler): Fixed use of CTRL.
1016
1017 2006-11-21  Werner Koch  <wk@g10code.com>
1018
1019         * Makefile.am (libexec_PROGRAMS): Put pscs-wrapper into libexec.
1020         Renamed to gnupg-pcsc-wrapper.
1021         * apdu.c (open_pcsc_reader): Use GNUPG_LIBEXECDIR to accces the
1022         wrapper.  Suggested by Eric Dorland.
1023
1024 2006-11-20  Werner Koch  <wk@g10code.com>
1025
1026         * app-openpgp.c (verify_chv2): Support for keypads (only CHV2).
1027
1028         * ccid-driver.c (ccid_transceive_secure): Made it work for Kaan
1029         and SCM.
1030
1031 2006-11-17  Werner Koch  <wk@g10code.com>
1032
1033         * ccid-driver.c (scan_or_find_devices): Use DEBUGOUT_2 instead of
1034         log_debug.  Removed few other log_debug.
1035
1036         * iso7816.c (iso7816_check_keypad): Allow for a SW of 0.
1037
1038         * command.c (pin_cb): New mode to prompt for a keypad entry.
1039
1040         * scdaemon.c (main) <gpgconf-list>: Add disable-keypad.
1041
1042 2006-11-15  Werner Koch  <wk@g10code.com>
1043
1044         * app-p15.c (read_ef_odf): Cast one printf arg.
1045
1046         * scdaemon.h (struct server_control_s): Add field THREAD_STARTUP.
1047         * command.c (scd_command_handler): Add new arg CTRL.
1048         * scdaemon.c (scd_init_default_ctrl): Made static.
1049         (scd_deinit_default_ctrl): New.
1050         (start_connection_thread): Call init/deinit of ctrl.
1051         (handle_connections): Allocate CTRL.
1052
1053         * apdu.c (PCSC_ERR_MASK): New.
1054         (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
1055         (close_pcsc_reader, open_pcsc_reader): Use it after shifting error
1056         values.  Reported by Henrik Nordstrom.  Fixes bug #724.
1057
1058 2006-10-24  Werner Koch  <wk@g10code.com>
1059
1060         * scdaemon.h (GCRY_MD_USER_TLS_MD5SHA1): New.
1061         (MAX_DIGEST_LEN): Increased to 36.
1062         * app-p15.c (do_sign): Support for TLS_MD5SHA1.
1063         (do_auth): Detect TLS_MD5SHA1.
1064         (do_sign): Tweaks for that digest.
1065
1066 2006-10-23  Werner Koch  <wk@g10code.com>
1067
1068         * scdaemon.c (main): New command --gpgconf-test.
1069
1070 2006-10-17  Werner Koch  <wk@g10code.com>
1071
1072         * Makefile.am (scdaemon_LDADD): Link against libcommonpth.
1073
1074 2006-10-12  Werner Koch  <wk@g10code.com>
1075
1076         * apdu.c: Include pth.h after unistd.h for the sake of newer Pth
1077         versions.
1078
1079 2006-10-11  Werner Koch  <wk@g10code.com>
1080
1081         * app-openpgp.c (do_sign): Redirect to do_auth for OpenPGP.3.
1082
1083 2006-10-06  Werner Koch  <wk@g10code.com>
1084
1085         * Makefile.am (AM_CFLAGS): Use PTH version of libassuan.
1086         (scdaemon_LDADD): Ditto.
1087
1088         * scdaemon.h (send_status_info): Mark with sentinel attribute.
1089
1090 2006-10-02  Marcus Brinkmann  <marcus@g10code.de>
1091
1092         * command.c (update_reader_status_file): Increase buffer of
1093         NUMBUF2 (fixing typo).
1094
1095 2006-09-24  Marcus Brinkmann  <marcus@g10code.de>
1096
1097         * app-openpgp.c (do_sign): Advance INDATA by the SHA1 resp. RMD160
1098         prefix length.
1099
1100 2006-09-14  Werner Koch  <wk@g10code.com>
1101
1102         Replaced all call gpg_error_from_errno(errno) by
1103         gpg_error_from_syserror().
1104
1105         * command.c (scd_command_handler): Replaced
1106         init_connected_socket_server by init_socket_server_ext.
1107
1108 2006-09-07  Werner Koch  <wk@g10code.com>
1109
1110         * command.c (update_reader_status_file): Execute an event handler
1111         if available.
1112
1113 2006-09-06  Werner Koch  <wk@g10code.com>
1114
1115         * apdu.c (pcsc_end_transaction):
1116         * pcsc-wrapper.c (pcsc_end_transaction: Fixed dclaration.
1117         Reported by Bob Dunlop.
1118
1119         * scdaemon.h (CTRL,APP): Removed and changed everywhere to
1120         ctrl_t/app_t.
1121
1122         Replaced all Assuan error codes by libgpg-error codes.  Removed
1123         all map_to_assuan_status and map_assuan_err.
1124
1125         * scdaemon.c (main): Call assuan_set_assuan_err_source to have Assuan
1126         switch to gpg-error codes.
1127         * command.c (set_error): Adjusted.
1128
1129 2006-09-02  Marcus Brinkmann  <marcus@g10code.de>
1130
1131         * command.c (get_reader_slot): Return the slot_table index, not
1132         the APDU slot number.
1133         (update_reader_status_file): Use the slot_table index in the
1134         update_card_removed invocation.
1135
1136 2006-09-01  Marcus Brinkmann  <marcus@g10code.de>
1137
1138         * command.c (cmd_getinfo): Handle status command.
1139
1140 2006-08-30  Marcus Brinkmann  <marcus@g10code.de>
1141
1142         * command.c (do_reset): Delay resetting CTRL->reader_slot until
1143         after update_card_removed invocation.
1144
1145 2006-08-28  Marcus Brinkmann  <marcus@g10code.de>
1146
1147         * app-openpgp.c (do_decipher, do_sign): Allow "OPENPGP.2"
1148         resp. "OPENPGP.1" for KEYIDSTR.
1149
1150 2006-08-21  Werner Koch  <wk@g10code.com>
1151
1152         * pcsc-wrapper.c (handle_open, handle_close): Reset card and
1153         protocol on error/close.
1154         (handle_status): Don't set the state if the state is unknown.
1155         (handle_reset): Ignore an error if already disconnected.  May
1156         happen due to system wake-up after hibernation.  Suggested by Bob
1157         Dunlop.
1158
1159 2006-06-28  Werner Koch  <wk@g10code.com>
1160
1161         * app-openpgp.c (do_writekey): Fixed computation of memmove
1162         length.  This led to garbled keys if E was larger than one byte.
1163         Thanks to Achim Pietig for hinting at the garbled E.
1164
1165 2006-06-09  Marcus Brinkmann  <marcus@g10code.de>
1166
1167         * Makefile.am (scdaemon_LDADD): Add $(NETLIBS).
1168
1169 2006-04-14  Marcus Brinkmann  <marcus@g10code.de>
1170
1171         * app.c (select_application): Cover up a slot mismatch error in
1172         case it happens (it shouldn't happen).
1173         (release_application): Use APP->slot.  Lock the reader.
1174         (application_notify_card_removed): Lock the reader.
1175
1176 2006-04-11  Werner Koch  <wk@g10code.com>
1177
1178         * command.c (hex_to_buffer): New.
1179         (cmd_apdu): New.
1180
1181 2006-04-03  Werner Koch  <wk@g10code.com>
1182
1183         * scdaemon.c [__GLIBC__]: Default to libpcsclite.so.1.
1184
1185 2006-03-21  Werner Koch  <wk@g10code.com>
1186
1187         * command.c (cmd_pksign): Add --hash option.
1188
1189 2006-03-01  Werner Koch  <wk@g10code.com>
1190
1191         * command.c (status_file_update_lock): New.
1192         (scd_update_reader_status_file): Use lock and factor existing code
1193         out to ..
1194         (update_reader_status_file): .. this.
1195         (do_reset): Use the lock and call update_reader_status_file.
1196
1197 2006-02-20  Werner Koch  <wk@g10code.com>
1198
1199         * apdu.c (open_pcsc_reader): Fixed double free.  Thanks to Moritz.
1200
1201 2006-02-09  Werner Koch  <wk@g10code.com>
1202
1203         * command.c (get_reader_slot, do_reset)
1204         (scd_update_reader_status_file): Rewrote.
1205
1206         * app.c (release_application): Factored code out to ..
1207         (deallocate_app): new function.
1208         (select_application): Introduce new saved application stuff.
1209         (application_notify_card_removed): New.
1210         * command.c (update_card_removed): Call it here.
1211         (do_reset): And here.
1212
1213         * app.c (check_application_conflict): New.
1214         * command.c (open_card): Use it here.
1215         (cmd_restart): New command.
1216
1217         * command.c (cmd_lock): Fixed --wait option to actually terminate.
1218
1219 2006-02-08  Werner Koch  <wk@g10code.com>
1220
1221         * ccid-driver.c (ccid_get_atr): Read Parameter and select T=1
1222         using these parameters.
1223         (scan_or_find_devices): Check for NULL r_fd.
1224
1225 2006-02-02  Werner Koch  <wk@g10code.com>
1226
1227         * ccid-driver.c (special_transport): New
1228         (ccid_open_reader, do_close_reader, ccid_shutdown_reader)
1229         (bulk_out, bulk_in): Add support for CardMan 4040 reader.
1230
1231         * ccid-driver.c (scan_or_find_devices): Factored most code out to
1232         (scan_or_find_usb_device): .. new.
1233         (make_reader_id): Fixed vendor mask.
1234
1235 2006-01-01  Werner Koch  <wk@g10code.com>
1236
1237         * app-openpgp.c (do_sign): Give user error if hash algorithm is
1238         not supported by the card.
1239
1240 2005-12-06  Werner Koch  <wk@g10code.com>
1241
1242         * apdu.c (open_pcsc_reader): Check that pcsc-wrapper is actually
1243         installed.
1244
1245 2005-11-23  Werner Koch  <wk@g10code.com>
1246
1247         * app-nks.c (verify_pin): Give a special error message for a Nullpin.
1248
1249 2005-10-29  Werner Koch  <wk@g10code.com>
1250
1251         * ccid-driver.c (send_escape_cmd): New args RESULT, RESULTLEN and
1252         RESULTMAX.  Changed all callers.
1253         (ccid_transceive_escape): New.
1254
1255 2005-10-27  Werner Koch  <wk@g10code.com>
1256
1257         * apdu.c [__CYGWIN__]: Make cygwin environment similar to _WIN32.
1258         Suggested by John P. Clizbe.
1259         * scdaemon.c [__CYGWIN__]: Set default PC/SC driver to winscard.dll.
1260
1261 2005-10-19  Werner Koch  <wk@g10code.com>
1262
1263         * ccid-driver.h (CCID_DRIVER_ERR_NO_KEYPAD): New.
1264         * apdu.h (SW_HOST_NO_KEYPAD): New.
1265         * iso7816.h (struct iso7816_pininfo_s): New.
1266         * iso7816.c (map_sw): Support new code.
1267         (iso7816_check_keypad): New.
1268         (iso7816_verify_kp, iso7816_change_reference_data_kp)
1269         (iso7816_reset_retry_counter_kp): New.  Extended versions of the
1270         original functions.
1271         * apdu.c (host_sw_string): Support new code.
1272         (reader_table_s): New field CHECK_KEYPAD.
1273         (new_reader_slot, open_ct_reader, open_pcsc_reader)
1274         (open_ccid_reader, open_rapdu_reader): Initialize it.
1275         (check_ccid_keypad): New.
1276         (apdu_check_keypad): New.
1277         (apdu_send_le): Factored all code out to ...
1278         (send_le): .. new.  Takes an additional arg; changed all callers
1279         of the orginal function to use this one with a NULL for the new
1280         arg.
1281         (apdu_send_simple_kp): New.
1282         (ct_send_apdu, pcsc_send_apdu, my_rapdu_send_apdu)
1283         (send_apdu_ccid): New arg PININFO.
1284         (send_apdu_ccid): Use the new arg.
1285
1286         * scdaemon.c: New option --disable-keypad.
1287
1288 2005-10-08  Marcus Brinkmann  <marcus@g10code.de>
1289
1290         * Makefile.am (scdaemon_LDADD): Add ../gl/libgnu.a after
1291         ../common/libcommon.a.
1292
1293 2005-09-20  Werner Koch  <wk@g10code.com>
1294
1295         * app-dinsig.c (verify_pin): Try ISO 9564 BCD encoding.
1296
1297         * iso7816.c (iso7816_select_application): Add arg FLAGS.  Changed
1298         all callers to pass 0.
1299         * app-openpgp.c (app_select_openpgp): But this one requires a
1300         special flag.
1301
1302         * app-p15.c (app_select_p15): Don't use select application for the
1303         BELPIC.
1304
1305 2005-09-09  Werner Koch  <wk@g10code.com>
1306
1307         * pcsc-wrapper.c (main): Removed bogus free.
1308
1309         * app-p15.c (do_auth): New.
1310         (do_getattr): New attribs $AUTHKEYID and $DISPSERIALNO.
1311         * app-openpgp.c (do_getattr): Ditto.
1312
1313 2005-09-08  Werner Koch  <wk@g10code.com>
1314
1315         * app-openpgp.c (do_getattr): New key $AUTHKEYID.
1316
1317 2005-09-06  Werner Koch  <wk@g10code.com>
1318
1319         * app-p15.c (do_sign): Tweaked for BELPIC cards.
1320         (read_home_df): New arg R_BELPIC.
1321         (app_select_p15): Set card type for BELPIC.
1322
1323 2005-09-05  Werner Koch  <wk@g10code.com>
1324
1325         * iso7816.c (iso7816_select_path): New.
1326         * app-p15.c (select_ef_by_path): Allow for direct path selection.
1327         (app_select_p15): Try using the Belgian variant of pkcs#15.
1328         (read_home_df): New.
1329         (read_ef_odf): Generalized.
1330         (read_ef_tokeninfo): New.
1331         (read_p15_info): Set serialnumber from TokenInfo.
1332         (app_select_p15): Don't munge serialNumber - that must be done
1333         only once.
1334
1335         * iso7816.c (iso7816_read_binary): Use Le=0 when reading all
1336         data.  Handle 6C00 error and take 6B00 as indication for EOF.
1337         * apdu.h (SW_EXACT_LENGTH_P): New.
1338         * apdu.c (new_reader_slot, reset_pcsc_reader, pcsc_get_status)
1339         (open_pcsc_reader): Set new reader state IS_T0.
1340         (apdu_send_le): When doing T=0 make sure not to send Lc and Le.
1341         Problem reported by Carl Meijer.
1342         (apdu_send_direct): Initialize RESULTLEN.
1343         * pcsc-wrapper.c (handle_status): Return the current protocol as
1344         a new third word.
1345
1346 2005-08-05  Werner Koch  <wk@g10code.com>
1347
1348         * apdu.c (open_rapdu_reader): Set the reader number.
1349
1350 2005-07-05  Werner Koch  <wk@g10code.com>
1351
1352         * app-openpgp.c (do_readkey): Return a mallcoed copy of the key as
1353         required by the description.  Thanks to Moritz for tracking this
1354         problem down.
1355
1356 2005-06-21  Werner Koch  <wk@g10code.com>
1357
1358         * scdaemon.c (main): ifdef call to ccid_set_debug_level.
1359
1360         * apdu.c (reset_pcsc_reader, open_pcsc_reader): Cast size_t to
1361         ulong for printf.
1362
1363 2005-06-06  Werner Koch  <wk@g10code.com>
1364
1365         * scdaemon.c (main): New option --debug-allow-core-dump.
1366
1367 2005-06-03  Werner Koch  <wk@g10code.com>
1368
1369         * scdaemon.c (handle_connections): Make sure that the signals we
1370         are handling are not blocked.Block signals while creating new
1371         threads.
1372         (handle_connections): Include the file descriptor into the name of
1373         the thread.
1374
1375 2005-06-02  Werner Koch  <wk@g10code.com>
1376
1377         * app.c (app_dump_state, dump_mutex_state): New.
1378         * scdaemon.c (handle_signal): Print it on SIGUSR1.
1379
1380         * app-openpgp.c (do_writekey): Typo fix.
1381
1382         * command.c (open_card): Check for locked state even if an
1383         application context is available.
1384
1385         * app-common.h: Add REF_COUNT field.
1386         * app.c (release_application, select_application): Implement
1387         reference counting to share the context beween connections.
1388
1389         * app.c (lock_reader, unlock_reader): Take SLOT instead of APP as
1390         argument.  Changed all callers.
1391         (select_application): Unlock the reader on error.  This should fix
1392         the hangs I noticed last week.
1393
1394         * scdaemon.h: Removed card_ctx_t cruft.
1395
1396 2005-06-01  Werner Koch  <wk@g10code.com>
1397
1398         * scdaemon.c: Include mkdtemp.h.
1399
1400 2005-05-31  Werner Koch  <wk@g10code.com>
1401
1402         * tlv.c [GNUPG_MAJOR_VERSION==1]: Define constants instead of
1403         including a gnupg 1.4 header.
1404
1405 2005-05-30  Werner Koch  <wk@g10code.com>
1406
1407         * tlv.c: Add hack to compile without gpg-error.h when used with
1408         GnuPG 1.4.
1409
1410 2005-05-23  Werner Koch  <wk@g10code.com>
1411
1412         * Makefile.am: Do not build sc-copykeys anymore.
1413
1414         * app-openpgp.c (app_openpgp_storekey, app_openpgp_readkey)
1415         (app_openpgp_cardinfo): Removed.
1416
1417         * ccid-driver.c (parse_ccid_descriptor): SCR335 FW version 5.14 is
1418         good.
1419         (do_close_reader): Never do a reset. The caller should instead
1420         make sure that the reader has been closed properly.  The new retry
1421         code in ccid_slot_status will make sure that the readersatrts up
1422         fine even if the last process didn't closed the USB connection
1423         properly.
1424         (ccid_get_atr): For certain readers try switching to ISO mode.
1425         Thanks to Ludovic Rousseau for this hint and the magic numbers.
1426         (print_command_failed): New.
1427         (bulk_in): Use it here. Add new arg NO_DEBUG.
1428         (ccid_slot_status): Disabled debugging.
1429
1430 2005-05-21  Werner Koch  <wk@g10code.com>
1431
1432         * scdaemon.c (handle_signal): Print thread info on SIGUSR1.
1433
1434 2005-05-20  Werner Koch  <wk@g10code.com>
1435
1436         * ccid-driver.c: Replaced macro DEBUG_T1 by a new debug level.
1437         (parse_ccid_descriptor): Mark SCR335 firmware version 5.18 good.
1438         (ccid_transceive): Arghhh.  The seqno is another bit in the
1439         R-block than in the I block, this was wrong at one place.
1440
1441         * scdaemon.c: New options --debug-ccid-driver and
1442         --debug-disable-ticker.
1443
1444         * app-openpgp.c (do_genkey, do_writekey): Factored code to check
1445         for existing key out into ..
1446         (does_key_exist): .. New function.
1447
1448 2005-05-19  Werner Koch  <wk@g10code.com>
1449
1450         * tlv.c (parse_sexp): New.
1451
1452         * command.c (cmd_writekey): New.
1453         * app.c (app_writekey): New.
1454         * app-common.c (app_t): Add function ptr WRITEKEY.
1455         * app-openpgp.c (do_writekey): New.
1456
1457         * app-openpgp.c (do_readkey) [GNUPG_MAJOR_VERSION==1]: Return error.
1458         * app-common.h (app_t) [GNUPG_MAJOR_VERSION==1]: Add a field to
1459         store the Assuan context.
1460
1461 2005-05-17  Werner Koch  <wk@g10code.com>
1462
1463         * scdaemon.c: Removed non-pth code paths.
1464         (create_socket_name, create_server_socket): New.  Taken from
1465         ../agent/gpg-agent.
1466         (cleanup): Changed to adjust for SOCKET_NAME now being malloced.
1467         (ticker_thread): Always use pth_event_occurred; it is again
1468         defined for all decent PTH versions.
1469         (handle_connections): New. Based on the gpg-agent code.
1470         (start_connection_thread): Ditto.
1471         (ticker_thread): Removed.
1472         (cleanup_sh): Removed.
1473         (main): Run the handler for the pipe server in a separate
1474         thread.  This replaces the old ticker thread.
1475         (scd_get_socket_name): New.
1476         * command.c (cmd_getinfo): New command GETINFO.
1477         (scd_command_handler): Renamed argument and changed code to use an
1478         already connected FD.
1479
1480 2005-05-15  Werner Koch  <wk@g10code.com>
1481
1482         * app.c, app-common.h, app-nks.c, app-p15.c, app-dinsig.c
1483         * app-openpgp.c: Change most function return types from int to
1484         gpg_error_t.
1485         * command.c (pin_cb): Ditto.
1486         * sc-copykeys.c (pincb): Ditto.
1487
1488         * app.c (lock_reader, unlock_reader): New.  Changed call handler
1489         wrappers to make use of these functions.
1490
1491 2005-05-07  Werner Koch  <wk@g10code.com>
1492
1493         * ccid-driver.c (do_close_reader): Don't do a reset before close.
1494         Some folks reported that it makes the SCR335 hang less often.
1495         Look at the source on how to re-enable it.
1496
1497 2005-04-27  Werner Koch  <wk@g10code.com>
1498
1499         * app-p15.c (micardo_mse): New.
1500         (do_sign): Call it.
1501         * iso7816.c (iso7816_manage_security_env): Allow passing DATA as
1502         NULL to indicate an empty Lc.
1503         * tlv.c (find_tlv): Check that a found object fits into the
1504         buffer.
1505         (find_tlv_unchecked): New as replacement for the old non-checking
1506         variant.
1507         * app.c (select_application): Keep on using the non-checking
1508         variant.
1509         * app-openpgp.c (get_one_do, dump_all_do): Ditto.
1510
1511
1512         Removal of the old OpenSC based code.
1513
1514         * app-p15.c: New.  Basic support for pkcs15 cards without OpenSC.
1515         There are quite a couple of things missing but at least I can use
1516         my old TCOS cards from the Aegypten-1 development for signing.
1517         * app.c (select_application): Detect pkcs15 applications.
1518         * Makefile.am (scdaemon_SOURCES): Removed card.c, card-common.h
1519         and card-p15.c because they are now obsolete. Added app-p15.c.
1520         Removed all OpenSC stuff.
1521         * command.c (do_reset, open_card, cmd_serialno, cmd_learn)
1522         (cmd_readcert, cmd_readkey, cmd_pksign, cmd_pkdecrypt): Removed
1523         all special cases for the old card.c based mechanisms.
1524         * scdaemon.c, apdu.c: Removed all special cases for OpenSC.
1525
1526 2005-04-20  Werner Koch  <wk@g10code.com>
1527
1528         * command.c: Use GPG_ERR_LOCKED instead of EBUSY.
1529
1530 2005-04-14  Werner Koch  <wk@g10code.com>
1531
1532         * app-openpgp.c (retrieve_key_material): Rewritten.  Return a
1533         proper error code.
1534         (retrieve_next_token): Removed.
1535         (retrieve_fpr_from_card): Rewritten to make use of DO caching and
1536         to take the KEYNO as arg.
1537         (get_public_key): Renamed variable for clarity.
1538
1539 2005-04-12  Werner Koch  <wk@g10code.com>
1540
1541         Basic support for several sessions.
1542
1543         * command.c (scd_command_handler): Replace the primary_connection
1544         stuff by a real connection list.  Release the local context on
1545         exit.
1546         (scd_update_reader_status_file): Update accordingly.  Send signal
1547         to all connections who registered an event signal.
1548         (cmd_lock, cmd_unlock, register_commands): New commands LOCK and
1549         UNLOCK.
1550         (cmd_setdata, cmd_pksign, cmd_pkauth, cmd_pkdecrypt, cmd_setattr)
1551         (cmd_genkey, cmd_passwd, cmd_checkpin): Return an error if reader
1552         is locked.
1553         (do_reset): Handle locking.
1554         (open_card): Ditto.  Share the reader slot with other sessions.
1555         (get_reader_slot): New.
1556         (update_card_removed): New.  Use it in the TEST_CARD_REMOVAL macro.
1557
1558 2005-04-07  Werner Koch  <wk@g10code.com>
1559
1560         * app-openpgp.c (do_check_pin): Add hack to allow verification of
1561         CHV3.
1562         (get_public_key): Don't use gcry functions to create S-expressions.
1563         (do_deinit, do_readkey, do_genkey, send_keypair_info): Adjust for
1564         above change.
1565
1566 2005-03-29  Moritz Schulte  <moritz@g10code.com>
1567
1568         * app-openpgp.c (retrieve_fpr_from_card): New function.
1569         (retrieve_next_token): New function.
1570         (retrieve_key_material): New function.
1571         (get_public_key): Implement retrival of key through expernal
1572         helper (gpg) in case the openpgp card is not cooperative enough.
1573
1574 2005-03-16  Werner Koch  <wk@g10code.com>
1575
1576         * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1577         reader type specific.
1578         (scan_or_find_devices): Do not check the interface subclass in the
1579         SPR532 kludge, as this depends on the firmware version.
1580         (ccid_get_atr): Get the Slot status first.  This solves the
1581         problem with readers hanging on recent Linux 2.6.x.
1582         (bulk_in): Add argument TIMEOUT and changed all callers to pass an
1583         appropriate one.  Change the standard timeout from 10 to 5 seconds.
1584         (ccid_slot_status): Add a retry code with an initial short timeout.
1585         (do_close_reader): Do an usb_reset before closing the reader.
1586
1587 2005-02-25  Werner Koch  <wk@g10code.com>
1588
1589         * app-openpgp.c (get_public_key): Make sure not to return negative
1590         numbers.
1591         (do_sign): Allow passing of indata with algorithm prefix.
1592         (do_auth): Allow OPENPGP.3 as an alternative ID.
1593
1594         * app.c (app_getattr): Return just the S/N but not the timestamp.
1595
1596 2005-02-24  Werner Koch  <wk@g10code.com>
1597
1598         * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the
1599         application does dot support the getattr call.
1600
1601         * app-openpgp.c (get_one_do): Never try to get a non cacheable
1602         object from the cache.
1603         (get_one_do): Add new arg to return an error code.  Changed all
1604         callers.
1605         (do_getattr): Let it return a proper error code.
1606
1607         * app.c (select_application): Return an error code and the
1608         application context in an new arg.
1609         * command.c (open_card): Adjusted for that.  Don't use the
1610         fallback if no card is present.  Return an error if the card has
1611         been removed without a reset.
1612         (do_reset, cmd_serialno): Clear that error flag.
1613         (TEST_CARD_REMOVAL): New. Use it with all command handlers.
1614         (scd_update_reader_status_file): Set the error flag on all changes.
1615
1616         * scdaemon.c (ticker_thread): Termintate if a shutdown is pending.
1617
1618         * apdu.c: Added some PCSC error codes.
1619         (pcsc_error_to_sw): New.
1620         (reset_pcsc_reader, pcsc_get_status, pcsc_send_apdu)
1621         (open_pcsc_reader): Do proper error code mapping.
1622
1623 2005-03-16  Werner Koch  <wk@g10code.com>
1624
1625         * ccid-driver.c (parse_ccid_descriptor): Make SCM workaround
1626         reader type specific.
1627         (scan_or_find_devices): Do not check the interface subclass in the
1628         SPR532 kludge, as this depends on the firmware version.
1629         (ccid_get_atr): Get the Slot status first.  This solves the
1630         problem with readers hanging on recent Linux 2.6.x.
1631
1632 2005-02-22  Werner Koch  <wk@g10code.com>
1633
1634         * app-openpgp.c (app_local_s): New field PK.
1635         (do_deinit, do_genkey, app_openpgp_storekey): Clear it.
1636         (get_public_key, send_keypair_info): New.
1637         (do_learn_status): Send KEYPAIR info
1638
1639         * app-common.h (app_ctx_t): Add function pointer READKEY.
1640         * app.c (app_readkey): New.
1641         * command.c (cmd_readkey): Use READKEY function if possible.
1642
1643 2005-01-26  Werner Koch  <wk@g10code.com>
1644
1645         * ccid-driver.c (parse_ccid_descriptor): Need the CSM workaround
1646         also for newer firmware versions.  Need to get a list of fixed
1647         firmware versions and use that.
1648
1649 2005-01-25  Werner Koch  <wk@g10code.com>
1650
1651         * apdu.c (apdu_send_le, apdu_send_direct): Fix some compiler
1652         warnings.
1653
1654         * app-openpgp.c (get_cached_data): New arg GET_IMMEDIATE to bypass
1655         the cache.  Changed all callers.
1656         (get_one_do): Bypass the cache if the value would have been read
1657         directly for v1.1 cards.It makes things a bit slower but obnly for
1658         1.0 cards and there are not that many cards out in the wild.  This
1659         is required to fix a caching bug when generating new keys; as a
1660         side effect of the retrieval of the the C4 DO from the 6E DO the
1661         cached fingerprint will get updated to the old value and later
1662         when signing the generated key the checking of the fingerprint
1663         fails because it won't match the new one.  Thanks to Moritz for
1664         analyzing this problem.
1665         (verify_chv3): Removed the CHV status reread logic because we
1666         won't cache the C4 DO anymore.
1667
1668 2004-12-28  Werner Koch  <wk@g10code.com>
1669
1670         * ccid-driver.c (find_endpoint): New.
1671         (scan_or_find_devices): Add new args to return endpoint info and
1672         interface number.
1673         (ccid_open_reader, ccid_shutdown_reader): Take care of these new
1674         args.
1675         (bulk_in, bulk_out): Use the correct endpoints.
1676         (ccid_transceive_apdu_level): New.
1677         (ccid_transceive): Divert to above.
1678         (parse_ccid_descriptor): Allow APDU level exchange mode.
1679         (do_close_reader): Pass the interface number to usb_release_interface.
1680
1681 2004-12-21  Werner Koch  <wk@g10code.com>
1682
1683         * scdaemon.c (main): Use default_homedir().
1684
1685 2004-12-18  Werner Koch  <wk@g10code.com>
1686
1687         * scdaemon.c (main) [W32]: Remove special Pth initialize..
1688
1689         * scdaemon.h (map_assuan_err): Define in terms of
1690         map_assuan_err_with_source.
1691
1692 2004-12-15  Werner Koch  <wk@g10code.com>
1693
1694         * scdaemon.c [W32]: Various hacks to make it run under W32.
1695
1696         * command.c (scd_update_reader_status_file) [W32]: Don't use kill.
1697
1698         * apdu.c [W32]: Disable use of pcsc_wrapper.
1699
1700         * Makefile.am (scdaemon_LDADD): Reorder libs.
1701         (sc_copykeys_LDADD): Add libassuan because it is needed for W32.
1702
1703 2004-12-06  Werner Koch  <wk@g10code.com>
1704
1705         * Makefile.am (pkglib_PROGRAMS): Build only for W32.
1706
1707 2004-10-22  Werner Koch  <wk@g10code.com>
1708
1709         * app-openpgp.c (verify_chv3): The minium length for CHV3 is
1710         8. Changed string to match the other ones.
1711
1712 2004-10-21  Werner Koch  <wk@g10code.com>
1713
1714         * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
1715         This avoids problems with missing vasprintf implementations in
1716         gnupg 1.4.
1717
1718         * app-common.h (app_openpgp_storekey: Add prototype.
1719
1720 2004-10-20  Werner Koch  <wk@g10code.com>
1721
1722         * sc-investigate: Removed.
1723         * Makefile.am (sc_investigate): Removed.
1724
1725         * pcsc-wrapper.c (load_pcsc_driver): Load get_status_change func.
1726         (handle_open): Succeed even without a present card.
1727         (handle_status, handle_reset): New.
1728
1729         * apdu.c (apdu_open_reader): Load pcsc_get_status_change fucntion.
1730         (pcsc_get_status): Implemented.
1731         (reset_pcsc_reader): Implemented.
1732         (open_pcsc_reader): Succeed even with no card inserted.
1733         (open_ccid_reader): Set LAST_STATUS.
1734
1735         * iso7816.c (iso7816_select_application): Always use 0 for P1.
1736
1737 2004-10-18  Werner Koch  <wk@g10code.com>
1738
1739         * ccid-driver.c (ccid_get_atr): Reset T=1 state info.
1740
1741 2004-10-14  Werner Koch  <wk@g10code.com>
1742
1743         * app-openpgp.c (parse_login_data): New.
1744         (app_select_openpgp): Call it.
1745         (do_setattr): Reparse it after change.
1746
1747 2004-10-06  Werner Koch  <wk@g10code.de>
1748
1749         * ccid-driver.c (ccid_open_reader): Store the vendor ID.
1750         (ccid_transceive_secure): New.
1751         (parse_ccid_descriptor): Workaround for an SCM reader problem.
1752
1753 2004-10-04  Werner Koch  <wk@g10code.de>
1754
1755         * ccid-driver.c (send_escape_cmd): New.
1756
1757 2004-09-30  Werner Koch  <wk@g10code.com>
1758
1759         * Makefile.am: Adjusted for gettext 0.14.
1760
1761         * app-openpgp.c (do_sign): Add the error string to the verify
1762         failed messages.
1763
1764 2004-09-27  Werner Koch  <wk@g10code.com>
1765
1766         From gnupg 1.3
1767
1768         * app-openpgp.c: Made all strings translatable.
1769         (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin
1770         available for use in gnupg 2.
1771         (verify_chv3): Reimplemented countdown showing to use only
1772         functions from this module.  Flush the CVH status cache on a
1773         successful read.
1774         (get_one_do): Hack to bypass the cache for cards versions > 1.0.
1775         (store_fpr): Store the creation date for card version > 1.0.
1776
1777         * app-openpgp.c (app_openpgp_storekey): Call flush_cache.
1778         (get_cached_data): Move local data initialization to ..
1779         (app_select_openpgp): .. here. Read some flags for later use.
1780         (do_getattr): New read-only attribute EXTCAP.
1781
1782         * apdu.c (open_pcsc_reader): Do not print empty reader string.
1783
1784         * ccid-driver.c (do_close_reader): Factored some code out from ...
1785         (ccid_close_reader): ..here.
1786         (ccid_shutdown_reader): New.
1787
1788         * apdu.c (apdu_shutdown_reader): New.
1789         (shutdown_ccid_reader): New.
1790
1791         * apdu.c (open_ccid_reader): New arg PORTSTR.  Pass it to
1792         ccid_open_reader.
1793         (apdu_open_reader): Pass portstr to open_ccid_reader.
1794         (apdu_open_reader): No fallback if a full CCID reader id has been
1795         given.
1796
1797         * ccid-driver.c (ccid_get_reader_list): New.
1798         (ccid_open_reader): Changed API to take a string for the reader.
1799         Removed al the cruft for the libusb development vesion which seems
1800         not to be maintained anymore and there are no packages anyway.
1801         The stable library works just fine.
1802         (struct ccid_reader_id_s): Deleted and replaced everywhere by a
1803         simple string.
1804         (usb_get_string_simple): Removed.
1805         (bulk_in): Do valgrind hack here and not just everywhere.
1806
1807         * ccid-driver.c (read_device_info): Removed.
1808         (make_reader_id, scan_or_find_devices): New.
1809         (ccid_open_reader): Simplified by make use of the new functions.
1810         (ccid_set_debug_level): New.  Changed the macros to make use of
1811         it.  It has turned out that it is often useful to enable debugging
1812         at runtime so I added this option.
1813
1814         From gnupg 1.3 - David Shaw  <dshaw@jabberwocky.com>
1815
1816         * app-openpgp.c (verify_chv3): Show a countdown of how many wrong
1817         admin PINs can be entered before the card is locked.
1818
1819         * app-openpgp.c (get_cached_data): Avoid mallocing zero since it
1820         breaks us when using --enable-m-guard.
1821
1822         * ccid-driver.c (usb_get_string_simple): Replacement function to
1823         work with older libusb.
1824
1825         * ccid-driver.c (read_device_info): Fix segfault when usb device
1826         is not accessible.
1827         (ccid_open_reader): Allow working with an even older version of
1828         libusb (usb_busses global instead of usb_get_busses()).
1829
1830 2004-09-11  Werner Koch  <wk@g10code.com>
1831
1832         * app-openpgp.c (app_select_openpgp): Its app_munge_serialno and
1833         not app_number_serialno.
1834
1835 2004-08-20  Werner Koch  <wk@g10code.de>
1836
1837         * app.c (select_application): Fixed serial number extraction and
1838         added the BMI card workaround.
1839         (app_munge_serialno): New.
1840         * app-openpgp.c (app_select_openpgp): Try munging serialno.
1841
1842 2004-08-05  Werner Koch  <wk@g10code.de>
1843
1844         * scdaemon.c (main): New option --disable-application.
1845         * app.c (is_app_allowed): New.
1846         (select_application): Use it to check for disabled applications.
1847
1848         * ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
1849         * ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
1850         of libusb.
1851         (ccid_get_atr): Handle short messages.
1852
1853         * apdu.c (my_rapdu_get_status): Implemented.
1854
1855 2004-07-27  Moritz Schulte  <moritz@g10code.com>
1856
1857         * apdu.c: Include <signal.h>.
1858
1859         * Makefile.am: Use @DL_LIBS@ instead of -ldl.
1860
1861 2004-07-22  Werner Koch  <wk@g10code.de>
1862
1863         * Makefile.am: Make OpenSC lib link after libgcrypt. Do not link
1864         to pth.
1865         * apdu.c: Don't use Pth if we use OpenSC.
1866         * sc-investigate.c, scdaemon.c: Disable use of pth if OpenSC is used.
1867
1868         * scdaemon.c (main): Bumbed thread stack size up to 512k.
1869
1870 2004-07-16  Werner Koch  <wk@gnupg.org>
1871
1872         * apdu.c (reader_table_s):  Add function pointers for the backends.
1873         (apdu_close_reader, apdu_get_status, apdu_activate)
1874         (send_apdu): Make use of them.
1875         (new_reader_slot): Intialize them to NULL.
1876         (dump_ccid_reader_status, ct_dump_reader_status): New.
1877         (dump_pcsc_reader_status): New.
1878         (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1879         (open_osc_reader, open_rapdu_reader): Intialize function pointers.
1880         (ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu)
1881         (error_string): Removed.  Replaced by apdu_strerror.
1882         (get_ccid_error_string): Removed.
1883         (ct_activate_card): Remove the unused loop.
1884         (reset_ct_reader): Implemented.
1885         (ct_send_apdu): Activate the card if not yet done.
1886         (pcsc_send_apdu): Ditto.
1887
1888 2004-07-15  Werner Koch  <wk@gnupg.org>
1889
1890         * ccid-driver.h: Add error codes.
1891         * ccid-driver.c: Implement more or less proper error codes all
1892         over the place.
1893
1894         * apdu.c (apdu_send_direct): New.
1895         (get_ccid_error_string): Add some error code mappings.
1896         (send_apdu): Pass error codes along for drivers already supporting
1897         them.
1898         (host_sw_string): New.
1899         (get_ccid_error_string): Use above.
1900         (send_apdu_ccid): Reset the reader if it has not yet been done.
1901         (open_ccid_reader): Don't care if the ATR can't be read.
1902         (apdu_activate_card): New.
1903         (apdu_strerror): New.
1904         (dump_reader_status): Only enable it with opt.VERBOSE.
1905         * iso7816.c (map_sw): Add mappings for the new error codes.
1906
1907 2004-07-02  Werner Koch  <wk@gnupg.org>
1908
1909         * apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
1910         (reset_ccid_reader, open_osc_reader): Call dump_reader_status only
1911         in verbose mode.
1912
1913 2004-07-01  Werner Koch  <wk@gnupg.org>
1914
1915         * sc-investigate.c: Initialize Pth which is now required.
1916         (interactive_shell): New command "readpk".
1917
1918         * app-openpgp.c (do_getattr): Fix for sending CA-FPR.
1919
1920 2004-06-30  Werner Koch  <wk@gnupg.org>
1921
1922         * app-openpgp.c (app_openpgp_readkey): Fixed check for valid
1923         exponent.
1924
1925 2004-06-18  Werner Koch  <wk@g10code.com>
1926
1927         * sc-investigate.c (my_read_line): Renamed from read_line.
1928
1929 2004-06-16  Werner Koch  <wk@gnupg.org>
1930
1931         * apdu.c (osc_get_status): Fixed type in function name. Noted by
1932         Axel Thimm.  Yes, I didn't tested it with OpenSC :-(.
1933
1934 2004-04-28  Werner Koch  <wk@gnupg.org>
1935
1936         * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
1937
1938 2004-04-27  Werner Koch  <wk@gnupg.org>
1939
1940         * app-common.h: Do not include ksba.h for gnupg 1.
1941
1942 2004-04-26  Werner Koch  <wk@gnupg.org>
1943
1944         * app-common.h: New members FNC.DEINIT and APP_LOCAL.
1945         * app.c (release_application): Call new deconstructor.
1946         * app-openpgp.c (do_deinit): New.
1947         (get_cached_data, flush_cache_item, flush_cache_after_error)
1948         (flush_cache): New.
1949         (get_one_do): Replaced arg SLOT by APP.  Make used of cached data.
1950         (verify_chv2, verify_chv3): Flush some cache item after error.
1951         (do_change_pin): Ditto.
1952         (do_sign): Ditto.
1953         (do_setattr): Flush cache item.
1954         (do_genkey): Flush the entire cache.
1955         (compare_fingerprint): Use cached data.
1956
1957         * scdaemon.c (main): Do the last change the usual way. This is so
1958         that we can easily test for versioned config files above.
1959
1960 2004-04-26  Marcus Brinkmann  <marcus@g10code.de>
1961
1962         * scdaemon.c (main): For now, always print default filename for
1963         --gpgconf-list, and never /dev/null.
1964
1965 2004-04-21  Werner Koch  <wk@gnupg.org>
1966
1967         * command.c (scd_update_reader_status_file): Send a signal back to
1968         the client.
1969         (option_handler): Parse the new event-signal option.
1970
1971         * scdaemon.c (handle_signal): Do not use SIGUSR{1,2} anymore for
1972         changing the verbosity.
1973
1974 2004-04-20  Werner Koch  <wk@gnupg.org>
1975
1976         * command.c (scd_update_reader_status_file): Write status files.
1977
1978         * app-help.c (app_help_read_length_of_cert): Fixed calculation of
1979         R_CERTOFF.
1980
1981         * pcsc-wrapper.c: New.
1982         * Makefile.am (pkglib_PROGRAMS): Install it here.
1983         * apdu.c (writen, readn): New.
1984         (open_pcsc_reader, pcsc_send_apdu, close_pcsc_reader): Use the
1985         pcsc-wrapper if we are using Pth.
1986         (apdu_send_le): Reinitialize RESULTLEN.  Handle SW_EOF_REACHED
1987         like SW_SUCCESS.
1988
1989 2004-04-19  Werner Koch  <wk@gnupg.org>
1990
1991         * ccid-driver.c (parse_ccid_descriptor): Store some of the reader
1992         features away.  New arg HANDLE
1993         (read_device_info): New arg HANDLE. Changed caller.
1994         (bulk_in): Handle time extension requests.
1995         (ccid_get_atr): Setup parameters and the IFSD.
1996         (compute_edc): New. Factored out code.
1997         (ccid_transceive): Use default NADs when required.
1998
1999 2004-04-14  Werner Koch  <wk@gnupg.org>
2000
2001         * scdaemon.h (server_control_s): Add member READER_SLOT.
2002         * scdaemon.c (scd_init_default_ctrl): Initialize READER_SLOT to -1.
2003         * command.c (open_card): Reuse an open slot.
2004         (reset_notify): Just reset the slot if supported by the reader.
2005         (do_reset): Factored code from above out.
2006         (scd_command_handler): Use it for cleanup.
2007
2008         * apdu.h: New pseudo stati SW_HOST_NOT_SUPPORTED,
2009         SW_HOST_LOCKING_FAILED and SW_HOST_BUSY.
2010         * iso7816.c (map_sw): Map it.
2011
2012         * ccid-driver.c (ccid_slot_status): Add arg STATUSBITS.
2013         * apdu.c (apdu_get_status): New.
2014         (ct_get_status, pcsc_get_status, ocsc_get_status): New stubs.
2015         (get_status_ccid): New.
2016         (apdu_reset): New.
2017         (reset_ct_reader, reset_pcsc_reader, reset_osc_reader): New stubs.
2018         (reset_ccid_reader): New.
2019         (apdu_enum_reader): New.
2020
2021         * apdu.c (lock_slot, trylock_slot, unlock_slot): New helpers.
2022         (new_reader_slot) [USE_GNU_PTH]: Init mutex.
2023         (apdu_reset, apdu_get_status, apdu_send_le): Run functions
2024         in locked mode.
2025
2026         * command.c (scd_update_reader_status_file): New.
2027         * scdaemon.c (handle_tick): Call it.
2028
2029 2004-04-13  Werner Koch  <wk@gnupg.org>
2030
2031         * scdaemon.c: Convert to a Pth application.
2032         (handle_signal, ticker_thread, handle_tick): New.
2033         (main): Fire up the ticker thread in server mode.
2034
2035 2004-03-23  Werner Koch  <wk@gnupg.org>
2036
2037         * scdaemon.c (main) <gpgconf_list>: Fixed output for pcsc_driver.
2038
2039 2004-03-17  Werner Koch  <wk@gnupg.org>
2040
2041         * tlv.c (parse_ber_header): Do not check for tag overflow - it
2042         does not make sense.  Simplified the check for length overflow.
2043
2044         * scdaemon.c (main) <gpgconf>: Fixed default value quoting.
2045
2046 2004-03-16  Werner Koch  <wk@gnupg.org>
2047
2048         * app-dinsig.c: Implemented. Based on app-nks.c and card-dinsig.c
2049         * app-nks.c (get_length_of_cert): Removed.
2050         * app-help.c: New.
2051         (app_help_read_length_of_cert): New.  Code taken from above.  New
2052         optional arg R_CERTOFF.
2053
2054         * card-dinsig.c: Removed.
2055         * card.c (card_get_serial_and_stamp): Do not bind to the old and
2056         never finsiged card-dinsig.c.
2057
2058         * iso7816.c (iso7816_read_binary): Allow for an NMAX > 254.
2059
2060 2004-03-11  Werner Koch  <wk@gnupg.org>
2061
2062         * scdaemon.h (out_of_core): Removed.  Replaced callers by standard
2063         gpg_error function.
2064
2065         * apdu.c, iso7816.c, ccid-driver.c [GNUPG_SCD_MAIN_HEADER]: Allow
2066         to include a header defined by the compiler.  This helps us to
2067         reuse the source in other software.
2068
2069 2004-03-10  Werner Koch  <wk@gnupg.org>
2070
2071         * iso7816.c (iso7816_read_record): New arg SHORT_EF.  Changed all
2072         callers.
2073
2074 2004-02-18  Werner Koch  <wk@gnupg.org>
2075
2076         * sc-investigate.c (main): Setup the used character set.
2077         * scdaemon.c (main): Ditto.
2078
2079         * scdaemon.c (set_debug): New.  Add option --debug-level.
2080         (main): Add option --gpgconf-list.
2081
2082 2004-02-12  Werner Koch  <wk@gnupg.org>
2083
2084         * Makefile.am: Include cmacros.am for common flags.
2085
2086 2004-01-29  Werner Koch  <wk@gnupg.org>
2087
2088         * command.c (reset_notify): Release the application context and
2089         close the reader.
2090
2091 2004-01-28  Werner Koch  <wk@gnupg.org>
2092
2093         * iso7816.c (iso7816_manage_security_env): New.
2094         (iso7816_decipher): Add PADIND argument.
2095
2096 2004-01-27  Werner Koch  <wk@gnupg.org>
2097
2098         * command.c (cmd_readcert, cmd_readkey): Work on a copy of LINE.
2099
2100         * app-common.h (app_ctx_s): Added readcert field.
2101         * app.c (app_readcert): New.
2102         * tlv.c (parse_ber_header): Added; taken from libksba.
2103
2104 2004-01-26  Werner Koch  <wk@gnupg.org>
2105
2106         * card.c (map_sc_err): Use SCD as the error source.
2107
2108         * command.c (open_card): ADD arg NAME to allow requesting a
2109         specific application.  Changed all callers.
2110         (cmd_serialno): Allow optional argument to select the desired
2111         application.
2112
2113         * app-nks.c: New.
2114
2115         * scdaemon.h (opt): Add READER_PORT.
2116         * scdaemon.c (main): Set it here.
2117         * app.c (app_set_default_reader_port): Removed.
2118         (select_application): Add NAME arg and figure out a
2119         default serial number from the GDO. Add SLOT arg and remove all
2120         reader management.
2121         (release_application): New.
2122         (app_write_learn_status): Output an APPTYPE status line.
2123         * command.c (open_card): Adapt for select_application change.
2124         * app-openpgp.c (app_select_openpgp): Removed SN and SNLEN args
2125         and set it directly.  Changed all callers.
2126
2127 2004-01-25  Werner Koch  <wk@gnupg.org>
2128
2129         * iso7816.c (iso7816_select_application): P1 kludge for OpenPGP
2130         card.
2131         * app-openpgp.c (find_tlv): Factor out this function to ..
2132         * tlv.c, tlv.h: .. new.
2133
2134         * scdaemon.h: Introduced app_t and ctrl_t as the new types for APP
2135         and CTRL.
2136
2137 2004-01-21  Werner Koch  <wk@gnupg.org>
2138
2139         * apdu.c (apdu_send_le): Treat SW_EOF_REACHED as a warning.
2140
2141 2004-01-20  Werner Koch  <wk@gnupg.org>
2142
2143         * iso7816.c (iso7816_read_binary): New.
2144         (iso7816_select_file): New.
2145         (iso7816_list_directory): New.
2146
2147         * sc-investigate.c: Add option -i.
2148         (select_app, read_line, interactive_shell): New.
2149
2150 2004-01-16  Werner Koch  <wk@gnupg.org>
2151
2152         * apdu.h: Add SW_FILE_NOT_FOUND.
2153         * iso7816.c (map_sw): Map it to GPG_ERR_ENOENT.
2154         * iso7816.c (iso7816_select_file): New.
2155
2156         * app-dinsig.c: New file w/o any real code yet.
2157         * Makefile.am (scdaemon_SOURCES,sc_investigate_SOURCES): Add file.
2158
2159         * sc-investigate.c: Add option --disable-ccid.
2160
2161 2003-12-19  Werner Koch  <wk@gnupg.org>
2162
2163         * apdu.c (apdu_send_le): Send a get_response with the indicated
2164         length and not the 64 bytes we used for testing.
2165
2166         * app-openpgp.c (verify_chv2, verify_chv3, do_sign): Check the
2167         minimum length of the passphrase, so that we don't need to
2168         decrement the retry counter.
2169
2170 2003-12-17  Werner Koch  <wk@gnupg.org>
2171
2172         * card-p15.c (p15_enum_keypairs): Replaced KRC by RC.
2173         * card-dinsig.c (dinsig_enum_keypairs): Ditto.
2174
2175 2003-12-16  Werner Koch  <wk@gnupg.org>
2176
2177         * scdaemon.c (main): Set the prefixes for assuan logging.
2178
2179 2003-11-17  Werner Koch  <wk@gnupg.org>
2180
2181         * scdaemon.c, scdaemon.h: New options --allow-admin and --deny-admin.
2182         * app-openpgp.c (verify_chv3): Check it here.
2183
2184 2003-11-12  Werner Koch  <wk@gnupg.org>
2185
2186         Adjusted for API changes in Libksba.
2187
2188 2003-10-30  Werner Koch  <wk@gnupg.org>
2189
2190         * apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
2191         (get_ccid_error_string): New.  Not very useful messages, though.
2192
2193 2003-10-25  Werner Koch  <wk@gnupg.org>
2194
2195         * ccid-driver.c (ccid_open_reader): Return an error if no USB
2196         devices are found.
2197
2198         * command.c (cmd_genkey, cmd_passwd): Fixed faulty use of
2199         !spacep().
2200
2201         * apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
2202
2203 2003-10-20  Werner Koch  <wk@gnupg.org>
2204
2205         * command.c (cmd_checkpin): New.
2206         (register_commands): Add command CHECKPIN.
2207         * app.c (app_check_pin): New.
2208         * app-openpgp.c (check_against_given_fingerprint): New. Factored
2209         out that code elsewhere.
2210         (do_check_pin): New.
2211
2212 2003-10-10  Werner Koch  <wk@gnupg.org>
2213
2214         * ccid-driver.c (ccid_close_reader): New.
2215
2216         * apdu.c (close_ccid_reader, close_ct_reader, close_csc_reader)
2217         (close_osc_reader, apdu_close_reader): New.  Not all are properly
2218         implemented yet.
2219
2220 2003-10-09  Werner Koch  <wk@gnupg.org>
2221
2222         * ccid-driver.c (ccid_transceive): Add T=1 chaining for sending.
2223
2224 2003-10-08  Werner Koch  <wk@gnupg.org>
2225
2226         * app-openpgp.c (do_getattr): Support SERIALNO and AID.
2227
2228 2003-10-01  Werner Koch  <wk@gnupg.org>
2229
2230         * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
2231         * apdu.c: Ditto.
2232         * app-openpgp.c: Ditto.
2233         * iso7816.c: Ditto.
2234         (generate_keypair): Renamed to ..
2235         (do_generate_keypair): .. this.
2236         * app-common.h [GNUPG_MAJOR_VERSION]: New.
2237         * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
2238
2239 2003-09-30  Werner Koch  <wk@gnupg.org>
2240
2241         * command.c (cmd_getattr): New command GETATTR.
2242         * app.c (app_setattr): New.
2243         (do_getattr): New.
2244         (do_learn_status): Reimplemented in terms of do_getattr.
2245
2246         * app-openpgp.c (do_change_pin): Make sure CVH1 and CHV2 are
2247         always synced.
2248         (verify_chv2, verify_chv3): New. Factored out common code.
2249         (do_setattr, do_sign, do_auth, do_decipher): Change the names of
2250         the prompts to match that we have only 2 different PINs.
2251         (app_select_openpgp): Check whether the card enforced CHV1.
2252         (convert_sig_counter_value): New. Factor out code from
2253         get_sig_counter.
2254
2255 2003-09-28  Werner Koch  <wk@gnupg.org>
2256
2257         * app-openpgp.c (dump_all_do): Use gpg_err_code and not gpg_error.
2258
2259 2003-09-19  Werner Koch  <wk@gnupg.org>
2260
2261         * ccid-driver.c (parse_ccid_descriptor): New.
2262         (read_device_info): New.
2263         (ccid_open_reader): Check that the device has all required features.
2264
2265 2003-09-06  Werner Koch  <wk@gnupg.org>
2266
2267         * scdaemon.c (main): --pcsc-driver again defaults to pcsclite.
2268         David Corcoran was so kind to remove the GPL incompatible
2269         advertisng clause from pcsclite.
2270         * apdu.c (apdu_open_reader): Actually make pcsc-driver option work.
2271
2272 2003-09-05  Werner Koch  <wk@gnupg.org>
2273
2274         * ccid-driver.c: More work, data can now actually be retrieved.
2275         * ccid-driver.c, ccid-driver.h: Alternativley allow use under BSD
2276         conditions.
2277
2278 2003-09-02  Werner Koch  <wk@gnupg.org>
2279
2280         * scdaemon.c, scdaemon.h: New option --pcsc-ccid.
2281         * ccid-driver.c, ccid-driver.h: New but far from being useful.
2282         * Makefile.am: Add above.
2283         * apdu.c: Add support for that ccid driver.
2284
2285 2003-08-26  Timo Schulz  <twoaday@freakmail.de>
2286
2287         * apdu.c (new_reader_slot): Only set 'is_osc' when OpenSC
2288         is used.
2289
2290 2003-08-25  Werner Koch  <wk@gnupg.org>
2291
2292         * command.c (cmd_setattr): Use a copy of LINE.
2293         (cmd_genkey): Use a copy of KEYNO.
2294         (cmd_passwd): Use a copy of CHVNOSTR.
2295         (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): s/strdup/xtrystrdup/.
2296
2297 2003-08-19  Werner Koch  <wk@gnupg.org>
2298
2299         * scdaemon.c, scdaemon.h: New option --pcsc-driver.
2300         * apdu.c (apdu_open_reader): Use that option here instead of a
2301         hardcoded one.
2302
2303 2003-08-18  Werner Koch  <wk@gnupg.org>
2304
2305         * Makefile.am: Add OPENSC_LIBS to all programs.
2306
2307         * scdaemon.c, scdaemon.h: New option --disable-opensc.
2308         * card.c (card_open): Implement it.
2309         * apdu.c (open_osc_reader, osc_send_apdu): New.
2310         (apdu_open_reader) [HAVE_OPENSC]: Use the opensc driver if not
2311         disabled.
2312         (error_string) [HAVE_OPENSC]: Use sc_strerror.
2313         (send_apdu) [HAVE_OPENSC]: Call osc_apdu_send.
2314
2315         * card-p15.c (p15_enum_keypairs, p15_prepare_key): Adjusted for
2316         libgpg-error.
2317
2318 2003-08-14  Timo Schulz  <twoaday@freakmail.de>
2319
2320         * apdu.c (ct_activate_card): Change the code a little to avoid
2321         problems with other readers.
2322         * Always use 'dynload.h' instead of 'dlfcn.h'.
2323
2324 2003-08-05  Werner Koch  <wk@gnupg.org>
2325
2326         * app-openpgp.c (dump_all_do): Don't analyze constructed DOs after
2327         an error.
2328
2329 2003-08-04  Werner Koch  <wk@gnupg.org>
2330
2331         * app.c (app_set_default_reader_port): New.
2332         (select_application): Use it here.
2333         * scdaemon.c (main): and here.
2334         * sc-copykeys.c: --reader-port does now take a string.
2335         * sc-investigate.c, scdaemon.c: Ditto.
2336         * apdu.c (apdu_open_reader): Ditto.  Load pcsclite if no ctapi
2337         driver is configured.  Always include code for ctapi.
2338         (new_reader_slot): Don't test for already used ports and remove
2339         port arg.
2340         (open_pcsc_reader, pcsc_send_apdu, pcsc_error_string): New.
2341         (apdu_send_le): Changed RC to long to cope with PC/SC.
2342
2343         * scdaemon.c, scdaemon.h: New option --ctapi-driver.
2344         * sc-investigate.c, sc-copykeys.c: Ditto.
2345
2346 2003-07-31  Werner Koch  <wk@gnupg.org>
2347
2348         * Makefile.am (scdaemon_LDADD): Added INTLLIBS.
2349
2350 2003-07-28  Werner Koch  <wk@gnupg.org>
2351
2352         * app-openpgp.c (do_setattr): Change implementation.  Allow all
2353         useful DOs.
2354
2355 2003-07-27  Werner Koch  <wk@gnupg.org>
2356
2357         Adjusted for gcry_mpi_print and gcry_mpi_scan API change.
2358
2359 2003-07-24  Werner Koch  <wk@gnupg.org>
2360
2361         * app-openpgp.c (do_learn_status): Print more status information.
2362         (app_select_openpgp): Store the card version.
2363         (store_fpr): Add argument card_version and fix DOs for old cards.
2364         (app_openpgp_storekey): Likewise.
2365
2366 2003-07-23  Werner Koch  <wk@gnupg.org>
2367
2368         * command.c (cmd_pkauth): New.
2369         (cmd_setdata): Check whether data was given at all to avoid
2370         passing 0 to malloc.
2371
2372         * app.c (app_auth): New.
2373         * app-openpgp.c (do_auth): New.
2374
2375 2003-07-22  Werner Koch  <wk@gnupg.org>
2376
2377         * command.c (cmd_passwd): New.
2378         * app.c (app_change_pin): New.
2379         * app-openpgp.c (do_change_pin): New.
2380         * iso7816.c (iso7816_reset_retry_counter): Implemented.
2381
2382         * sc-investigate.c (main): New option --gen-random.
2383         * iso7816.c (iso7816_get_challenge): Don't create APDUs with a
2384         length larger than 255.
2385
2386 2003-07-17  Werner Koch  <wk@gnupg.org>
2387
2388         * command.c (cmd_random): New command RANDOM.
2389
2390         * iso7816.c (map_sw): New. Use it in this file to return
2391         meaningful error messages.  Changed all public fucntions to return
2392         a gpg_error_t.
2393         (iso7816_change_reference_data): New.
2394         * apdu.c (apdu_open_reader): Use faked status words for soem
2395         system errors.
2396
2397 2003-07-16  Werner Koch  <wk@gnupg.org>
2398
2399         * apdu.c (apdu_send_simple): Use apdu_send_le so that we can
2400         specify not to send Le as it should be.
2401
2402 2003-07-15  Werner Koch  <wk@gnupg.org>
2403
2404         * Makefile.am: Add sc-copykeys program.
2405         * sc-copykeys.c: New.
2406         * app-openpgp.c (app_openpgp_storekey): New.
2407         (app_openpgp_cardinfo): New.
2408         (count_bits): New.
2409         (store_fpr): And use it here to get the actual length in bit.
2410
2411 2003-07-03  Werner Koch  <wk@gnupg.org>
2412
2413         * app-openpgp.c (do_setattr): Add setting of the URL.
2414         (app_select_openpgp): Dump card data only in very verbose mode.
2415         (do_decipher): New.
2416
2417 2003-07-02  Werner Koch  <wk@gnupg.org>
2418
2419         * app-openpgp.c (get_sig_counter): New.
2420         (do_sign): Print the signature counter and enable the PIN callback.
2421         (do_genkey): Implement the PIN callback.
2422
2423 2003-07-01  Werner Koch  <wk@gnupg.org>
2424
2425         * app-openpgp.c (store_fpr): Fixed fingerprint calculation.
2426
2427 2003-06-26  Werner Koch  <wk@gnupg.org>
2428
2429         * app-openpgp.c (find_tlv): Fixed length header parsing.
2430
2431         * app.c (app_genkey): New.
2432         * command.c (cmd_genkey): New.
2433
2434 2003-06-25  Werner Koch  <wk@gnupg.org>
2435
2436         * command.c (percent_plus_unescape): New.
2437         (cmd_setattr): New.
2438
2439 2003-06-24  Werner Koch  <wk@gnupg.org>
2440
2441         * command.c (send_status_info): New.
2442
2443         * app-openpgp.c (app_select_openpgp): Replace SLOT arg by APP arg
2444         and setup the function pointers in APP on success. Changed callers.
2445         * app.c: New.
2446         * app-common.h: New.
2447         * scdaemon.h (APP): New type to handle applications.
2448         (server_control_s): Add an APP context field.
2449
2450         * command.c (cmd_serialno): Handle applications.
2451         (cmd_pksign): Ditto.
2452         (cmd_pkdecrypt): Ditto.
2453         (reset_notify): Ditto.
2454         (cmd_learn): For now return error for application contexts.
2455         (cmd_readcert): Ditto.
2456         (cmd_readkey): Ditto.
2457
2458 2003-06-04  Werner Koch  <wk@gnupg.org>
2459
2460         * card.c (map_sc_err): Renamed gpg_make_err to gpg_err_make.
2461
2462         Renamed error codes from INVALID to INV and removed _ERROR suffixes.
2463
2464 2003-06-03  Werner Koch  <wk@gnupg.org>
2465
2466         Changed all error codes in all files to the new libgpg-error scheme.
2467
2468         * scdaemon.h: Include gpg-error.h and errno.h
2469         * card.c (map_sc_err): Use unknown for the error source.
2470         * Makefile.am: Link with libgpg-error
2471
2472 2003-05-14  Werner Koch  <wk@gnupg.org>
2473
2474         * atr.c, atr.h: New.
2475         * sc-investigate.c: Dump the ATR in a human readable format.
2476
2477 2003-05-08  Werner Koch  <wk@gnupg.org>
2478
2479         * scdaemon.h (DBG_CARD_IO_VALUE): New.
2480
2481         * sc-investigate.c: New.
2482         * scdaemon.c (main): Removed --print-atr option.
2483
2484         * iso7816.c, iso7816.h, app-openpgp.c: New.
2485
2486 2003-04-29  Werner Koch  <wk@gnupg.org>
2487
2488         * scdaemon.c: New options --print-atr and --reader-port
2489         * apdu.c, apdu.h: New
2490
2491         * card.c, card-p15.c, card-dinsig.c: Allow build without OpenSC.
2492
2493         * Makefile.am (LDFLAGS): Removed.
2494
2495         * command.c (register_commands): Adjusted for new Assuan semantics.
2496
2497 2002-08-21  Werner Koch  <wk@gnupg.org>
2498
2499         * scdaemon.c (main): New option --daemon so that the program is
2500         not accidently started in the background.
2501
2502 2002-08-16  Werner Koch  <wk@gnupg.org>
2503
2504         * scdaemon.c: Include i18n.h.
2505
2506         * card-common.h (struct p15_private_s): Forward declaration.  Add
2507         it to card_ctx_s.
2508         * card.c (card_close): Make sure private data is released.
2509         (card_enum_certs): New.
2510         * card-p15.c (p15_release_private_data): New.
2511         (init_private_data): New to work around an OpenSC weirdness.
2512         (p15_enum_keypairs): Do an OpenSC get_objects only once.
2513         (p15_enum_certs): New.
2514         (card_p15_bind): Bind new function.
2515         * command.c (cmd_learn): Return information about the certificates.
2516
2517 2002-08-09  Werner Koch  <wk@gnupg.org>
2518
2519         * card.c (card_get_serial_and_stamp): Use the tokeinfo serial
2520         number as a fallback. Add a special prefix for serial numbers.
2521
2522 2002-07-30  Werner Koch  <wk@gnupg.org>
2523
2524         Changes to cope with OpenSC 0.7.0:
2525
2526         * card.c: Removed the check for the packed opensc version.
2527         Changed include file names of opensc.
2528         (map_sc_err): Adjusted error codes for new opensc version.
2529         * card-p15.c: Changed include filename of opensc.
2530         * card-dinsig.c: Ditto.
2531
2532         * card-p15.c (p15_decipher): Add flags argument to OpenSC call.
2533
2534 2002-07-24  Werner Koch  <wk@gnupg.org>
2535
2536         * card.c (find_simple_tlv, find_iccsn): New.
2537         (card_get_serial_and_stamp): Improved serial number parser.
2538
2539 2002-06-27  Werner Koch  <wk@gnupg.org>
2540
2541         * scdaemon.c (main): Use GNUPG_DEFAULT_HOMEDIR constant.
2542
2543 2002-06-15  Werner Koch  <wk@gnupg.org>
2544
2545         * card-dinsig.c: Documented some stuff from the DIN norm.
2546
2547 2002-04-15  Werner Koch  <wk@gnupg.org>
2548
2549         * command.c (cmd_pksign, cmd_pkdecrypt): Use a copy of the key ID.
2550
2551 2002-04-12  Werner Koch  <wk@gnupg.org>
2552
2553         * scdaemon.c: New option --debug-sc N.
2554         * card.c (card_open): set it here.
2555
2556         * card-p15.c (p15_prepare_key): Factored out common code from ...
2557         (p15_sign, p15_decipher): here and made the decryption work the
2558         regular way.
2559
2560 2002-04-10  Werner Koch  <wk@gnupg.org>
2561
2562         * card.c (card_open): Return immediately when no reader is available.
2563
2564 2002-03-27  Werner Koch  <wk@gnupg.org>
2565
2566         * card.c (card_open, card_close): Adjusted for changes in OpenSC.
2567
2568 2002-03-10  Werner Koch  <wk@gnupg.org>
2569
2570         * card-p15.c, card-dinsig.c, card-common.h: New.
2571         * card.c: Factored most code out to the new modules, so that we
2572         can better support different types of card applications.
2573
2574 2002-01-26  Werner Koch  <wk@gnupg.org>
2575
2576         * scdaemon.c scdaemon.h, command.c: New. Based on the code from
2577         the gpg-agent.
2578
2579
2580  Copyright 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
2581
2582  This file is free software; as a special exception the author gives
2583  unlimited permission to copy and/or distribute it, with or without
2584  modifications, as long as this notice is preserved.
2585
2586  This file is distributed in the hope that it will be useful, but
2587  WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
2588  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2589
2590 Local Variables:
2591 buffer-read-only: t
2592 End: