aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* core: New global flag "require-gnupg".Werner Koch2016-08-163-0/+39
| | | | | | | | | | | * src/gpgme.c (gpgme_set_global_flag): Add flag. * src/engine.c (engine_minimal_version): New variable. (_gpgme_set_engine_minimal_version): New function. (gpgme_get_engine_info): Check that flag. * tests/run-keylist.c (main): New option --require-gnupg. Signed-off-by: Werner Koch <[email protected]>
* core: Simplify setting of dummy versions.Werner Koch2016-08-165-14/+42
| | | | | | | | | | | | | | | | * src/engine.c (_gpgme_engine_info_release): Do not assert but free FILE_NAME. (gpgme_get_engine_info): Provide default for VERSION and REQ_VERSION. Use calloc instead of malloc. (_gpgme_set_engine_info): Ditto. * src/engine-assuan.c (llass_get_version): Return NULL. (llass_get_req_version): Ditto. * src/engine-spawn.c (engspawn_get_version): Ditto. (engspawn_get_req_version): Ditto. * src/engine-uiserver.c (uiserver_get_version): Ditto. (uiserver_get_req_version): Ditto. Signed-off-by: Werner Koch <[email protected]>
* core: Make use of the "size-hint" in engine-gpg.Werner Koch2016-08-121-2/+43
| | | | | | | | | | | | | | * src/engine-gpg.c: Include data.h. (add_input_size_hint): New. (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign, gpg_sign) (gpg_verify): Call new function, * tests/run-encrypt.c (status_cb): Print to stderr. (progress_cb): New.o (main): Add option --progress. Print full-status lines. Provide a size for the input data. Signed-off-by: Werner Koch <[email protected]>
* core: Add gpgme_data_set_flag to add more meta data to data objects.Werner Koch2016-08-127-0/+67
| | | | | | | | | | | * src/gpgme.h.in (gpgme_data_set_flag): New public function. * src/data.c (gpgme_data_set_flag): New. (_gpgme_data_get_size_hint): New. * src/data.h (strucy gpgme_data): Add field 'size_hint'. * src/gpgme.def, src/libgpgme.vers: Add new function. * src/conversion.c (_gpgme_string_to_off): New. Signed-off-by: Werner Koch <[email protected]>
* core: Do not identify PNG files as PGP signatures.Werner Koch2016-08-101-0/+5
| | | | | | | | * src/data-identify.c (next_openpgp_packet): Blacklist PNG files. -- GnuPG-bug-id: 2314 Signed-off-by: Werner Koch <[email protected]>
* core: Handle ENCRYPT_SYMMETRIC also for sig & encAndre Heinecke2016-08-101-4/+7
| | | | | * src/engine-gpg.c (gpg_encrypt_sign): Handle ENCRYPT_SYMMETRIC flag.
* core: Ensure err is initalized in gpg_encryptAndre Heinecke2016-08-101-1/+1
| | | | * src/engine-gpg.c (gpg_encrypt): Initialize err.
* core: Add support for mixed symmetric and asym encAndre Heinecke2016-08-092-4/+8
| | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_encrypt_flags_t): New flag GPGME_ENCRYPT_SYMMETRIC. * src/engine-gpg.c (gpg_encrypt): Also add --symmetric if the flag is given. * NEWS: Mention new flag. * tests/run-encrypt.c (show_usage): Extend for --symmetric. (main): Handle --symmetric. (main): Set passphrase_cb in loopback mode. (main): Fix encrypt call if no recipients are given. * tests/gpg/t-encrypt-mixed.c: New. * tests/gpg/Makefile.am (c_tests): Add new test. * doc/gpgme.texi: Document new flag.
* core: Let GPGME_PROTOCOL_ASSUAN pass Assuan comments through.Werner Koch2016-08-081-0/+1
| | | | | | | | * src/engine-assuan.c (llass_new): Set ASSUAN_CONVEY_COMMENTS, -- GnuPG-bug-id: 2429 Signed-off-by: Werner Koch <[email protected]>
* core: Extend gpgme_subkey_t to carry the keygrip.Werner Koch2016-08-044-7/+37
| | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_subkey): Add file 'keygrip'. * src/key.c (gpgme_key_unref): Free KEYGRIP. * src/keylist.c (keylist_colon_handler): Parse GRP records. * src/engine-gpg.c (gpg_keylist_build_options): Do not use --with-fingerprint options for gpg versions >= 2.1.15. * tests/run-keylist.c (main): Print subkeys and keygrips. Signed-off-by: Werner Koch <[email protected]>
* src: Fix dummy engine versions.Justus Winter2016-07-283-6/+6
| | | | | | | | | | | | | | | Previously, 'gpgme_engine_check_version' failed for these protocols because the version parser failed to parse the dummy versions. * src/engine-assuan.c (llass_get_version): Use a version triple that the parser can understand. (llass_get_req_version): Likewise. * src/engine-spawn.c (engspawn_get_version): Likewise. (engspawn_get_req_version): Likewise. * src/engine-uiserver.c (uiserver_get_version): Likewise. (uiserver_get_req_version): Likewise. Signed-off-by: Justus Winter <[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-134-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | * 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]>
* core: Pass the engine's version string to the engine's new function.Werner Koch2016-07-139-9/+42
| | | | | | | | | | | | | | | | | * src/engine-backend.h (engine_ops): Add arg 'version' to NEW. * src/engine-assuan.c (llass_new): Add dummy arg 'version'. * src/engine-g13.c (g13_new): Ditto. * src/engine-gpgconf.c (gpgconf_new): Ditto. * src/engine-gpgsm.c (gpgsm_new): Ditto. * src/engine-spawn.c (engspawn_new): Ditto. * src/engine-uiserver.c (uiserver_new): Ditto. * src/engine.c (_gpgme_engine_new): Pass version string to the new function. * src/engine-gpg.c (struct engine_gpg): Add field 'version'. (gpg_new): Add arg 'version'. (gpg_release): Free VERSION. Signed-off-by: Werner Koch <[email protected]>
* src: Fix error handling.Justus Winter2016-07-081-2/+7
| | | | | | | * src/encrypt.c (encrypt_status_handler): Fix error handling, || conflates errors. Signed-off-by: Justus Winter <[email protected]>
* w32: Fallback to 2.1 reg key for gpgconf searchAndre Heinecke2016-07-051-3/+14
| | | | | | | | | * src/w32-util.c (_gpgme_get_gpgconf_path): Fallback to 2.1 installer registry key. -- Finding gpgconf is utterly important so we should be as compatible as possible.
* core: Clarify documentation of tofu_stats addressAndre Heinecke2016-07-011-1/+6
| | | | | | | | * src/gpgme.h.in: Mention that Address is not always in addr-spec. -- The old comment made it look like you could always expect the address to be parsable as a mailbox address.
* core: Fix identify for armored detached sigsAndre Heinecke2016-07-011-1/+1
| | | | | | | | | | | | | * src/data-identify.c (basic_detection): Return signature for signature. -- This causes identify to return signature for both binary and ascii armored detached signatures where previously it would have returned signed for armored signatures and signature for binary signatures. GnuPG-Bug-Id: 2314
* core: Add closer inspection of "PGP MESSAGE".Werner Koch2016-06-231-2/+27
| | | | | | | * src/data-identify.c (inspect_pgp_message): New. (basic_detection): Un-const arg DATA. Call inspect_pgp_message. Signed-off-by: Werner Koch <[email protected]>
* core: Add a base 64 decoder.Werner Koch2016-06-233-1/+272
| | | | | | | | | | | | | | * src/b64dec.c: New. Taken from gnupg. Prefix function names with _gpgme_ and change to use standard C malloc functions. * src/util.h.h (struct b64state): New. * src/Makefile.am (main_sources): Add file. -- The file b64dec.c has been taken from gnupg commit e430ff6ad0b7dcfcebd92b825dd5168205447ff3 Signed-off-by: Werner Koch <[email protected]>
* core: Detect compressed signed OpenPGP data.Werner Koch2016-06-221-9/+18
| | | | | | | | * src/data-identify.c (next_openpgp_packet): Allow partial encoding. (pgp_binary_detection): Handle compressed packets. -- 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]>
* core: Enhance gpgme_data_identify to detect binary PGP messages.Werner Koch2016-06-212-1/+231
| | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_DATA_TYPE_PGP_ENCRYPTED): New. (GPGME_DATA_TYPE_PGP_SIGNATURE): New. * src/data-identify.c: Add enum for OpenPGP packet types. (buf32_to_ulong): New. (next_openpgp_packet): New. Based on the gnupg/kbx/keybox-openpgp.c implementation and relicensed to LGPL by g10 Code. (pgp_binary_detection): New. (basic_detection): Call pgp_binary_detection instead of returning unknown. Signed-off-by: Werner Koch <[email protected]>
* core: Make sure FD_SET is not used with an out of range fd.Werner Koch2016-06-141-0/+12
| | | | | | | * src/posix-io.c (_gpgme_io_select): Check for FD out of range. -- Signed-off-by: Werner Koch <[email protected]>
* core: Set notation flags for verify.Werner Koch2016-06-013-8/+42
| | | | | | | | | | | | | * src/gpgme.h.in (GPGME_STATUS_NOTATION_FLAGS): New. * src/status-table.c (status_table): Add new status. * src/verify.c (parse_notation): Handle flags. Also fix NOTATION_DATA in case gpg would not percent-escape spaces. (_gpgme_verify_status_handler): Handle flags. * tests/run-verify.c (print_result): Print notaion data. -- Note that this does only work with the soon to be released GnuPG 2.1.13.
* Speedup closing of fds before exec.Werner Koch2016-05-271-7/+47
| | | | | | | | * src/posix-io.c [__linux__]: Include dirent.h. (get_max_fds) [__linux__]: Try to figure out the highest used fd. -- Signed-off-by: Werner Koch <[email protected]>
* src: Fix typo.Justus Winter2016-05-271-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* Improve comments.Justus Winter2016-05-271-4/+6
| | | | | | | | * src/gpgme.h.in (gpgme_data_seek_cb_t, gpgme_data_seek): Clarify that these functions return the new offset. (gpgme_data_release_cb_t): Fix name of parameter. Signed-off-by: Justus Winter <[email protected]>
* src: Fix trace string.Justus Winter2016-05-251-1/+1
| | | | | | * src/data-compat.c (gpgme_data_new_from_file): Fix trace string. Signed-off-by: Justus Winter <[email protected]>
* api: Return Tofu info for signatures.Werner Koch2016-05-213-1/+259
| | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_tofu_policy_t): New. (gpgme_status_code_t): Add status codes for TOFU. (struct _gpgme_tofu_info, gpgme_tofu_info_t): New. (struct _gpgme_signature): Add field 'tofu'. * src/status-table.c (status_table): Add new codes. * src/verify.c: Include limits.h. (release_tofu_info): New. (release_op_data): Call that. (parse_tofu_user): New. (parse_tofu_stats): New. (parse_tofu_stats_long): New. (_gpgme_verify_status_handler): Handle TOFU status lines. * tests/run-verify.c (print_description): New. (print_result): print tofu info. Signed-off-by: Werner Koch <[email protected]>
* api: Add new context flag "raw-description".Werner Koch2016-05-212-2/+16
| | | | | | | * src/context.h (struct gpgme_context): Add field raw_description. * src/gpgme.c (gpgme_set_ctx_flag): New flag. Signed-off-by: Werner Koch <[email protected]>
* core: New functions to help parsing of status lines.Werner Koch2016-05-212-0/+56
| | | | | | | | * src/conversion.c (_gpgme_split_fields): New. (_gpgme_strtoul_field): New. -- Signed-off-by: Werner Koch <[email protected]>
* api: Add new function gpgme_set_ctx_flag.Werner Koch2016-05-1920-51/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_set_ctx_flag): New prototype. * src/gpgme.c (gpgme_set_ctx_flag): New. * src/gpgme.def, src/libgpgme.vers: Add new function. * src/context.h (struct gpgme_context): Add FULL_STATUS. * src/decrypt.c (_gpgme_decrypt_status_handler): Do not call the status callback if FULL_STATUS is set. * src/genkey.c (genkey_status_handler): Ditto. * src/passphrase.c (_gpgme_passphrase_status_handler): Ditto. * src/sign.c (_gpgme_sign_status_handler): Ditto. * src/engine-backend.h (struct engine_ops): Add SET_STATUS_CB and add adjust all definitions of that variable. * src/engine.c (_gpgme_engine_set_status_cb): New. * src/op-support.c (_gpgme_op_reset): Call this function. * src/engine-gpg.c (struct engine_gpg): Add fields MON_CB and MON_CB_VALUE. (gpg_set_status_cb): New. (_gpgme_engine_ops_gpg): Register that function. (read_status): Call the monitor callback. * src/engine-gpgsm.c (struct engine_gpgsm): Add fields MON_CB and MON_CB_VALUE. (_gpgme_engine_ops_gpgsm): Register that function. (gpgsm_assuan_simple_command): Change first arg to be an engine context and adjust call callers. Call the monitor callback. * src/engine-uiserver.c (struct engine_uiserver): Add fields MON_CB and MON_CB_VALUE. (_gpgme_engine_ops_uiserver): Register that function. (uiserver_assuan_simple_command): Change first arg to be an engine context and adjust call callers. Call the monitor callback. * tests/run-verify.c (status_cb): New. (print_result): Print algo names. (main): Add option --status. -- This new feature is mainly intended for bug tracking. Having access to the raw status lines might also be useful for applications, though. Signed-off-by: Werner Koch <[email protected]>
* api: Remove arbitrary restriction from gpgme_op_verify.Werner Koch2016-05-191-2/+0
| | | | | | | | | | | | | * src/verify.c (verify_start): Do not return GPG_ERR_INV_VALUES when when SIGNED_TEXT is not given. -- The original idea behind this restriction probably was that it is useless to verify a non-detached signatures without also returning the signed text. However, it is sometimes useful to just check the signature, for example to see who signed it. Signed-off-by: Werner Koch <[email protected]>
* Fix typo in compatibility declarationAndre Heinecke2016-05-181-1/+1
| | | | | | | | * src/op-support.c (GPG_ERR_SUBKEYS_EXP_REV): Change to GPG_ERR_SUBKEYS_EXP_OR_REV. -- This fixes the build with libgpg-error < 1.23
* Return dedicated error code for all subkeys expired or revoked.Werner Koch2016-05-176-15/+123
| | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_STATUS_KEY_CONSIDERED): New. (GPGME_SIGSUM_TOFU_CONFLICT): New. * src/status-table.c (KEY_CONSIDERED): New. * src/op-support.c (_gpgme_parse_inv_recp): Add argc KC_FPR and KC_FLAGS. Use calloc. Detect all expired or revoked subkeys. (_gpgme_parse_key_considered): New. * src/sign.c (op_data_t): Add fields KC_FPR and KC_FLAGS. (release_op_data): Free KC_FPR. (_gpgme_sign_status_handler): Handle STATUS_KEY_CONSIDERED. * src/encrypt.c (op_data_t): Add fields KC_FPR and KC_FLAGS. (release_op_data): Free KC_FPR. (_gpgme_encrypt_status_handler): Handle STATUS_KEY_CONSIDERED. Signed-off-by: Werner Koch <[email protected]>
* Merge branch 'gpgmepp'Andre Heinecke2016-05-105-1938/+2
|\
| * Remove obsolete w32-qt codeAndre Heinecke2016-03-085-1938/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (w32-qt): Remove option and Qt checks. * src/Makefile.am: Remove BUILD_W32_QT handling. * src/kdpipeiodevice.cpp, src/kdpipeiodevice.h, src/kdpipeiodevice.moc, src/w32-qt-io.cpp: Removed. -- This code was intended for Kleopatra but Kleopatra is not using it anymore. QGpgme/dataprovider is a better replacement for this.
* | Allow cc to detect missing cases in a switch.Werner Koch2016-05-101-2/+2
|/ | | | | | | * src/delete.c (delete_status_handler): Remove default case from a switch so that cc can check the use of all enum values. Signed-off-by: Werner Koch <[email protected]>
* Fix possible _SC_OPEN_MAX max problem on AIX.Werner Koch2016-01-151-0/+13
| | | | | | | | * src/posix-io.c [HAVE_STDINT_H]: Include stdint.h. (get_max_fds): Limit returned value for too high values. -- Signed-off-by: Werner Koch <[email protected]>
* w32: Avoid conflict with Mingw-w64 version 4.0.4-1Werner Koch2015-12-091-2/+2
| | | | | | | | | | | * src/w32-util.c (mkstemp): Rename to my_mkstemp. Change caller. -- For some reason the linker seems to use the mkstemp now provided by mingw instead of our static symbol. Strange. Reported-by: Andrej Kacian <[email protected]> Signed-off-by: Werner Koch <[email protected]>
* Return on user cancellation of delete operationDaiki Ueno2015-12-041-0/+32
| | | | | | | * src/delete.c (delete_status_handler): Return on ERROR status, if the error location is set to "delete_key.secret" and the code is either CANCELED or FULLY_CANCELED, which indicates a situation that the user selected "No" on the confirmation dialog.
* Fix typos found by codespell.Justus Winter2015-12-027-12/+12
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* Make use of user passphrase handler during passwd.Ben Kibbey2015-10-291-0/+8
| | | | | | | | * src/passwd.c (passwd_start): set engine passphrase command handler. -- This allows for inquiring a passphrase when changing a passphrase rather than requiring a pinentry.
* w32: Add extra diagnostic about possible missing gpgme-w32spawn.exe.Werner Koch2015-10-281-2/+7
| | | | | | * src/w32-io.c (_gpgme_io_spawn): Add a new diagnostic. Signed-off-by: Werner Koch <[email protected]>
* w32: Improve locating gpgconf on 64 bit systems.Werner Koch2015-10-281-2/+7
| | | | | | | * src/w32-util.c (find_program_at_standard_place): Fallback to CSIDL_PROGRAM_FILESX86. Signed-off-by: Werner Koch <[email protected]>
* w32: Add new global flag "w32-inst-dir".Werner Koch2015-10-284-1/+41
| | | | | | | | | | | | | | | * src/gpgme.c (gpgme_set_global_flag): Add flag "w32-inst-dir"; * src/posix-util.c (_gpgme_set_override_inst_dir): New stub. * src/w32-util.c (override_inst_dir): New var. (_gpgme_get_inst_dir): Return this var is set. (_gpgme_set_override_inst_dir): New. -- See https://lists.gnupg.org/pipermail/gnupg-devel/2015-September/030267.html for background. Signed-off-by: Werner Koch <[email protected]>
* cleanup: Fix type mismatch around gpgme_error_t.NIIBE Yutaka2015-10-162-2/+2
| | | | | | * src/data-compat.c (gpgme_error_to_errno): Use gpg_err_code to get error code from gpgme_error_t. * src/gpgme.c (gpgme_new): Don't use gpgme_error.
* gpgme-tool: Switch to argparse.c for option parsing.Werner Koch2015-08-314-491/+1862
| | | | | | | | | | | | | | * 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 gpgme_pubkey_algo_stringWerner Koch2015-08-306-29/+70
| | | | | | | | | | * src/gpgme.h.in (GPGME_PK_EDDSA): New. (gpgme_pubkey_algo_string): New. * src/conversion.c (_gpgme_map_pk_algo): Add new algo. * src/gpgme.c (gpgme_pubkey_algo_string): New. (gpgme_pubkey_algo_name): Reformat. Signed-off-by: Werner Koch <[email protected]>