2002-07-30 Miguel Coca * gpapafile.c (gpapa_file_sign) (gpapa_file_encrypt) (gpapa_file_encrypt_and_sign) (gpapa_file_protect) (gpapa_file_decrypt) (gpapa_file_get_status) (gpapa_file_get_signatures) gpapapublickey.c (gpapa_public_key_export) (gpapa_public_key_sign) gpapasecretkey.c (gpapa_secret_key_export) gpapa.c (gpapa_import_ownertrust) (gpapa_import_keys): Only do argument quotation on windows. Use g_free() to free memory allocated by g_strconcat. This makes the filemanager work again on Unix. 2002-02-25 Peter Gerwinski * gpapa.c (gpapa_http_quote) (gpapa_dehtml) (gpapa_report_hkp_error) (gpapa_search_public_keys_on_server): Compile only if configured to connect directly to the keyserver. 2002-02-24 Peter Gerwinski * Makefile.am (noinst_PROGRAMS): Removed gpapatest. * gpapa.c, gpapafile.c, gpapaintern.c, gpapapublickey.c, gpapasecretkey.c: gettextify output. * gpapa.c (gpapa_http_quote): New function. Quotes a string for an HTTP request. (gpapa_dehtml): New function. Removes every HTML tag from a string. (gpapa_report_hkp_error): New function, which reports to the application an error when contacting the keyserver. (gpapa_receive_public_key_from_server): Quote the key ID before sending it to the server. Use gpapa_report_hkp_error when appropiate. (gpapa_search_public_keys_on_server): New function. Looks for keys matching some search terms on the keyserver and returns a list with them. * gpapa.h: Added gpapa_report_hkp_error and gpapa_search_public_keys_on_server functions. * gpapapublickey.c (gpapa_public_key_send_to_server): Use gpapa_report_hkp_error when appropiate. * keyserver.c: Changed the hardcoded port 11371 to the HKP_PORT constant defined in keyserver.h. Set to debug mode (defined DEBUG). (sock_getline) (kserver_search_init) (kserver_search): New functions. * keyserver.h: Added HKP_PORT constant. Defined keyserver_key type. (kserver_search_init) (kserver_search): New functions. They use code from WinPT (file Src/wptKeyserver.cpp). 2002-02-22 Peter Gerwinski * gpapa.c (gpapa_receive_public_key_from_server): Moved gpgargv variable declaration inside the block where it is actually used. 2002-02-21 Peter Gerwinski * gpapafile.c (gpapa_file_sign, gpapa_file_encrypt_and_sign): Supress all output to the terminal with the "--no-tty" option to gpg. * gpapapublickey.c (gpapa_public_key_sign): Fixed broken call to g_strconcat. 2002-02-19 Peter Gerwinski * Makefile.am (libgpapa_a_SOURCES): Renamed io.h to gpgme_io.h. (gpapatest_LDADD): Added two win32 specific libraries. * gpapa.c, gpapapublickey.c: Added some casts and "const" declarations. * gpapa.h: Declared hkp_errtypestr as const and added declaration of new function gpapa_import_keys_from_clipboard. * io.h: Renamed to gpgme_io.h. * keyserver.c: Removed (via #ifdef's) unused code. * posix-io.c, rungpg.c, w32-io.c, wait.c: Include gpgme-io.h instead of io.h. 2002-02-15 Peter Gerwinski * gpapa.c, gpapa.h: Moved the defines controlling conditional compilation of keyserver code from gpapa.c to gpapa.h. Renamed hkp_errmsg to hkp_errtypestr. * gpapa.c (gpapa_receive_public_key_from_server): Change to use the keyserver.h error reporting in certain cases, in addition to the hkp_errtypestr message. * gpapapublickey.c (gpapa_public_key_send_to_server): Use the new keyserver code for exporting keys. 2002-02-14 Peter Gerwinski * gpapa.c, gpapa.h (hkp_errmsg): New global variable. Contains the error strings for each possible error returned by the key impor functions. * gpapa.c (gpapa_refresh_public_keyring) (gpapa_refresh_secret_keyring): Changed the place where the keyrings are considered initialized. (gpapa_receive_public_key_from_server): Added error checking and reporting. (linecallback_refresh_sec): Check that we don't release the public key unless the public keyring is loaded. 2002-02-13 Peter Gerwinski * gpapa.c (gpapa_import_ownertrust) (gpapa_import_keys) gpapafile.c (gpapa_file_get_status) (gpapa_file_get_status) (gpapa_file_get_signatures) (gpapa_file_sign) (gpapa_file_encrypt) (gpapa_file_encrypt_and_sign) (gpapa_file_protect) (gpapa_file_decrypt): More filename quoting. * gpapa.c (pubring_initialized) (secring_initialized): New global variables. (gpapa_refresh_secret_keyring) (gpapa_refresh_public_keyring): Mark the keyrings as initialized. (gpapa_get_public_key_count) (gpapa_get_public_key_by_index) (gpapa_get_public_key_by_ID) (gpapa_get_secret_key_count) (gpapa_get_secret_key_by_index) (gpapa_get_secret_key_by_ID): Check whether the keyring has been initialized, and read it if it hasn't. * gpapasecretkey.c: Fixed error messages. 2002-02-11 Peter Gerwinski * gpapapublickey.c (gpapa_public_key_sign): Changed to quote the key ID with double quotes. Same problems as with quoting filenames. * gpgme.h: Commented out DEBUG define. 2002-02-10 Peter Gerwinski * Makefile.am (libgpapa_a_SOURCES): Added keyserver.c and keyserver.h to the list. * gpapaintern.h, gpapaintern.c (gpapa_call_gnupg): Added new "data" argument, to be used as input if not NULL. Tell GnuPG we are going to use utf8 strings (added --utf8-strings argument). * gpapa.c (gpapa_receive_public_key_from_server): Added support for connecting directly to key servers instead of using "gpg --recv-keys" (via the keyserver.h functions). Only active on windows at the moment. Changed to call gpapa_get_public_key_by_userID() instead of gpapa_get_public_key_by_ID(). (gpapa_import_keys_from_clipboard) (get_w32_clip_text): New functions for importing a key directly from the MS-Windows clipboard. Disabled for other OS's. * gpapafile.c (gpapa_file_sign) (gpapa_file_encrypt) (gpapa_file_encrypt_and_sign) (gpapa_file_protect) (gpapa_file_decrypt) gpapapublickey.c (gpapa_public_key_export) gpapasecretkey.c (gpapa_secret_key_export): Changed to quote every filename with double quotes before passing it to gpg. (NOTE (by Miguel Coca): This BREAKS all these functions on non-Windows systems, since the quotes are passed to gpg along with the filename). * gpapa.c, rungpg.c: Fixes to the debug messages. * gpapapublickey.c: Added windows include. * gpapapublickey.c, gpapapublickey.h (linecallback_to_clipboard) (set_w32_clip_text) (gpapa_public_key_export_to_clipboard): New functions for exporting a key to the MS-Windows clipboard. * gpapasecretkey.c, gpapasecretkey.h (gpapa_secret_key_export_to_clipboard): New functions for exporting a key to the MS-Windows clipboard. * gpgme.h: Added DEBUG define. * rungpg.c (_gpgme_gpg_set_colon_line_handler): Changed the way lines are handled. * gpapa.c, gpapafile.c, gpapakey.c, gpapapublickey.c, gpapasecretkey.c, gpapatest.c: Changed all calls of gpapa_call_gnupg to new prototype. * w32-clipboard.c, keyserver.c, keyserver.h: New files. They are slightly modified versions of the equivalent files in the WinPT program, after adapting them to the GNU coding style. 2002-02-05 Benedikt Wildenhain * gpapa.c (extract_key): Changed to read only the short form of the key ID. Added some checks for ensuring the key ID is valid. * gpapafile.c (linecallback_get_signatures): Changed to use new gpapa_signature_new prototype. The signature's keyID is now set here and is the short form. * gpapapublickey.c (extract_sig): Uses new gpapa_signature_new and sets the signature keyID. * gpapasignature.h, gpapasignature.c (gpapa_signature_new): Don't set the signature's keyID here. Removed keyID from prototype. 2002-02-05 Peter Gerwinski * README: Added comment to compile instructions. * debug.c: Added includes needed for win32. * gpapa.c (gpapa_import_keys): Changed command line for gpg to allow import of secret keys. * gpapatest.c (getpass): Fixed wrong call to WriteConsoleA. * gpgme.h, gpgme_types.h (GpgmeDataMode): Moved type from gpgme_types.h to gpgme.h. * gpgme.h (_gpgme_data_set_mode): Added declaration. * w32io.h (_gpgme_io_kill): Removed compile time warning about disabled function, but left the function still disabled. (_gpgme_io_select): WaitForSingleObject's second argument is not a pointer, don't use NULL. * gpapasignature.c: General code cleanup. Added parentheses around return values and removed some comments. * gpapatest.c, gpapafile.c, gpapafile.h, gpapa.c, gpapa.h, gpapaintern.c, gpapaintern.h, gpapakey.c, gpapakey.h, gpapapublickey.c, gpapapublickey.h, gpapasecretkey.c, gpapasecretkey.h: Changed most declarations of variables type "char*" to type "gchar*" or, where possible, "const gchar*". Added casts where needed. 2001-12-31 Werner Koch * gpapakey.c, gpapakey.h: Support for creation date. * gpapatest.c: Ditto. By Michael Mauch. 2001-08-23 Werner Koch * gpapapublickey.h: Added a few more keytrust values. * gpapapublickey.c (gpapa_public_key_get_keytrust): Ditto. Contributed by Miguel Coca. 2001-05-30 Werner Koch * gpapapublickey.c, gpapapublickey.h (gpapa_public_key_send_to_server): Made ServerName arg a const. Sat 19 May 2001 22:36:08 Peter Gerwinski * gpapafile.c (linecallback_get_status): Do not report errors here. We do not actually want to decrypt something, only check whether it is encrypted. Also record ":encrypted data packet:" (just for fun). (gpapa_file_get_status): Be more flexible about what `gpg' is expected to report for encrypted/signed/whatever files. * gpapafile.h (GPAPA_FILE_STATUS_ENCRYPTED): new constant. * gpapaintern.c (gpapa_call_gnupg): add "--always-trust" option. 2001-03-28 Werner Koch * gpapa.c (gpapa_extract_fingerprint): No warning when there are more fields in gpg's output. Just check for the minimum required number of fields. Note: the parsing code does not seem to be correct. (extract_key): Ditto. * gpapapublickey.c (extract_sig): Ditto Tue Feb 27 10:10:03 CET 2001 Jan-Oliver Wagner * util.c: removed stpcpy() which is already in jnlib/stringhelp.c Mon 26 Feb 2001 23:10 Peter Gerwinski * debug.c, gpgme.h, io.h, posix-io.c, rungpg.c, rungpg.h, util.c, w32-io.c, wait.c, wait.h: GPGME upgrade. * wait.c (_gpgme_wait_on_condition): mark GPAPA-specific code with "#ifdef GPAPA". Thu 15 Feb 2001 18:51 Peter Gerwinski * gpapa.c (gpapa_refresh_public_keyring): refresh the secret keyring, too, because the secret key objects also refer to the GpapaKey subobjects in the public keyring. (gpapa_create_key_pair): no more need to refresh the secret keyring explicitly. (gpapa_update_trust_database, gpapa_import_keys): refresh the public keyring afterwards. Wed 14 Feb 2001 26:14 Peter Gerwinski * gpapa.c (linecallback_refresh_sec): merge the GpapaKey subobjects of public and secret keys. * gpapakey.c (gpapa_key_set_expiry_date): note the new expiration date in the key object. * gpapapublickey.c (gpapa_public_key_set_ownertrust): note the new ownertrust in the key object. (gpapa_public_key_sign): answer "YES" two times - for all user IDs and for signing; enforce reloading of the key's signatures. (gpapa_public_key_release_sigs): new function. (gpapa_public_key_release): use gpapa_public_key_release_sigs(). * gpapasecretkey.c (gpapa_secret_key_delete): refresh the public key ring first, so the GpapaKey subobjects can be merged. (gpapa_secret_key_release): do _not_ gpapa_key_release (key->key) because key->key is owned by the public key object now. Wed 14 Feb 2001 23:24 Peter Gerwinski * gpapapublickey.c (gpapa_public_key_delete): pass "YES" as a command. (I wonder how this could ever have worked without this ...)-: * gpapasecretkey.c (gpapa_secret_key_delete): update the public keyring, too. Tue 13 Feb 2001 29:45 Peter Gerwinski * all files: s/gchar/char/g, GCSsified. * gpapa.c (release_public_keyring, release_secret_keyring, compare_public_keys, compare_secret_keys, gpapa_extract_fingerprint): new functions. (extract_key): recognize (even false) quoted colons. (linecallback_refresh_pub, linecallback_id_pub, linecallback_refresh_sec, linecallback_id_sec): report status errors. since GPG has `--with-fingerprint' now, get the fingerprints here. (gpapa_refresh_public_keyring): pass `--with-fingerprint'; sort the public key ring alphabetically. (gpapa_get_public_key_count): refresh only if absolutely necessary. (gpapa_get_public_key_by_ID, gpapa_get_public_key_by_userID, gpapa_get_secret_key_by_ID, gpapa_get_secret_key_by_userID): return the key from the key list. (gpapa_release_public_key, gpapa_release_secret_key): removed; these are now (again) methods of the public/secret key objects. (gpapa_refresh_secret_keyring): sort the secret key ring alphabetically. (gpapa_load_options, gpapa_save_options): removed. (gpapa_fini): release keyrings. * gpapafile.c (linecallback_check_gpg_status): new function. (linecallback_get_status, linecallback_get_signatures, gpapa_file_sign, gpapa_file_encrypt, gpapa_file_encrypt_and_sign, gpapa_file_protect, gpapa_file_decrypt): report status errors. (gpapa_file_get_status): check explicitly whether the file exists and is a regular file. * gpapaintern.c (gpapa_report_error_status): new function. (gpapa_call_gnupg): reset the counter of STATUS_NODATA reports. * gpapakey.c (gpapa_key_set_expiry_date): use g_strdup_printf(). * gpapapublickey.c (linecallback_fingerprint, gpapa_public_key_set_ownertrust): use extract_fingerprint(). (linecallback_fingerprint): report status errors. (gpapa_public_key_release): new (old) function. * gpapasecretkey.c (gpapa_secret_key_create_revocation): no need to {s|g_strdup}_printf(). (gpapa_secret_key_release): new function. 2001-02-13 Bernhard Herzog * Makefile.am (libgpapa_a_SOURCES): Add sema.h * gpapafile.c (gpapa_file_get_status): Fix wrong gpgargv index. Sun 11 Feb 2001 26:42 Peter Gerwinski * gpapa.c (gpapa_create_key_pair): handle empty comments; explicitly add the `--batch' option. * gpapaintern.c (gpapa_call_gnupg): add the `--batch' option only when there are no commands. Otherwise, gpg complains about deletion of secret keys which cannot be done in batch mode. * gpapasecretkey.c (gpapa_secret_key_delete): give a "YES" command; also delete the public key. * rungpg.c (build_argv): never add the `--batch' option; let the caller do this. * wait.c (_gpgme_wait_on_condition): do not consider `c->cancel'. In fact `c' is not really a `GpgmeCtx'. Fri 9 Feb 2001 19:05 Peter Gerwinski * posix-sema.c, w32-sema.c, sema.h, debug.c: new files (from GPGME). Fri 9 Feb 2001 11:05 Peter Gerwinski * context.h, data.c, gpgme.c, gpgme.h, ops.h, posix-io.c, rungpg.c, rungpg.h, util.c, util.h, w32-io.c, wait.c, gpgme_types.h: updated to current GPGME. * sema.h: new file (from GPGME). 2001-02-07 Bernhard Herzog * gpapatest.c (test_expiry): Add a dummy passphrase to make gpapatest compile with the changes in gpapakey.c * gpapakey.h (gpapa_key_set_expiry_date): * gpapakey.c (gpapa_key_set_expiry_date): Add the password parameter and pass it to gpg also treat a NULL date properly as "never expire" Mon 29 Jan 2001 25:14 Peter Gerwinski All files: updated copyright notices. * gpapa.c (gpapa_create_key_pair): cosmetical changes. * gpapaintern.c (gpapa_call_gnupg): more debugging output; pass the commands on fd 0 rather than on a special fd. For whatever reason, this works (at least on a Linux-based systems) while the other doesn't. * gpapatest.c (test_genkey): cosmetical changes. (test_gpapa_key_set_expiry_date): renamed to `test_expiry'. (main) call `test_expiry' on keyword "expiry". 2001-01-29 Bernhard Herzog * Makefile.am (libgpapa_a_SOURCES): Correct the filename of status-table.h and add context.h so that make dist works again Sat 27 Jan 2001 27:42 Peter Gerwinski * gpapaintern.c (line_handler, status_handler): added debug output. (command_handler): trying to use this for passing a passphrase. (gpapa_call_gnupg): explicitly use `--command-fd' and `--passphrase-fd' instead of relying on the GPGME callbacks. * gpapatest.c (linecallback): fixed parameters to use GPGME status codes. (main): report `argv[0]' instead of "foo" in callback messages. * posix-io.c (_gpgme_io_spawn): more debugging messages. * rungpg.c (build_argv): more debugging messages. Fri 26 Jan 2001 18:46 Peter Gerwinski * gpapa.c (gpapa_create_key_pair): initialize `commands'. * gpapafile.c (status_check): do not clear the buffer. The strings will be needed. * gpgme_types.h: #define GPG_PATH only if not already defined. Tue 23 Jan 2001 11:12 Peter Gerwinski * w32-io.c (_gpgme_io_spawn): use `nul' instead of `/dev/nul'. Mon 22 Jan 2001 29:24 Peter Gerwinski * gpapapublickey.c (linecallback_get_signatures): do not treat the self-signature specially. * gpapatest.c (main): initialize with GPG_PROGRAM from `../gpgdefs.h' rather than with a constant path. * gpgme_types.h (GPG_PATH): redefined to use GPAPA's path to the gpg program as specified in gpapa_init(). 2001-01-18 Werner Koch * gpapaintern.c, util.c (stpcpy): Removed. * w32-io.c (stpcpy): New. Tue 16 Jan 2001 23:25 Jan van Heys Peter Gerwinski Copied relevant files from GPGME. * Makefile.am: added new files. Mon 15 Jan 2001 28:30 Peter Gerwinski Re-wrote the GnuPG communication layer to use GPGME. * Makefile.am: (gpapatest_LDADD): added `-lgpgme'. * gpapa.c: (top level): let "gpapa.h" include the standard headers. (linecallback_refresh_pub): parameter list changed according to the new requirements of gpapa_call_gnupg(); body changed accordingly. (linecallback_refresh_sec): likewise. (linecallback_id_sec): likewise. (linecallback_export_ownertrust): likewise. * gpapa.h: include standard headers. * gpapafile.c: (top level): let "gpapa.h" include the standard headers. (linecallback_get_status): parameter list changed (see above). (status_check): pass status as a GpgStatusCode rather than a char*. (linecallback_get_signatures): parameter list changed (see above). * gpapaintern.c: rewritten. Use functions from GPGME for communication with GnuPG. (stpcpy): new function. * gpapaintern.h: (NO_STATUS): constant to indicate that something is _not_ a GPG status code. @@@@ This must be kept in sync with GPGME! * gpapapublickey.c: (linecallback_fingerprint): parameter list changed (see above). (linecallback_get_signatures): likewise. Cosmetical changes (GCS, etc.) in other files. 2000-12-20 Werner Koch Applied patches from Jan's tarball dated 2000-12-18. Mon 18 Dec 2000 Jan van Heys Peter Gerwinski * gpapa.c: (gpapa_get_public_key_by_userID): new function. (gpapa_get_secret_key_by_userID): new function. (gpapa_create_key_pair): return the created public and secret keys. * gpapakey.c: (gpapa_key_set_expiry_date): function implemented. * gpapapublickey.c: (gpapa_public_key_get_keytrust), (gpapa_public_key_get_ownertrust): handle case 'q'. (gpapa_public_key_set_ownertrust): function implemented. (gpapa_public_key_delete): added confirmation to `gpg' call. * gpapasecretkey.c: (gpapa_secret_key_delete): added confirmation to `gpg' call. (gpapa_secret_key_create_revocation): function implemented. * gpapatest.c: (test_genkey), (test_gpapa_key_set_expiry_date): new functions. (main): call new functions. Wed 25 Oct 2000 16:42 Jan van Heys Peter Gerwinski * gpapaintern.c: introduced "#define TEST_PASSPHRASE" hack to provide a dummy passphrase "test" for testing purposes. (spawn_gnupg): close the input pipe after writing the commands to it. (handle_status, handle_output_line): fixed bug which caused incomplete lines to jam the pipe i/o. * gpapa.c (gpapa_create_key_pair): function implemented. * gpapapublickey.c (gpapa_public_key_sign): function implemented. 2000-09-01 Werner Koch * gpapafile.c (status_check): Avoid extra allocation and made function more stable. * gpapaintern.c: The whole thing has been restructed. 2000-08-30 Werner Koch * gpapaintern.c (spawn_gnupg): New. Started to rework the GnuPG invocation stuff for easier debugging of Windows problem. 2000-07-31 16:35:40 Werner Koch (wk@habibti.openit.de) * gpapaintern.c (gpapa_call_gnupg) [MINGW32]: SetHandleInformation() is not available under Windows9[58]; so we do not print the error message. Fixed a stupid SEGV problem with fprintf. 2000-07-10 18:11:21 Werner Koch (wk@habibti.openit.de) * build-dll, README: New. * gpapatest.c [MINGW32]: Implement xmalloc etc. here 2000-05-25 17:51:21 Werner Koch (wk@habibti.openit.de) * gpapa.c (gpapa_init): Add gpg parameter. (gpapa_private_get_gpg_program): New. * gpapaintern.c (gpapa_call_gnupg): Use this new function. 2000-05-16 19:53:49 Werner Koch (wk@habibti.openit.de) Ran "indent -gnu -sc" on all source files. 2000-05-16 17:38:06 Werner Koch (wk@habibti.openit.de) * gpapaintern.c (gpapa_call_gnupg) [MINGW32]: Some stuff works now. 2000-05-11 16:54:10 Werner Koch (wk@habibti.openit.de) * gpapaintern.c (gpapa_call_gnupg) [MINGW32]: Dummy code for W32. Excluded one header for W32. 10 May 2000 26:56 Peter Gerwinski All non-interactive parts of the public and secret key editors work. Encrypting, decrypting, and signing files works. 2000-05-02 19:45:30 Werner Koch (wk@habibti.openit.de) Replaced all concat() by xstrcat2(). Replaced some parameters named index by idx to avoid compiler warnings due to the index(3). 2000-05-02 18:32:57 Werner Koch (wk@habibti.openit.de) * Makefile.am: New. Included the config.h as the header of each .c file. Removed the libiberty.h header. Wed 26 Apr 2000 26:07 Peter Gerwinski * gpapa.c: re-implemented key ring extraction to keep them in memory. This is much faster for now but does not scale well and must be replaced by something more sophisticated in the future. Wed 26 Apr 2000 12:53 Peter Gerwinski * m: create an `.a'. * upload: new file. Wed 26 Apr 2000 10:10 Peter Gerwinski * gpapaintern.c: gpapa_call_gnupg(): get the passphrase as an additional parameter instead of using a callback. Tue 25 Apr 2000 26:25 Peter Gerwinski Signing works. * gpapaintern.c: gpapa_call_gnupg() can handle passphrases. In fact for the way it is implemented, the callback is not necessary. Do we want to keep it? Tue 25 Apr 2000 14:00 Peter Gerwinski Getting information about keys works, including fingerprints and such, but not including signatures and such. Sun 23 Apr 2000 28:00 Peter Gerwinski * gpapaintern.c: gpapa_call_gnupg() works. Sat 22 Apr 2000 Peter Gerwinski Started implementing. Thu 20 Apr 2000 Markus Gerwinski Finished design. Tue 18 Apr 2000 Markus Gerwinski Started with design. Created the name "GPAPA". Wed 5 Apr 2000 Markus Gerwinski Wrote down requirements. Tu 16 May 2000 Markus Gerwinski - Did a lot of major changes in the header of gpapa_create_key_pair. - Detached methods set_expiry_date and set_expiry_time from class GpapaSecretKey and attached them to GpapaKey.