1 2002-06-04 Marcus Brinkmann <marcus@g10code.de>
3 * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
5 2002-06-03 Marcus Brinkmann <marcus@g10code.de>
7 * key.c: Include <ctype.h>.
8 (_gpgme_key_append_name): Skip one more char when
9 processing escaped char. Submitted by Marc Mutz <mutz@kde.org>.
10 Handle hexadecimal encodings. Also reported by Marc. Thanks!
12 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
14 * ath.h: Enable the _gpgme_ prefix. Fix all those prefix macros.
15 * posix-sema.c: Use that prefix here.
16 * posix-io.c: Include "ath.h".
17 (_gpgme_io_read): Use _gpgme_ath_read instead read.
18 (_gpgme_io_write): Use _gpgme_ath_write instead write.
19 (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
20 (_gpgme_io_select): Use _gpgme_ath_select instead select.
22 2002-06-02 Marcus Brinkmann <marcus@g10code.de>
24 * Makefile.am (ath_components): New variable.
25 (ath_components_pthread): Likewise.
26 (ath_components_pth): Likewise.
27 (system_components): Add ath_componentes.
31 * ath-pthread.c: Likewise.
32 * ath-pth.c: Likewise.
33 * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
35 * mutex.h: Remove file.
37 2002-05-30 Werner Koch <wk@gnupg.org>
39 * key.c (gpgme_key_get_string_attr): Return NULL when asking for
40 an issuer with IDX > 0. We don't support altIssuerNames for now.
42 2002-05-22 Werner Koch <wk@gnupg.org>
44 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
45 missing variable definition. Oohh - Marcus was faster.
47 2002-05-22 Marcus Brinkmann <marcus@gnu.org>
49 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
51 2002-05-21 Werner Koch <wk@gnupg.org>
53 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
54 (_gpgme_gpgsm_op_keylist_ext): Pass the keylist mode to gpgsm.
56 2002-05-10 Werner Koch <wk@gnupg.org>
58 * key.h (gpgme_key_s): Add OTRUST.
59 * keylist.c (set_ownertrust): New.
60 (keylist_colon_handler): Get the ownertrust value
61 * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
64 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
66 * w32-util.c: New static variable GET_PATH_LOCK.
67 (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
68 Take lock while determining path.
69 (_gpgme_get_gpgsm_path): Likewise.
70 * version.c (do_subsystem_inits): Set DONE to 1 after
72 (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK. Take lock
73 while determining engine info.
74 * rungpg.c (_gpgme_gpg_get_version): New variable
75 GPG_VERSION_LOCK. Take the lock while determining the program
77 * posix-io.c: Include "sema.h".
78 (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK. Take the lock
79 while fixing the signals.
80 (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
81 * key.c: Include "sema.h". New globals KEY_CACHE_LOCK and
83 (capabilities_to_string): Make STRINGS very const.
84 (_gpgme_key_cache_add): Lock the key cache.
85 (_gpgme_key_cache_get): Likewise.
86 (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
87 * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
88 IMPORT_RES_FIELDS very const. Make FIELD and FIELD_NAME a litle
90 * engine.c (_gpgme_engine_get_info): New variable
91 ENGINE_INFO_LOCK. Take lock while determining engine info.
92 * engine-gpgsm.c: Include "sema.h".
93 (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK. Take
94 lock while getting program version.
96 2002-05-08 Marcus Brinkmann <marcus@g10code.de>
99 * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
100 * util.h: Removed all prototypes and declarations related to
101 debugging. Include "debug.h".
103 * debug.c (debug_level): Comment variable and remove superfluous
106 (_gpgme_debug_enabled): Function removed.
107 (struct debug_control_s): Definition removed.
108 (_gpgme_debug_level): Function removed.
109 (_gpgme_debug_begin): Rewritten to use vasprintf. Accept a
110 pritnf-style format specification and a variable number of
112 (_gpgme_debug_add): Rewritten using vasprintf. Expect that format
113 starts out with "%s" for simplicity.
114 (_gpgme_debug_end): Rewritten using vasprintf. Do not accept a
115 TEXT argument anymore.
117 * posix-io.c (_gpgme_io_select): Use new level argument for
118 DEBUG_BEGIN instead explicit if construct.
120 * debug.c (debug_init): Remove superfluous zero initializer,
121 remove volatile flag of INITIALIZED. Do not use the
122 double-checked locking algorithm, it is fundamentally flawed and
123 will empty your fridge (on a more serious note, despite the
124 volatile flag it doesn't give you the guarantee you would expect,
125 for example on a DEC Alpha or an SMP machine. The volatile only
126 serializes accesses to the volatile variable, but not to the other
129 2002-05-03 Werner Koch <wk@gnupg.org>
131 * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
134 * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
135 * gpgme.c (gpgme_get_protocol): New.
137 * data.c (gpgme_data_write): Changed type of BUFFER to void*.
138 (gpgme_data_read): Ditto.
140 * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
141 lines so that a claim can be made without looking up the key.
142 (gpgme_get_sig_string_attr): New.
143 (gpgme_get_sig_ulong_attr): New.
145 * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
147 * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
148 list to align with the status.h file from gnupg.
150 * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
151 * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
152 these new status codes. Store the expiration time
154 2002-04-27 Werner Koch <wk@gnupg.org>
156 * gpgme.h (GpgmeData_Encoding): New.
157 * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
158 * engine-gpgsm.c (map_input_enc): New. Use it in all local
159 functions where the INPUT command gets send.
161 2002-04-27 Marcus Brinkmann <marcus@g10code.de>
163 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
164 descriptor only when we don't need it anymore. Close the message
165 descriptor if we don't need it.
167 2002-04-26 Werner Koch <wk@gnupg.org>
169 * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
171 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
173 * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
174 GPG->cmd.cb_data, not xfree.
176 2002-04-25 Marcus Brinkmann <marcus@g10code.de>
178 * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
179 ttytype, lc_ctype and lc_messages options in the server.
181 2002-04-24 Marcus Brinkmann <marcus@g10code.de>
183 * engine-gpgsm.c (map_assuan_error): Add new error codes.
185 2002-04-23 Werner Koch <wk@gnupg.org>
187 * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
188 can_certify to return the requested values.
190 2002-04-23 Marcus Brinkmann <marcus@g10code.de>
192 * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
194 (gpgme_get_passphrase_cb): Likewise.
196 2002-04-22 Marcus Brinkmann <marcus@g10code.de>
198 * gpgme.c (gpgme_get_passphrase_cb): New function.
199 (gpgme_get_progress_cb): New function.
200 * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
201 gpgme_get_progress_cb.
203 2002-03-28 Werner Koch <wk@gnupg.org>
205 * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
206 * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
207 * keylist.c (keylist_colon_handler): Store them.
208 * key.c (gpgme_key_release): Free them.
209 (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
211 2002-03-26 Werner Koch <wk@gnupg.org>
213 * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
215 2002-03-21 Werner Koch <wk@gnupg.org>
217 * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
220 2002-03-18 Marcus Brinkmann <marcus@g10code.de>
222 * Makefile.am (system_components): New variable, set depending on
224 (libgpgme_la_SOURCES): Use system_components. Remove `syshdr.h'.
225 * syshdr.h: File removed.
227 * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard. Clean up source.
228 * posix-sema.c: Likewise.
229 * posix-util.c: Likewise.
231 * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
232 * w32-sema.c: Likewise.
233 * w32-util.c: Likewise.
235 * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
236 * posix-sema.c: Likewise.
237 * w32-io.c: Include `io.h', do not include `syshdr.h'
238 * w32-sema.c: Likewise.
239 * w32-util.c: Likewise.
240 * data.c: Do not include `syshdr.h'.
242 * wait.h: Code cleanup.
245 * posix-sema.c: Implement.
247 2002-03-08 Werner Koch <wk@gnupg.org>
249 * util.h [!HAVE_FOPENCOOKIE]: Fixed type. Thanks to Frank Heckenbach.
251 2002-03-07 Werner Koch <wk@gnupg.org>
253 * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
255 2002-03-06 Marcus Brinkmann <marcus@g10code.de>
257 * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
258 (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
259 is null, and if it is set, use _gpgme_encrypt_sym_status_handler
260 as status handler and run _gpgme_passphrase_start.
261 * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
263 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
266 * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
268 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
270 * passphrase.c (_gpgme_passphrase_status_handler): Also set the
271 error No_Passphrase if only a bad passphrase was provided.
273 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
275 * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
276 GPGME_DATA_MODE_IN, construct a command line that stores the
278 * verify.c (gpgme_op_verify_start): Accept TEXT being
279 uninitialized, and in this case interpret SIG as a normal or
280 cleartext signature and TEXT as a return data object.
281 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
283 2002-03-03 Marcus Brinkmann <marcus@g10code.de>
285 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
288 2002-02-28 Werner Koch <wk@gnupg.org>
290 * key.h (subkey_s): New member expires_at.
291 * keylist.c (keylist_colon_handler): Set it here
292 * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
294 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
296 * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
297 * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
298 * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
299 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
300 * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
301 * engine.c (_gpgme_engine_op_keylist_ext): New function.
302 * keylist.c (gpgme_op_keylist_ext_start): New function.
304 2002-02-27 Marcus Brinkmann <marcus@g10code.de>
306 * gpgme.h: Add new error code GPGME_Invalid_Recipient.
307 * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
308 rename no_recipients to no_valid_recipients.
309 (_gpgme_encrypt_status_handler): Include error for invalid
311 * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
312 argument to GpgsmObject. Use that to report back the status about
315 2002-02-26 Marcus Brinkmann <marcus@g10code.de>
317 * verify.c (_gpgme_verify_status_handler): Fix the last change.
319 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
321 * engine.c (_gpgme_engine_op_encrypt_sign): New function.
322 * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
323 * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
324 (_gpgme_gpg_op_sign): Use that new function.
325 (_gpgme_gpg_op_encrypt_sign): New function.
326 * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype.
327 * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
328 (gpgme_op_encrypt_sign): Likewise.
329 * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
330 * ops.h (_gpgme_encrypt_status_handler): Add prototype.
331 (_gpgme_sign_status_handler): Add prototype.
332 * sign.c (sign_status_handler): Rename to ...
333 (_gpgme_sign_status_handler): ... this and make non-static.
334 * encrypt.c (encrypt_status_handler): Rename to ...
335 (_gpgme_encrypt_status_handler): ... this and make non-static.
336 * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
337 * sign.c (gpgme_op_sign_start): Likewise.
339 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
341 * verify.c (_gpgme_verify_status_handler): Parse the args line to
342 see if the problem is due to a missing key, and report that back
345 2002-02-25 Marcus Brinkmann <marcus@g10code.de>
347 * context.h (struct gpgme_context_s): New member include_certs.
348 * gpgme.h (gpgme_set_include_certs): Add prototype.
349 (gpgme_get_include_certs): Likewise.
350 * gpgme.c (gpgme_set_include_certs): New function.
351 (gpgme_get_include_certs): Likewise.
352 (gpgme_new): Set include_certs to 1 (the default).
353 * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
354 and pass it to _gpgme_gpgsm_op_sign.
355 * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
356 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
357 include_certs and handle it.
358 * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
359 * sign.c (gpgme_op_sign_start): Add new argument to
360 _gpgme_engine_op_sign call.
362 2002-02-14 Werner Koch <wk@gnupg.org>
364 * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
366 2002-02-13 Werner Koch <wk@gnupg.org>
368 * vasprintf.c, fopencookie.c: Add replacement functions.
369 * util.h: Add prototypes for them.
371 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
373 * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
374 reach the end of the function.
376 2002-02-09 Marcus Brinkmann <marcus@g10code.de>
378 * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
379 (gpgme_op_genkey_start): Skip newlines after opening tag.
381 * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
383 2002-02-08 Marcus Brinkmann <marcus@g10code.de>
385 * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
386 set, and pass them down to the crypto engine.
387 * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
388 * engine.h: Likewise.
389 * rungpg.h (_gpgme_gpg_spawn): Likewise.
390 * engine.c (_gpgme_engine_op_genkey): Likewise. Use those
392 * rungpg.c (_gpgme_gpg_op_genkey): Likewise. Complain if those
394 * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise. Implement
397 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
399 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
401 * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
404 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
406 * wait.c (gpgme_wait): Add new argument STATUS, in which the
407 status of the returned context is returned.
408 (_gpgme_wait_on_condition): Rework the function a bit, to make it
409 aware of cancelled processes, and to allow to use gpgme_wait with
410 CTX being NULL (as documented in the source).
411 (struct proc_s): New member REPORTED.
412 * gpgme.h: Fix prototype.
413 * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
414 * sign.c (gpgme_op_sign): Likewise.
415 * import.c (gpgme_op_import): Likewise.
416 * genkey.c (gpgme_op_genkey): Likewise.
417 * export.c (gpgme_op_export): Likewise.
418 * encrypt.c (gpgme_op_encrypt): Likewise.
419 * delete.c (gpgme_op_delete): Likewise.
420 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
422 2002-02-06 Marcus Brinkmann <marcus@g10code.de>
424 * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
426 (gpgme_get_keylist_mode): New function.
427 (gpgme_new): Set the default for keylist_mode member of CTX.
429 * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
430 (gpgme_get_keylist_mode): New prototype.
431 (GPGME_KEYLIST_MODE_LOCAL): New macro.
432 (GPGME_KEYLIST_MODE_EXTERN): Likewise..
434 2002-02-02 Marcus Brinkmann <marcus@g10code.de>
436 This patch has gotten a bit large... mmh. The main thing that
437 happens here is that error values are now not determined in the
438 operation function after gpgme_wait completed, but in the status
439 handler when EOF is received. It should always be the case that
440 either an error is flagged or EOF is received, so that after a
441 gpgme_wait you should never have the situation that no error is
442 flagged and EOF is not received. One problem is that the engine
443 status handlers don't have access to the context, a horrible
444 kludge works around this for now. All errors that happen during a
445 pending operation should be catched and reported in ctx->error,
446 including out-of-core and cancellation. This rounds up neatly a
447 couple of loose ends, and makes it possible to pass up any errors
448 in the communication with the backend as well. As a bonus, there
449 will be a function to access gpgme->wait, so that the operations
450 can truly be implemented with their _start function.
452 * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
453 error back to the context.
454 * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
456 * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
458 * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
459 to a value indication that.
461 * verify.c (add_notation): Set error, not out_of_core.
462 (finish_sig): Likewise.
463 (gpgme_op_verify_start): Don't clear out_of_core.
464 (_gpgme_verify_status_handler): At EOF, clean up the notation data.
465 (gpgme_op_verify): And don't do it here.
467 * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
468 (gpgme_op_trustlist_start): Don't clear out_of_core.
469 (gpgme_op_trustlist_next): Check error, not out_of_core.
470 (gpgme_op_trustlist_end): Likewise.
472 * ops.h (test_and_allocate_result): New macro.
473 (_gpgme_passphrase_result): Remove prototype.
474 * delete.c (gpgme_op_delete): Return error from context.
475 (delete_status_handler): Use macro test_and_allocate_result.
476 Perform error checking at EOF.
477 (gpgme_op_delete_start): Release result.
478 * passphrase.c (_gpgme_passphrase_status_handler): Use macro
479 test_and_allocate_result, and perform error checking here.
480 (_gpgme_passphrase_result): Function removed.
481 * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
482 (gpgme_op_sign): Just return the error value from the context.
483 (sign_status_handler): Only progress if no error is set yet. If
484 we process an EOF, set the resulting error value (if any).
485 * decrypt.c (_gpgme_decrypt_result): Function removed.
486 (create_result_struct): Function removed.
487 (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
488 caclulate error on EOF, do not progress with errors.
489 (_gpgme_decrypt_start): Do not set out_of_core to zero.
490 (gpgme_op_decrypt): Just return the error value from the context.
491 * encrypt.c (encrypt_status_handler): Perform the error checking
493 (gpgme_op_encrypt_start): Do not clear out_of_core.
494 * export.c (export_status_handler): Return if error is set in context.
495 (gpgme_op_export_start): Release result.
496 (gpgme_op_export): Return error from context.
497 * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
499 * genkey.c (genkey_status_handler): Use macro
500 test_and_allocate_result. Perform error checking at EOF.
501 (gpgme_op_genkey): Just return the error from context.
502 * import.c (gpgme_op_import): Return the error from context.
503 (import_status_handler): Use macro test_and_allocate_result.
504 * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
505 (gpgme_op_keylist_next): Return error of context.
506 (keylist_colon_handler): Set error instead out_of_code.
507 (finish_key): Likewise.
509 * context.h: Remove member out_of_core, add member error.
510 * gpgme.c (_gpgme_release_result): Clear error flag.
512 * engine.h (_gpgme_engine_get_error): New prototype.
513 * engine.c (_gpgme_engine_get_error): New function.
514 * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
516 * engine-gpgsm.c (map_assuan_error): New function.
517 (gpgsm_assuan_simple_command): Change return type to GpgmeError,
518 use the new function to map error values.
519 (gpgsm_set_fd): Change return type tp GpgmeError.
520 (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
521 (gpgsm_set_recipients): Likewise. Change type of return value
522 equivalently. Adjust error values.
523 (_gpgme_gpgsm_op_import): Likewise.
524 (_gpgme_gpgsm_op_sign): Likewise.
525 (struct gpgsm_object_s): New member error.
526 (gpgsm_status_handler): Set error if error occurs. Determine
527 error number from ERR line received. If assuan_read_line fails,
528 terminate the connection.
530 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
532 * Makefile.am (MOSTLYCLEANFILES): New variable.
534 2002-02-01 Marcus Brinkmann <marcus@g10code.de>
536 * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
537 connection to the server.
539 2002-01-31 Marcus Brinkmann <marcus@g10code.de>
541 * rungpg.h: Add STATUS_KEY_CREATED.
543 * progress.c: New file.
544 * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
546 * genkey.c (genkey_status_handler): Use
547 _gpgme_progress_status_handler. Add check for status.
548 (struct genkey_result_s): New structure.
549 (_gpgme_release_genkey_result): New function.
550 (gpgme_op_genkey): Check for error.
551 * gpgme.c (_gpgme_release_result): Call
552 _gpgme_release_genkey_result.
553 * ops.h (_gpgme_release_genkey_result): Add prototype.
554 * types.h (GenKeyResult): New type.
555 * context.h (gpgme_context_s): Add GenKeyResult to member result.
557 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
559 * gpgme.c (_gpgme_release_result): Call
560 _gpgme_release_delete_result.
561 * ops.h (_gpgme_release_delete_result): Add prototype.
562 * types.h (DeleteResult): New type.
563 * context.h (gpgme_context_s): Add DeleteResult to member result.
565 * delete.c (enum delete_problem): New type.
566 (struct delete_result_s): New structure.
567 (_gpgme_release_delete_result): New function.
568 (delete_status_handler): Implement more status codes.
569 (gpgme_op_delete): Return error on failure.
571 * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
573 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
575 * import.c (struct import_result_s): New structure.
576 (_gpgme_release_import_result): New function.
577 (append_xml_impinfo): Likewise.
578 (import_status_handler): Implement.
579 * gpgme.c (_gpgme_release_result): Add call to
580 _gpgme_release_import_result.
581 * ops.h (_gpgme_release_import_result): Add prototype.
582 * types.h (ImportResult): New type.
583 * context.h (gpgme_context_s): Add ImportResult to member result.
585 * encrypt.c (gpgme_op_encrypt): Code clean up.
587 2002-01-30 Marcus Brinkmann <marcus@g10code.de>
589 * gpgme.h: Add lots of comment and fix the formatting. Add
590 gpgme_trustlist_end prototype.
592 2002-01-29 Marcus Brinkmann <marcus@g10code.de>
594 * gpgme.h: Add new type GpgmeIdleFunc. Change type of
595 gpgme_register_idle to return and accept this type.
596 * wait.c (gpgme_register_idle): Fix type.
597 Save and return old value of idle_function.
599 2002-01-29 Werner Koch <wk@gnupg.org>
601 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
603 * keylist.c (keylist_colon_handler): Add support for the new "crs"
606 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
608 * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
609 not assuan_pipe_disconnect.
611 * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
612 jnlib (needed by assuan) statically into libgpgme. Linking a
613 static library into a shared library this way is not portable.
615 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
617 * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
620 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
622 * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
623 from off_t to size_t.
626 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
628 * wait.c (_gpgme_wait_on_condition): If the process finished,
629 reset the pending flag. Also if the operation was cancelled.
631 (struct proc_s): Rename READY to DONE.
632 (wait_item_s): Likewise.
633 (set_process_ready): Rename to ...
634 (set_process_done): ... this.
635 (_gpgme_remove_proc_from_wait_queue): Call set_process_done
636 instead set_process_ready.
637 (_gpgme_wait_on_condition): Likewise.
638 (do_select): Rename READY to DONE.
640 * verify.c (gpgme_op_verify): Do not set pending to zero here.
641 * sign.c (gpgme_op_sign): Likewise.
642 * import.c (gpgme_op_import): Likewise.
643 * genkey.c (gpgme_op_genkey): Likewise.
644 * export.c (gpgme_op_export): Likewise.
645 * encrypt.c (gpgme_op_encrypt): Likewise.
646 * delete.c (gpgme_op_delete): Likewise.
647 * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
648 * decrypt.c (gpgme_op_decrypt): Likewise.
650 2002-01-22 Marcus Brinkmann <marcus@g10code.de>
654 2002-01-15 Marcus Brinkmann <marcus@g10code.de>
656 * trustlist.c: Various source clean ups.
657 (my_isdigit): Removed.
658 (gpgme_op_trustlist_end): New function.
660 2002-01-13 Marcus Brinkmann <marcus@g10code.de>
662 * gpgme.c: Various source clean ups, like renaming C to CTX where
664 (gpgme_new): Clear R_CTX before starting the work.
665 (my_isdigit): Removed.
666 (my_isxdigit): Likewise.
668 * data.c: Various source clean ups.
669 (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
670 (gpgme_data_new_with_read_cb): Similar for READ_CB.
671 (gpgme_data_new_from_file): Loop over fread while EINTR.
672 (gpgme_data_new_from_filepart): Rediddled a bit. Allow LENGTH to
673 be zero. Loop over fread while EINTR.
675 (my_isdigit): Removed.
676 (my_isxdigit): Likewise.
678 2001-12-21 Marcus Brinkmann <marcus@g10code.de>
680 * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
681 Pipe_Error where appropriate.
683 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
685 * engine.c: Include `string.h'. Reported by Stéphane Corthésy.
687 * version.c (get_engine_info): Remove prototype.
689 2001-12-19 Marcus Brinkmann <marcus@g10code.de>
691 * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
692 Fill it with the servers fds, and pass it to assuan_pipe_connect.
694 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
696 * keylist.c (gpgme_op_keylist_end): New function.
697 * gpgme.h (gpgme_op_keylist_end): New prototype.
699 * engine.h (gpgme_engine_check_version): Move prototype to ...
700 * gpgme.h (gpgme_engine_check_version): ... here.
702 * genkey.c (gpgme_op_genkey_start): Remove unused variable.
704 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
706 * version.c (gpgme_get_engine_info): Reimplemented.
707 (gpgme_check_engine): Reimplemented.
708 (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
710 * engine.c: Include `io.h'.
711 (gpgme_engine_get_info): New function.
712 * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
715 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
717 * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
718 * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
719 Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
721 * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
722 (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
723 * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
724 * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
725 own function by call to _gpgme_engine_add_child_to_reap_list().
727 * wait.c: Include `engine.h'.
728 (run_idle): Call _gpgme_engine_housecleaning(), not
729 _gpgme_gpg_housecleaning().
731 2001-12-18 Marcus Brinkmann <marcus@g10code.de>
733 * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
734 Initialize the next field of the uid structure.
735 (gpgme_key_get_as_xml): Do not list last uid first.
737 2001-12-17 Marcus Brinkmann <marcus@g10code.de>
739 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
740 function [!ENABLE_GPGSM].
742 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
744 * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
745 message_data, not SIG.
746 (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
748 * sign.c (sign_status_handler): Call
749 _gpgme_passphrase_status_handler early.
751 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
753 * engine-gpgsm.c: Revert last change.
755 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
757 * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
758 handler when ending this operation, otherwise the wait function
761 2001-12-14 Marcus Brinkmann <marcus@g10code.de>
763 * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
764 (_gpgme_gpgsm_new): Initialize some more members.
765 (_gpgme_gpgsm_release): Free the colon line handler's attic line.
766 (gpgsm_status_handler): Rework the inline-data processing.
768 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
770 * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
771 list that are not dup'ed, for those the close-on-exec flag is set
773 * version.c (_gpgme_get_program_version): Remove first entry in
774 CFD, as the close-on-exec flag is now set for this fd.
776 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
778 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
780 * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
783 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
785 * engine-gpgsm.c (close_notify_handler): New function.
786 (_gpgme_gpgsm_new): Manage the file descriptors a
787 bit differently. Do not set close-on-exec flags.
788 (_gpgme_gpgsm_op_decrypt): Do not set message_fd
789 to -1, this is done by the close handler.
790 (_gpgme_gpgsm_op_encrypt): Likewise.
791 (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
792 (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
793 (_gpgme_gpgsm_op_sign): Likewise.
794 (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
796 * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
797 non-inherited file descriptor index of the pipe.
799 2001-12-13 Werner Koch <wk@gnupg.org>
801 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
802 (gpgsm_status_handler): Pass datalines to a colon handler
803 * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
806 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
808 (gpgsm_assuan_simple_command): Removed underscore from
810 (_gpgme_gpgsm_start): Ditto.
811 (gpgsm_assuan_simple_command): Replaced interal Assuan read
812 function by the new assuan_read_line. Removed the use of the
814 (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
815 (_gpgme_gpgsm_start): Use the documented way to get an fd from
818 * keylist.c (keylist_colon_handler): Handle "crt" records
819 * key.h (gpgme_key_s): Add an x509 flag.
820 * key.c (parse_x509_user_id): New.
821 (_gpgme_key_append_name): Handle x.509 names.
823 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
825 * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
828 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
830 * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
831 (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
833 (_gpgme_gpgsm_op_sign): Likewise.
835 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
837 * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
840 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
842 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
844 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
846 * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
847 Deal with assuan read line returning more than one line (for now).
849 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
851 * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
852 the current protocol definition.
854 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
856 * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
859 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
861 * engine-gpgsm.c: Include stdlib.h and string.h. Also include,
862 for now, rungpg.h and status-table.h.
863 (gpgsm_status_handler): Implement more of the status handler.
865 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
867 * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
868 (_gpgme_engine_op_delete): Likewise.
869 (_gpgme_engine_op_encrypt): Likewise.
870 (_gpgme_engine_op_export): Likewise.
871 (_gpgme_engine_op_genkey): Likewise.
872 (_gpgme_engine_op_keylist): Likewise.
873 (_gpgme_engine_op_sign): Likewise.
874 (_gpgme_engine_op_trustlist): Likewise.
876 * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
877 (gpgsm_assuan_simple_command): Likewise.
878 (gpgsm_set_recipients): Likewise.
879 (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
880 (_gpgme_gpgsm_op_delete): New function.
881 (_gpgme_gpgsm_op_export): Likewise.
882 (_gpgme_gpgsm_op_genkey): Likewise.
883 (_gpgme_gpgsm_op_sign): Likewise.
884 (_gpgme_gpgsm_op_keylist): Likewise.
885 (_gpgme_gpgsm_op_trustlist): Likewise.
886 (_gpgme_gpgsm_release): Release command.
887 (_gpgme_gpgsm_op_decrypt): Allocate command.
888 (_gpgme_gpgsm_op_import): Likewise.
889 (gpgsm_status_handler): Also treat `ERR' strings as EOF.
891 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
893 * gpgme.h (gpgme_set_protocol): New prototype.
895 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
897 * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
898 (_gpgme_gpgsm_op_import): Likewise.
900 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
902 * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
904 (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
906 2001-11-22 Werner Koch <wk@gnupg.org>
908 * engine-gpgsm.c: Include more headers so that NULL and mk_error
909 is defined even with an undefined GPGSM_PATH.
911 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
913 * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
914 gpg_outbound_handler): Moved to ...
915 * data.c (_gpgme_data_inbound_handler, write_mem_data,
916 write_cb_data, _gpgme_data_outbound_handler): ... here. Make the
917 _gpgme_* ones non-static.
918 * data.c: Include io.h.
920 * ops.h (_gpgme_data_inbound_handler): New prototype.
921 (_gpgme_data_outbound_handler): Likewise.
922 (_gpgme_gpg_spawn): Use these new functions.
924 * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
925 _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
926 _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
927 _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
928 _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
929 _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
930 Include <rungpg.h> for status handler function.
932 * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
933 input_data, output_fd, output_data, message_fd, message_data, command
935 (_gpgme_gpgsm_new): Open input, output and message pipes before
936 connecting to the client. Close server's ends afterwards.
937 (_gpgme_gpgsm_release): Close open file descriptors. Remove
938 server process from wait queue.
939 (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
940 _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
942 * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
943 (_gpgme_engine_set_status_handler): Likewise.
944 (_gpgme_engine_op_verify): Likewise.
946 2001-11-21 Marcus Brinkmann <marcus@g10code.de>
948 * context.h: Do not include rungpg.h, but engine.h.
949 (struct gpgme_context_s): Replace member gpg with engine.
950 * gpgme.c (gpgme_release): Release engine, not gpg.
952 * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
954 * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
955 Make static, change order of arguments, and return an error value.
956 * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
958 * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
959 (_gpgme_gpg_op_encrypt): Likewise.
960 (_gpgme_gpg_op_decrypt): Likewise.
961 (_gpgme_gpg_op_delete): Likewise.
962 (_gpgme_gpg_op_export): Likewise.
963 (_gpgme_gpg_op_genkey): Likewise.
964 (_gpgme_gpg_op_import): Likewise.
965 (_gpgme_gpg_op_keylist): Likewise.
966 (_gpgme_gpg_op_sign): Likewise.
967 (_gpgme_gpg_op_trustlist): Likewise.
968 * rungpg.c (_gpgme_gpg_op_verify): New function.
969 (_gpgme_gpg_op_encrypt): Likewise.
970 (_gpgme_gpg_op_decrypt): Likewise.
971 (_gpgme_gpg_op_delete): Likewise.
972 (_gpgme_gpg_op_export): Likewise.
973 (_gpgme_gpg_op_genkey): Likewise.
974 (_gpgme_gpg_op_import): Likewise.
975 (_gpgme_gpg_op_keylist): Likewise.
976 (_gpgme_gpg_op_sign): Likewise.
977 (_gpgme_gpg_op_trustlist): Likewise.
979 * engine.h (_gpgme_engine_set_status_handler): Add prototype.
980 (_gpgme_engine_set_command_handler): Likewise.
981 (_gpgme_engine_set_colon_line_handler): Likewise.
982 (_gpgme_engine_op_decrypt): Likewise.
983 (_gpgme_engine_op_delete): Likewise.
984 (_gpgme_engine_op_encrypt): Likewise.
985 (_gpgme_engine_op_export): Likewise.
986 (_gpgme_engine_op_genkey): Likewise.
987 (_gpgme_engine_op_import): Likewise.
988 (_gpgme_engine_op_keylist): Likewise.
989 (_gpgme_engine_op_sign): Likewise.
990 (_gpgme_engine_op_trustlist): Likewise.
991 (_gpgme_engine_op_verify): Likewise.
992 (_gpgme_engine_start): Likewise.
993 * engine.c (_gpgme_engine_set_status_handler): New function.
994 (_gpgme_engine_set_command_handler): Likewise.
995 (_gpgme_engine_set_colon_line_handler): Likewise.
996 (_gpgme_engine_op_decrypt): Likewise.
997 (_gpgme_engine_op_delete): Likewise.
998 (_gpgme_engine_op_encrypt): Likewise.
999 (_gpgme_engine_op_export): Likewise.
1000 (_gpgme_engine_op_genkey): Likewise.
1001 (_gpgme_engine_op_import): Likewise.
1002 (_gpgme_engine_op_keylist): Likewise.
1003 (_gpgme_engine_op_sign): Likewise.
1004 (_gpgme_engine_op_trustlist): Likewise.
1005 (_gpgme_engine_op_verify): Likewise.
1006 (_gpgme_engine_start): Likewise.
1008 * verify.c (gpgme_op_verify_start): Reimplement in terms of above
1010 * encrypt.c (gpgme_op_encrypt_start): Likewise.
1011 * decrypt.c (_gpgme_decrypt_start): Likewise.
1012 * passphrase.c (_gpgme_passphrase_start): Likewise.
1013 * keylist.c (gpgme_op_keylist_start): Likewise.
1015 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
1017 * types.h: Add types EngineObject and GpgsmObject.
1019 * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
1020 engine-gpgsm.c, engine.h and engine.c.
1021 * engine.h: New file.
1022 * engine.c: Likewise.
1023 * engine-gpgsm.h: Likewise.
1024 * engine-gpgsm.c: Likewise.
1026 * rungpg.c (_gpgme_gpg_get_version): New function.
1027 (_gpgme_gpg_check_version): Likewise.
1028 * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
1029 _gpgme_gpg_check_version.
1031 * version.c (compare_versions): Rename to ...
1032 (_gpgme_compare_versions): ... this. Make non-static.
1033 (gpgme_check_version): Use _gpgme_compare_versions rather than
1035 (gpgme_check_engine): Likewise.
1036 * ops.h (_gpgme_get_program_version): Add prototype.
1038 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
1040 * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
1041 (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
1042 (libgpgme_la_LIBADD): Likewise.
1044 2001-11-20 Marcus Brinkmann <marcus@g10code.de>
1046 * version.c: Remove global variables lineno and
1048 (version_handler): Removed.
1049 (_gpgme_get_program_version): New function.
1050 (get_engine_info): Don't use context and version_handler,
1051 but _gpgme_get_program_version.
1052 * ops.h (_gpgme_get_program_version): Add prototype for
1053 _gpgme_get_program_version (we expect to use it elsewhere soon).
1055 2001-11-18 Marcus Brinkmann <marcus@g10code.de>
1057 * version.c (get_engine_info): If GnuPG is not available, return
1059 * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
1061 (_gpgme_get_gpgsm_path): New function.
1062 * w32-util.c (find_program_in_registry): New static function.
1063 (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined. Rework
1064 to use find_program_in_registry.
1065 (_gpgme_get_gpgsm_path): New function.
1066 (util.h): Prototype _gpgme_get_gpgsm_path).
1067 * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
1070 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
1072 * decrypt-verify.c: New file.
1073 * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
1074 * types.h: Add decrypt-verify types.
1076 * context.h: Add result type for decrypt-verify.
1077 * gpgme.h: Add decrypt-verify prototypes.
1079 * decrypt.c (decrypt_status_handler): Renamed to ...
1080 (_gpgme_decrypt_status_handler): ... this. Make non-static.
1081 (_gpgme_decrypt_start): New function, derived from
1082 gpgme_op_decrypt_start.
1083 (gpgme_op_decrypt_start): Reimplement in terms of
1084 _gpgme_decrypt_start.
1085 (_gpgme_decrypt_result): New function to retrieve error value.
1086 (gpgme_op_decrypt): Use _gpgme_decrypt_result.
1087 * ops.h: Add prototypes for new functions.
1089 * verify.c (verify_status_handler): Renamed to ...
1090 (_gpgme_verify_status_handler): ... this. Make non-static.
1091 (gpgme_op_verify_start): Use new function name.
1092 (intersect_stati): Renamed to ...
1093 (_gpgme_intersect_stati): ... this. Make non-static.
1094 (gpgme_op_verify): Use new name.
1095 * ops.h: Add prototypes for new functions.
1097 2001-11-16 Marcus Brinkmann <marcus@g10code.de>
1099 * passphrase.c: New file.
1100 * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
1101 * ops.h (_gpgme_passphrase_result): Add prototypes from
1103 * types.h: Likewise.
1104 * context.h: Add member passphrase to result.
1105 * gpgme.c (_gpgme_release_result): Release passphrase member.
1107 * decrypt.c: Some formatting and variable name changes (like
1109 (struct decrypt_result_s): Remove members now found in
1111 (_gpgme_release_decrypt_result): Don't release removed members.
1112 (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
1113 and don't handle the cases catched there.
1114 (command_handler): Removed.
1115 (gpgme_op_decrypt_start): Don't set command handler, but invoke
1116 _gpgme_passphrase_start which does it.
1117 (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
1118 cases covered by it.
1120 * sign.c Some formatting and variable name changes (like
1122 (struct sign_result_s): Remove members now found in
1124 (_gpgme_release_sign_result): Don't release removed members.
1125 (sign_status_handler): Call _gpgme_passphrase_status_handler,
1126 and don't handle the cases catched there.
1127 (command_handler): Removed.
1128 (gpgme_op_sign_start): Don't set command handler, but invoke
1129 _gpgme_passphrase_start which does it.
1130 (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
1131 cases covered by it.
1133 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
1135 * decrypt.c (command_handler): Fix last change.
1137 2001-11-15 Marcus Brinkmann <marcus@g10code.de>
1139 * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
1140 Rename R2 to NEXT_RESULT.
1141 (intersect_stati): Rename RES to RESULT.
1142 (gpgme_get_sig_status): Likewise. Do not check return_type, but
1143 the member verify of result.
1144 (gpgme_get_sig_key): Likewise.
1146 * sign.c (_gpgme_release_sign_result): Rename RES to RESULT. If
1147 RESULT is zero, return.
1148 (sign_status_handler, command_handler): Do not check return_type,
1149 but the member sign of result.
1150 (gpgme_op_sign): Likewise. Drop assertion.
1152 * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
1153 If RESULT is zero, return.
1154 (encrypt_status_handler): Do not check return_type, but the member
1156 (gpgme_op_encrypt): Likewise. Drop assertion.
1158 * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
1159 (create_result_struct): Do not set result_type.
1160 (command_handler, decrypt_status_handler): Do not check
1161 return_type, but the member decrypt of result.
1162 (gpgme_op_decrypt): Likewise. Drop assertion.
1164 * context.h (enum ResultType): Removed.
1165 (struct gpgme_context_s): Remove member result_type.
1166 (struct result): Replaces union result.
1167 * gpgme.c: Include string.h.
1168 (_gpgme_release_result): Release all members of c->result, which
1169 is now a struct. Zero out all members of the struct afterwards.
1171 2001-11-11 Marcus Brinkmann <marcus@g10code.de>
1173 * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
1174 Release all members of the list GPG->arglist.
1175 Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
1177 2001-11-02 Marcus Brinkmann <marcus@g10code.de>
1179 * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
1181 * key.c: Include string.h.
1183 * recipient.c: Likewise.
1185 2001-10-29 Marcus Brinkmann <marcus@g10code.de>
1187 * context.h: New member signers_len.
1188 * signers.c (gpgme_signers_clear): Require that signers are
1189 non-NULL with assertion. Use signers_len to determine how much
1190 keys to release. Add documentation.
1191 (gpgme_signers_add): Use signers_len to determine if the buffer is
1192 large enough. Use xtryrealloc rather than xtrymalloc and copying.
1194 (gpgme_signers_enum): Use signers_len to determine if key is
1195 available. Add documentation.
1197 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
1199 * data.c (_gpgme_data_append): Check if LENGTH is smaller than
1200 ALLOC_CHUNK, not DH->length.
1202 2001-10-17 Marcus Brinkmann <marcus@g10code.de>
1204 * gpgme.c (gpgme_set_protocol): Fix last change.
1206 2001-10-15 Werner Koch <wk@gnupg.org>
1208 * gpgme.h (GpgmeProtocol): New.
1209 * gpgme.c (gpgme_set_protocol): New.
1211 2001-09-26 Werner Koch <wk@gnupg.org>
1213 * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
1214 (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
1216 2001-09-17 Werner Koch <wk@gnupg.org>
1218 * keylist.c (finish_key): Shortcut for no tmp_key. Changed all
1219 callers to use this function without a check for tmp_key.
1221 * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
1222 emptying the queue. Bug reported by Stéphane Corthésy.
1224 2001-09-12 Werner Koch <wk@gnupg.org>
1226 * data.c (gpgme_data_rewind): Allow rewind for callbacks.
1228 2001-09-07 Werner Koch <wk@gnupg.org>
1230 * rungpg.h: Add NO_RECP.
1231 * encrypt.c (encrypt_status_handler): Take on No_RECP.
1232 (gpgme_op_encrypt): Better error return.
1234 * verify.c (verify_status_handler): Take on NODATA.
1236 2001-09-03 Werner Koch <wk@gnupg.org>
1238 * rungpg.h: Added STATUS_INV_RECP.
1239 * gpgme.c (_gpgme_release_result): Add support for new
1240 EncryptResult object.
1241 * encrypt.c (append_xml_encinfo): New.
1242 (encrypt_status_handler): Add some status parsing.
1243 (_gpgme_release_encrypt_result): New.
1245 2001-08-29 Werner Koch <wk@gnupg.org>
1247 * recipient.c (gpgme_recipients_release): Free the list. By Timo.
1249 * keylist.c (keylist_colon_handler): Do a finish key if we receive
1250 an EOF here. This is probably the reason for a lot of bugs
1251 related to keylisting. It is so obvious. Kudos to Enno Cramer
1252 for pointing that out.
1254 2001-08-28 Werner Koch <wk@gnupg.org>
1256 * gpgme.c, gpgme.h (gpgme_get_op_info): New.
1257 (_gpgme_set_op_info): New.
1258 (_gpgme_release_result): Reset the op_info here.
1259 * sign.c (append_xml_siginfo): New.
1260 (sign_status_handler): Store the sig create information.
1262 2001-07-31 Werner Koch <wk@gnupg.org>
1264 * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
1266 2001-07-30 Werner Koch <wk@gnupg.org>
1268 * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
1270 * rungpg.c (build_argv): Disable armor comments
1271 * w32-io.c (build_commandline): Need to add quotes here
1273 2001-07-24 Werner Koch <wk@gnupg.org>
1275 * data.c (gpgme_data_read): Add a a way to return the available bytes.
1277 2001-07-23 Werner Koch <wk@gnupg.org>
1279 * util.c: Removed stpcpy() because we use the version from jnlib.
1281 2001-07-19 Werner Koch <wk@gnupg.org>
1283 * mkstatus: Define the collating sequence for sort.
1285 2001-06-26 Werner Koch <wk@gnupg.org>
1287 * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
1289 2001-06-15 Werner Koch <wk@gnupg.org>
1291 * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
1292 to Timo for pointing this out.
1294 2001-06-01 Werner Koch <wk@gnupg.org>
1296 * debug.c (_gpgme_debug_begin): Fixed a /tmp race. Noted by
1299 2001-05-28 Werner Koch <wk@gnupg.org>
1301 * version.c (gpgme_check_engine): Stop version number parsing at
1302 the opening angle and not the closing one. By Tommy Reynolds.
1304 2001-05-01 José Carlos GarcÃa Sogo <jose@jaimedelamo.eu.org>
1306 * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
1307 line, because it gave an error if another operation had been made
1308 before using the same context.
1310 * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added
1311 one line to release the gpg object in the context (if any).
1313 2001-04-26 Werner Koch <wk@gnupg.org>
1315 * key.c, key.h (_gpgme_key_cache_init): New.
1316 (_gpgme_key_cache_add): New.
1317 (_gpgme_key_cache_get): New.
1318 * version.c (do_subsystem_inits): Init the cache.
1319 * keylist.c (finish_key): Put key into the cache
1320 * verify.c (gpgme_get_sig_key): First look into the cache.
1322 2001-04-19 Werner Koch <wk@gnupg.org>
1324 * keylist.c (parse_timestamp): Adjusted for the changed
1325 --fixed-list-mode of gpg 1.0.4h.
1327 2001-04-05 Werner Koch <wk@gnupg.org>
1329 * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
1331 2001-04-04 Werner Koch <wk@gnupg.org>
1333 * w32-io.c (_gpgme_io_select): Don't select on the writer if there
1334 are still bytes pending. Timo found this not easy to track down
1337 2001-04-02 Werner Koch <wk@gnupg.org>
1339 * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
1340 * key.c (gpgme_key_get_ulong_attr): And return those attribs.
1342 * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
1343 the mode set in the current context. Suggested by Timo.
1345 * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
1346 can_encrypt. By Timo.
1348 2001-03-30 Werner Koch <wk@gnupg.org>
1350 * debug.c (debug_init): Allow to specify a debug file.
1351 (_gpgme_debug_level): New.
1353 * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
1354 (_gpgme_io_select): Debug only with level > 2.
1356 2001-03-15 Werner Koch <wk@gnupg.org>
1358 * rungpg.c: Included time.h.
1360 * key.h: New keyflags for capabilities.
1361 * keylist.c (set_mainkey_capability, set_subkey_capability): New.
1362 (keylist_colon_handler): Parse them.
1363 * gpgme.h: New attribute values for capabilties.
1364 * key.c (gpgme_key_get_string_attr): Return them.
1365 (capabilities_to_string): New.
1366 (gpgme_key_get_ulong_attr): Return the global caps.
1368 2001-03-14 Werner Koch <wk@gnupg.org>
1370 * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error.
1371 Thanks to Jan Oliver Wagner.
1373 2001-03-13 Werner Koch <wk@gnupg.org>
1375 * context.h: Add invalid and revoke flags to user_id structure.
1376 * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
1377 (keylist_colon_handler): Adjust for that.
1378 (set_userid_flags): New.
1379 (set_mainkey_trust_info): Handle new key invalid flag
1380 (set_subkey_trust_info): Ditto.
1381 * gpgme.h: Add new attributes for key and user ID flags.
1382 * key.c (_gpgme_key_append_name): Init these flags
1383 (gpgme_key_get_as_xml): Print them.
1384 (one_uid_as_xml): New helper for above.
1385 (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
1386 Return the new attributes. Enhanced, so that subkey information
1387 can be returned now.
1389 2001-02-28 Werner Koch <wk@gnupg.org>
1391 * w32-io.c (destroy_reader): Set stop_me flag.
1392 (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
1393 (_gpgme_io_write): Use a writer thread to avaoid blocking.
1394 (_gpgme_io_close): Cleanup a writer thread
1395 (_gpgme_io_select): Repalce tthe faked wait on writing by a real
1396 waiting which is now possible due to the use of a writer thread.
1398 2001-02-20 Werner Koch <wk@gnupg.org>
1400 * w32-io.c (destroy_reader,kill_reader): New.
1401 (create_reader, reader): Add a new event to stop the thread.
1402 (_gpgme_io_close): Kill the reader thread.
1404 * posix-io.c (_gpgme_io_select): Handle frozen fds here.
1405 * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
1407 * wait.c: Reworked the whole thing.
1408 * rungpg.c (_gpgme_gpg_new): Init pid to -1.
1409 (_gpgme_gpg_release): Remove the process from the wait queue.
1411 2001-02-19 Werner Koch <wk@gnupg.org>
1413 * w32-io.c (_gpgme_io_set_close_notify): New.
1414 (_gpgme_io_close): Do the notification.
1416 * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
1419 * wait.c (remove_process): Don't close the fd here.
1420 (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
1421 (_gpgme_wait_on_condition): Remove the assert on the queue and
1422 break out if we could not find the queue. The whole thing should
1425 * posix-io.c (_gpgme_io_set_close_notify): New.
1426 (_gpgme_io_close): Do the notification.
1428 * rungpg.c (close_notify_handler): New.
1429 (_gpgme_gpg_new): Register a callback for the fd.
1430 (_gpgme_gpg_set_colon_line_handler): Ditto.
1433 2001-02-13 Werner Koch <wk@gnupg.org>
1435 * rungpg.c (struct reap_s): Replaced pid_t by int.
1437 * types.h: Add ulong typedef.
1439 * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
1440 (_gpgme_gpg_release): Reap children.
1441 * io.h, posix-io.c (_gpgme_io_kill): New.
1442 * w32-io.c (_gpgme_io_kill): New (dummy).
1444 * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
1446 * posix-io.c (_gpgme_io_read): Add some debug output.
1447 (_gpgme_io_write): Ditto.
1448 (_gpgme_io_select): Increased the timeout.
1450 2001-02-12 Werner Koch <wk@gnupg.org>
1452 Enhanced the signature verification, so that it can how handle
1453 more than one signature and is able to return more information on
1455 * verify.c (gpgme_get_sig_key): New.
1456 (gpgme_get_sig_status): New.
1458 * gpgme.h: Add stdio.h.
1459 (GpgmeSigStat): New status DIFF.
1461 2001-02-01 Werner Koch <wk@gnupg.org>
1463 * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE. Add Debug
1464 code to all Set/ResetEvent().
1466 * rungpg.c (read_status): Check for end of stream only if we have
1469 2001-01-31 Werner Koch <wk@gnupg.org>
1471 * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
1472 (propagate_term_results,clear_active_fds): Removed.
1473 (count_active_fds): Renamed to ..
1474 (count_active_and_thawed_fds): .. this and count only thawed fds.
1476 * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
1479 2001-01-30 Werner Koch <wk@gnupg.org>
1481 * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
1483 * version.c (get_engine_info): Return better error information.
1485 * posix-util.c, w32-util.c: New.
1486 (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
1487 * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
1489 * signers.c (gpgme_signers_add): Ooops, one should test code and
1490 not just write it; the newarr was not assigned. Thanks to José
1491 for pointing this out. Hmmm, still not tested, why shoudl a coder
1494 * w32-io.c: Does now use reader threads, so that we can use
1495 WaitForMultipleObjects.
1496 * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
1497 Does currently only work for W32.
1499 * debug.c, util.h : New. Changed all fprintfs to use this new
1500 set of debugging functions.
1502 2001-01-23 Werner Koch <wk@gnupg.org>
1504 * data.c (_gpgme_data_release_and_return_string): Fixed string
1507 2001-01-22 Werner Koch <wk@gnupg.org>
1512 * key.c (gpgme_key_ref, gpgme_key_unref): New.
1513 * sign.c (gpgme_op_sign_start): Allow the use of other keys.
1515 * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
1516 * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
1518 2001-01-05 Werner Koch <wk@gnupg.org>
1520 * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
1523 Copyright 2001, 2002 g10 Code GmbH
1525 This file is free software; as a special exception the author gives
1526 unlimited permission to copy and/or distribute it, with or without
1527 modifications, as long as this notice is preserved.
1529 This file is distributed in the hope that it will be useful, but
1530 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
1531 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.