aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpgme-tool.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* doc: Replace http: by https: in core source files.Werner Koch2016-11-161-1/+1
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* core: Use const char * where appropriate.Werner Koch2016-09-131-14/+18
| | | | Signed-off-by: Werner Koch <[email protected]>
* core: Mark unused function args.Werner Koch2016-09-131-0/+18
| | | | Signed-off-by: Werner Koch <[email protected]>
* core: Do not pass const char* to functions taking a char*.Werner Koch2016-09-131-2/+3
| | | | Signed-off-by: Werner Koch <[email protected]>
* Fix including nil bytes in keylist output.Ben Kibbey2016-07-191-6/+6
| | | | | | * src/gpgme-tool.c (cmd_keylist,gt_result): use strlen(). Signed-off-by: Ben Kibbey <[email protected]>
* core: New GPGME_DATA_ENCODING_MIME.Werner Koch2016-07-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_DATA_ENCODING_MIME): New. * src/data.c (gpgme_data_set_encoding): Adjust check. * src/engine-gpg.c (have_gpg_version): New. (gpg_encrypt, gpg_encrypt_sign): Pass flag '--mimemode'. (gpg_sign): Ditto. * lang/cpp/src/data.h (GpgME): Add MimeEncoding. * lang/cpp/src/data.cpp (encoding, setEncoding): Support MimeEncoding. * src/gpgme-tool.c (server_data_encoding): Add flag --mime. -- This feature allows an application to declare that the encrypted or signed data is a valid MIME part. What is missing is a way to return that information to the application after decryption/verification. This can be done by setting the encoding of the output data object; however this requires some internal additions to our processing model. Signed-off-by: Werner Koch <[email protected]>
* tests: Add new test tool run-identify.Werner Koch2016-06-211-0/+2
| | | | | | | | * src/gpgme-tool.c (gt_identify): Add new strings. * tests/run-identify.c: New. * tests/Makefile.am (noinst_PROGRAMS): Add run-identify. Signed-off-by: Werner Koch <[email protected]>
* gpgme-tool: Switch to argparse.c for option parsing.Werner Koch2015-08-311-491/+49
| | | | | | | | | | | | | | * src/argparse.c, src/argparse.h: New. Taken from current gnupg. * src/Makefile.am (gpgme_tool_SOURCES): New. * src/gpgme-tool.c: Remove all argp.h stuff. (my_strusage): New. (main): Change to use argparse. -- As a GnuPG related tool the user should get the same experience in option parsing as with gpg et al. Thus we use the same parser. Signed-off-by: Werner Koch <[email protected]>
* Add an export secret key feature.Werner Koch2015-08-241-1/+7
| | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_EXPORT_MODE_SECRET): New. (GPGME_EXPORT_MODE_RAW): New. (GPGME_EXPORT_MODE_PKCS12): New. * src/export.c (export_start, export_ext_start): Allow new flags. * src/engine-gpg.c (export_common): Support secret key export. * src/engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto. * src/gpgme-tool.c (cmd_export): Add options --secret, --raw, and --pkcs12. * tests/run-export.c (main): Likewise. -- Note that exporting secret X.509 keys requires GnuPG 2.1.8. Signed-off-by: Werner Koch <[email protected]>
* Add option --lib-version to gpgme-tool.Werner Koch2015-07-231-4/+23
| | | | | | * src/gpgme-tool.c (options, parse_options): Add --lib-version (CMD_LIBVERSION): New. (main): Implement.
* gpgme-tool: Print fingerprint and keyid with keyservers.Werner Koch2014-08-121-1/+3
| | | | | * src/gpgme-tool.c (cmd_keylist): Print keyid. Print FPR only if available.
* gpgme-tool: Fix segv for external key listing.Werner Koch2014-08-121-7/+10
| | | | * src/gpgme-tool.c (result_xml_escape): Allow for DATA being NULL.
* Add new keylist mode GPGME_KEYLIST_MODE_WITH_SECRET.Werner Koch2014-06-041-0/+10
| | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_KEYLIST_MODE_WITH_SECRET): New. * src/engine-gpg.c (gpg_keylist_build_options): Handle new mode. * src/engine-gpgsm.c (gpgsm_keylist, gpgsm_keylist_ext): Ditto. * src/keylist.c (parse_sec_field15): Add arg key and take care of --with-secret output. * src/gpgme-tool.c (gt_get_keylist_mode, cmd_keylist_mode): Add "with_secret". Print card info and and secret flag for subkeys. -- Note: This mode may only be used with GnuPG >= 2.1.
* Add GPGME_ENCRYPT_NO_COMPRESS flag.Werner Koch2014-05-081-2/+4
| | | | | | * src/gpgme.h.in (GPGME_ENCRYPT_NO_COMPRESS): New. * src/engine-gpg.c (gpg_encrypt, gpg_encrypt_sign): Implement it. * src/gpgme-tool.c (_cmd_sign_encrypt): Add option --no-compress.
* Add GPGME_PROTOCOL_SPAWN and gpgme_op_spawn.Werner Koch2014-04-101-0/+64
| | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_PROTOCOL_SPAWN): New. (GPGME_SPAWN_DETACHED, GPGME_SPAWN_ALLOW_SET_FG): New. * src/gpgme.c (gpgme_set_protocol): Add new protocol. (gpgme_get_protocol_name): Ditto. * src/spawn.c: New. * src/libgpgme.vers, src/gpgme.def: Add new public functions. * src/engine-spawn.c: New. * src/Makefile.am: Add new files. * src/engine-backend.h (struct engine_ops): Add OPSPAWN. * src/engine.c (engine_ops): Add _gpgme_engine_ops_spawn. (gpgme_get_engine_info): Add Spawn to the list of protocols. (_gpgme_engine_op_spawn): New. * src/gpgme-tool.c (gt_protocol_from_name): Add new protocol. (gt_spawn, cmd_spawn): New.
* Add function gpgme_data_identify.Werner Koch2013-08-091-7/+66
| | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_data_type_t): New. (gpgme_data_identify): New prototype. * src/data-identify.c: New. * src/parsetlv.c, src/parsetlv.h: New. Take from gpa. * src/libgpgme.vers, src/gpgme.def: Add gpgme_data_identify. * src/gpgme-tool.c (status): Add STATUS_IDENTIFY_RESULT. (gt_identify): New. (cmd_identify): New. (hlp_passwd): Move close to cmd_passwd. -- It is often useful to have a way to identify the data which needs processing. This is such a common task that it makes sense to implement this in gpgme to avoid diverging implementations.
* gpgme-tool: Allow for symmetric encryption.Werner Koch2013-05-221-2/+5
| | | | | * src/gpgme-tool.c (gt_sign_encrypt): Pass NULL for recp if no recipients are given.
* Make definition of off_t robust against misbehaving w32 toolchains.Werner Koch2013-05-161-2/+2
| | | | | | | | | | | | | | | | * configure.ac (NEED__FILE_OFFSET_BITS): Change to define gpgme_off_t and gpgme_ssize_t. (API__OFF_T, API__SSIZE_T): New ac_subst. * src/gpgme.h.in: Replace all ssize_t and off_t by ac_subst macros. * src/assuan-support.c, src/ath-pthread.c, src/ath.c, src/ath.h * src/data-compat.c, src/data-fd.c, src/data-mem.c, src/data-stream.c * src/data-user.c, src/data.c, src/data.h, src/engine-gpgsm.c * src/engine-uiserver.c, src/gpgme-tool.c, src/gpgme.c: Replace off_t by gpgme_off_t and sszie_t by gpgme_ssize_t. * src/ath-pthread.c, src/ath.h: Include gpgme.h. -- For a detailed description, see the gpgme.texi diff.
* gpgme_tool: Support GPG's new pinentry-mode.Werner Koch2013-02-071-5/+113
| | | | | | | | | | | * src/gpgme-tool.c (log_error): Do not always print the error source. (gt_set_pinentry_mode): New. (server_passphrase_cb): New. (cmd_pinentry_mode): New. (register_commands): Add cmd_pinentry_mode. (options): Add option --gpg-binary. (struct args): Add field gpg-binary. (parse_options, main): Implement that option.
* Use gpg_error_from_syserror instead of directly accessing errno.Werner Koch2013-02-061-1/+1
| | | | | | | | -- Also fixed a couple of minor thing; e.g. save the error before calling cleanup functions. Do not save the errno if only free is called in between.
* gpgme-tool: Use membuf functions to build up strings.Werner Koch2012-10-111-32/+159
| | | | | | | | | | | * src/gpgme-tool.c (clear_membuf, init_membuf, put_membuf) (put_membuf_str, get_membuf, peek_membuf): Add membuf functions. Take from GnuPG master's common/membuf.[ch] and patch for our use. (result_xml_escape): Rewrite using new functions. -- First counting, then allocating, and finally copying data is prone to errors. We better use the membuf functions which make it much easier.
* gpgme-tool: Change license from LPGLv2+ to GPLv3+Werner Koch2012-10-111-4/+5
| | | | | | | | * src/gpgme-tool.c: Change license notice. -- gpgme-tool.c is a standalone program, thus it makes no sense to keep it under the LGPL. We already had the manual under GPLv3+.
* gpgme-tool: escape special characters in output XML data (<, >, and &).W. Trevor King2012-10-111-2/+67
| | | | | | | | | | | | | | | | | | | | [[PGP Signed Part:Undecided]] src/gpgme-tool.c (result_xml_escape_replacement, result_xml_escape): New. (result_xml_tag_data): Use result_xml_escape() to escape data. (result_add_error): Use unescaped < and >. -- This is a general solution for generating valid XML, but the specific output that inspired the change was from the KEYLIST command: <uid>William Trevor King <[email protected]></uid> Now the uids are properly escaped: <uid>William Trevor King &lt;[email protected]&gt;</uid> Signed-off-by: W. Trevor King <[email protected]>
* gpgme-tool: Fix chain_id -> chain-id in KEYLIST XML.W. Trevor King2012-10-111-1/+1
| | | | | | | | | | [[PGP Signed Part:Undecided]] src/gpgme-tool.c (cmd_keylist): Use <chain-id> instead of <chain_id>. -- All the other tags map struct attribute underscores to hyphens, so fixing <chain_id> follows the priciple of least surprise. Signed-off-by: W. Trevor King <[email protected]>
* gpgme-tool: Return more detailed XML from KEYLISTW. Trevor King2012-09-281-14/+120
| | | | | | | | | | | | | | | | | src/gpgme-tool.c (cmd_keylist): Convert output from a list of to more detailed XML. (xml_preamble1, xml_preamble2, xml_end): Make global. (result_add_protocol, result_add_validity): New functions for generating XML from GPGME types. (result_add_string): Treat NULL strings as "". (result_xml_tag_data): Make 'data' a 'const char' so we can use the value returned by gpgme_get_protocol_name directly. -- This is a first pass at returning most of the gpgme_key_t data from the KEYLIST call. Signed-off-by: W. Trevor King <[email protected]>
* gpgme-tool: Initialize input_fd and output_fdW. Trevor King2012-09-281-0/+2
| | | | | | * src/gpgme-tool.c (gpgme_server): Initialize input_fd and output_fd. Signed-off-by: W. Trevor King <[email protected]>
* gpgme-tool: Fix handling of file descriptorsWerner Koch2012-09-261-16/+35
| | | | | | | | | | | | | | * src/gpgme-tool.c (server_reset_fds): Use close/CloseHandle instead of the assuan close functions. (_cmd_decrypt_verify, _cmd_sign_encrypt, cmd_verify, cmd_import) (cmd_export, cmd_genkey, cmd_getauditlog): Use SERVER object instead of assuan_get_*_fd functions. -- Although we used our own handlers for INPUT and OUTPUT, we still used assuan_get_input_fd, assuan_get_output_fd and their close functions. That clearly can't work because libassuan does not have any values for them.
* Remove all trailing whitespace from source filesWerner Koch2012-09-251-76/+76
| | | | | -- Command used: sed -i 's,[ \t]*$,,' FILE
* gpgme-tool: add help messages for a number of commands.W. Trevor King2012-04-031-23/+137
| | | | | | | | | | * src/gpgme-tool.c (hlp_engine, hlp_sub_protocol, hlp_armor, hlp_textmode, hlp_include_certs, hlp_keylist_mode, hlp_input, hlp_output, hlp_message, hlp_recipient, hlp_signer, hlp_signers_clear, hlp_decrypt, hlp_decrypt_verify, hlp_encrypt, hlp_sign_encrypt, hlp_sign, hlp_verify, hlp_import): New strings. (hlp_protocol): Fix typo. (register_commands): Add documentation strings. (doc): Mention Assuan.
* Allow multiple patterns for KEYLIST.Werner Koch2010-12-081-6/+59
|
* Enable debugging feature for W32CE.Werner Koch2010-10-071-1/+5
| | | | | kFreeBSD portability fix.
* Too embarrassing for a changelog entry.Marcus Brinkmann2010-08-041-1/+1
|
* 2010-08-03 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-08-031-7/+12
| | | | | | | | * gpgme-tool.c (result_encrypt_to_xml, result_sign_to_xml) (result_verify_to_xml, result_import_to_xml) (result_genkey_to_xml): Check vigorously for null pointers.
* 2010-06-10 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-06-101-0/+5
| | | | | | * gpgme-tool.c (gpgme_server): Use special hack for Windows CE to get at stdin and stdout.
* 2010-06-09 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-06-091-46/+191
| | | | | | | | | | | | | | | | | | | | | | * gpgme-tool.c (result_add_timestamp): Add missing NULL argument. (result_sign_to_xml): Protect against NULL fingerprint. (struct server): New members input_fd, input_filename, input_stream output_fd, output_filename, output_stream, message_filename, message_stream. (server_reset_fds): Deallocate those. (server_parse_fd): New function. (server_data_obj): Take optional filename argument and direction argument. Also take new argument to return a filestream that needs to be closed after destroying the data object. Change all callers, too. (input_notify, output_notify): Removed. (cmd_input, cmd_output): New functions. (gpgme_server): Do not register input and output notifier. (register_commands): Use cmd_input and cmd_output. (cmd_message): Rewritten to use server_parse_fd. (cmd_delete, cmd_keylist): Fix inverted option check. (main) [HAVE_W32CE_SYSTEM]: Sleep a bit to work around bug in ssh.
* 2010-05-12 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-05-121-0/+2
| | | | | | | | | | | * configure.ac: Check for setlocale. src/ 2010-05-12 Marcus Brinkmann <[email protected]> * gpgme-tool.c (main): Protect call to setlocale with HAVE_SETLOCALE.
* 2010-05-07 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-05-071-0/+5
| | | | | | | | | * engine-g13.c, gpgme.c, engine-gpgsm.c, engine-gpg.c, op-support.c, engine-assuan.c, gpgme-tool.c: Include <locale.h> only if available with HAVE_LOCALE_H and conditionalize use of LC_CTYPE on its definition. * engine-gpgconf.c: Do not include <locale.h>.
* 2010-05-07 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-05-071-4/+9
| | | | | | | | | | | * engine-gpgsm.c (gpgsm_new, start): Cast between int and assuan_fd_t. * assuan-support.c (my_pipe, my_close, my_read, my_write): Likewise. * gpgme-tool.c (server_data_obj, server_reset_fds, gpgme_server), (my_recvmsg, my_sendmsg, my_spawn): Likewise. * engine-assuan.c (start): Likewise. * engine-g13.c (start): Likewise.
* 2010-05-06 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-05-061-2/+2
| | | | | | | | | | | | | | | | | | | * configure.ac: Require libgpg-error 1.8. src/ 2010-05-06 Marcus Brinkmann <[email protected]> * sign.c, data-user.c, conversion.c, debug.c, verify.c, data.c, decrypt.c, delete.c, assuan-support.c, import.c, engine-gpgsm.c, data-mem.c, op-support.c, w32-io.c, w32-util.c, data-compat.c: Use gpg_error_from_syserror instead gpg_error_from_errno, and use gpg_err_set_errno to set error number. * setenv.c: Include <gpg-error.h> and define __set_errno to use gpg_err_set_errno. * gpgme-tool.c (ARGP_ERR_UNKNOWN): Define to EDEADLOCK (which is mapped in Windows CE) instead of E2BIG (which is not). (gt_import_keys): Initialize err.
* Add option GPGME_EXPORT_MODE_MINIMALWerner Koch2010-02-161-7/+45
|
* Convert C++ comments to C90 comments.Werner Koch2010-02-161-13/+13
|
* Support gpgme_op_apsswd for GPG.Werner Koch2010-01-081-1/+1
|
* 2010-01-07 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-01-071-29/+635
| | | | | | | | | | | | | | | | | * gpgme-tool.c (result_xml_write_cb_t, struct result_xml_state): New types. (MAX_TAGS): New macro. (result_init, result_xml_indent, result_xml_tag_start) (result_xml_tag_data, result_xml_tag_end, result_add_error) (result_add_pubkey_algo, result_add_hash_algo, result_add_keyid) (result_add_fpr, result_add_timestamp, result_add_sig_mode) (result_add_value, result_add_string, result_encrypt_to_xml) (result_decrypt_to_xml, result_sign_to_xml) (result_verify_to_xml, result_import_to_xml) (result_genkey_to_xml, result_keylist_to_xml) (result_vfs_mount_to_xml): New functions. (gt_result): Rewritten.
* Add an API to change passphrases. Currently only implemented forWerner Koch2010-01-051-6/+38
| | | | | GPGSM. Requires GnuPG 2.1
* Add flags to the getauditlog command.Werner Koch2009-12-011-4/+15
|
* Fix segv in printf like functions.Werner Koch2009-12-011-6/+31
|
* 2009-11-25 Marcus Brinkmann <[email protected]>Marcus Brinkmann2009-11-251-3/+3
| | | | | | * gpgme-tool.c (gpgme_server): Use assuan_fd_t and assuan_fdopen on fds.
* 2009-11-10 Marcus Brinkmann <[email protected]>Marcus Brinkmann2009-11-101-4/+16
| | | | | | * gpgme.c (gpgme_new): Set default sub protocol. * gpgme-tool.c: Implement get sub protocol.
* 2009-11-10 Marcus Brinkmann <[email protected]>Marcus Brinkmann2009-11-101-15/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Activate UIServer if FD passing is enabled and Assuan is available. m4/ 2009-11-10 Marcus Brinkmann <[email protected]> * libassuan.m4: Fix LIBASSUAN_VERSION. src/ 2009-11-10 Marcus Brinkmann <[email protected]> * Makefile.am (uiserver_components): New variable. (main_sources): Add it. * ops.h, key.c (_gpgme_key_append_name): Take CONVERT argument, implement it. Adjust callers. (gpgme_key_from_uid): New function. * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_DEFAULT. (gpgme_encrypt_flags_t): Add GPGME_ENCRYPT_PREPARE, GPGME_ENCRYPT_EXPECT_SIGN. (gpgme_set_sub_protocol, gpgme_key_from_uid): New functions. * libgpgme.vers, gpgme.def: Add new functions. * gpgme.c (gpgme_set_protocol): Add UIServer protocol. (gpgme_set_sub_protocol): New function. (gpgme_get_protocol_name): Add UIServer and default protocol. * assuan-support.c: Return correct error values, implement socketpair for POSIX. * priv-io.h, posix-io.c, w32-io.c, w32-glib-io.c, w32-qt-io.cpp (_gpgme_io_spawn): Add ATFORK and ATFORKVALUE arguments. Implement it for POSIX. Adjust all callers. * engine.h, engine-backend.h (_gpgme_engine_set_protocol) (_gpgme_engine_op_decrypt_verify): New prototypes. Adjust all users. * engine.c (engine_ops, gpgme_get_engine_info): Add UIServer engine. (_gpgme_engine_set_protocol, _gpgme_engine_op_decrypt_verify): New function. * decrypt-verify.c (decrypt_verify_start): Call _gpgme_engine_op_decrypt_verify. * util.h, posix-util.c, w32-util.c (_gpgme_get_uiserver_socket_path): New function. * engine-gpgsm.c (gpgsm_set_fd): Fix _gpgme_io_pipe invocation. * gpgme-tool.c: Some support for UIServer protocol. * engine-uiserver.c: New file.
* 2009-11-06 Marcus Brinkmann <[email protected]>Marcus Brinkmann2009-11-061-0/+33
| | | | | | | | | | * gpgme-tool.c (struct gpgme_tool): New members write_data and write_data_hook. (gt_write_data): New function. (gt_result): Output vfs_mount result. (server_write_data): New function. (gpgme_server): Initialize write_data members.