summaryrefslogtreecommitdiff
path: root/src/key.c
Commit message (Collapse)AuthorAgeFilesLines
* core: Extend gpgme_key_sig_t with trust signature members.Ingo Klöcker2021-05-051-0/+1
| | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_key_sig): Add fields 'trust_depth', 'trust_value', and 'trust_scope'. * src/key.c (gpgme_key_unref): Free trust_scope. * src/keylist.c (keylist_colon_handler): Set the fields. * tests/run-keylist.c (main): Print the fields. -- The trust signature values are part of gpg's output since the year 2003. This now adds support to gpgme. GnuPG-bug-id: 5245, 5419
* core: Extend gpgme_user_id_t with uidhash member.Werner Koch2019-12-131-0/+1
| | | | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_user_id): Add field 'uidhash'. * src/key.c (gpgme_key_unref): Free it. * src/keylist.c (keylist_colon_handler): Set it. * tests/run-keylist.c (main): Print it. -- The uidhash value is part of gpg's output since the year 2005. This now adds support to gpgme. The application for uidhash is to select a user id in an edit interactor: Instead of giving the number of the user id, the uidhash value can be be used to avoid tracking the user id numbers. Signed-off-by: Werner Koch <wk@gnupg.org>
* Add SPDX identifiers to most source filesWerner Koch2018-11-161-19/+19
| | | | | | -- Signed-off-by: Werner Koch <wk@gnupg.org>
* Fix a couple of bugs pointed out by clang compiler warnings.Marcus Brinkmann2017-08-231-1/+1
| | | | | | | * src/engine-gpgconf.c (gpgconf_config_dir_cb): Fix cast. * src/key.c (_gpgme_key_add_sig): Fix pointer reference. Signed-off-by: Marcus Brinkmann <mb@g10code.com>
* core: Cleanup gpgme_key_unref freesAndre Heinecke2017-02-011-17/+8
| | | | * src/key.c (gpgme_key_unref): Nowadays we assume free(NULL) is ok.
* core: Fix leakage of address for mail only uidsAndre Heinecke2017-02-011-9/+1
| | | | | | | | | | * src/key.c (gpgme_key_unref): Always free address if set. (_gpgme_key_append_name): Remove memory optimization for address. -- The check if address is not allocated would now be more complicated then just comparing it to email because email is set to address also when an email was not parsed from the user id.
* core: Improve mailbox only uid handlingAndre Heinecke2017-02-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | * src/key.c (_gpgme_key_append_name): Set email and remove name for uid only keys. -- If we have a name and no email but the name can be parsed as an address we now treat the address as email and remove the name. This fixes downstream users that rely on email to show email addresses and don't expilicity handle this case. E.g. A userid foo@example.com was: uid->name = "foo@example.com" uid->email = "" uid->address = "foo@example.com" It is now: uid->name = "" uid->email = "foo@example.com" uid->address = "foo@example.com"
* core: Change the way TOFU information are represented.Werner Koch2016-08-231-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_signature): Remove field 'tofu'. Add field 'key'. (struct _gpgme_key): Add field 'fpr'. (struct _gpgme_user_id): Add field 'tofu'. (struct _gpgme_tofu_info): Remove fields 'address' and 'fpr'. * src/key.c (gpgme_key_unref): Release TOFU and FPR. * src/keylist.c (keylist_colon_handler): Store the fingerprint of the first subkey also in KEY. * src/verify.c (release_tofu_info): Remove. (release_op_data): Release KEY. (parse_tofu_user): Rewrite for new data structure. (parse_tofu_stats): Ditto. (parse_tofu_stats_long): Ditto. * tests/run-verify.c (print_result): Ditto. * tests/run-keylist.c (main): Print more fields. -- TOFU information are now associated with the user ID and not with a separate object. Note that this breaks code relying on the former non-released TOFU feature. The C++ bindings won't work right now. Signed-off-by: Werner Koch <wk@gnupg.org>
* core: Extend gpgme_user_id_t with 'address'.Werner Koch2016-08-231-0/+12
| | | | | | | | | * src/mbox-util.c, src/mbox-util.h: Adjust for use in gpgme. * src/Makefile.am (main_sources): Add mbox-util. * src/key.c (_gpgme_key_append_name): Set 'address' field of uid. (gpgme_key_unref): Free it. Signed-off-by: Werner Koch <wk@gnupg.org>
* core: Extend gpgme_subkey_t to carry the keygrip.Werner Koch2016-08-041-0/+2
| | | | | | | | | | | | * 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 <wk@gnupg.org>
* Add field CURVE to the key info.Werner Koch2014-05-081-0/+2
| | | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_subkey): Add field CURVE. * src/key.c (gpgme_key_unref): Free CURVE. * src/keylist.c (keylist_colon_handler): Set CURVE. * src/gpgme.c (gpgme_release): For failsafe reasons reset engine and engine info after freeing. -- The engine hack is useful in case the other release functions accidently call engine release.
* Use gpg_error_from_syserror instead of directly accessing errno.Werner Koch2013-02-061-3/+3
| | | | | | | | -- 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.
* Trace the use of GPG_ERR_INV_ENGINE.Werner Koch2012-10-191-0/+1
| | | | | | | | | | | | | | * src/debug.h: Include "gpgme.h" (_gpgme_trace_gpgme_error): New. (trace_gpg_error): New macro. Use it in all files where we return GPG_ERR_INV_ENGINE; also "include debug.h" as needed. -- This is a pretty common error code but often it is hard to figure out the actual cause. With debug level 4 we now print the file name and line number where this error code is generated by gpgme. Along with the git revision printed in the first log lines, this should give us an easier way to track down the problems related to this error code.
* Remove all trailing whitespace from source filesWerner Koch2012-09-251-20/+20
| | | | | -- Command used: sed -i 's,[ \t]*$,,' FILE
* 2010-04-19 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann2010-04-191-1/+1
| | | | | | | | | | | | | | | | * assuan-support.c (my_spawn): Cast to avoid warning. * engine-g13.c (g13_new): Make ARGV array of pointer to const char. (g13_assuan_simple_command) [!USE_DESCRIPTOR_FUNCTION]: Don't define. * ops.h (_gpgme_key_append_name): Same in prototype. * key.c (_gpgme_key_append_name): Make SRC argument pointer to const char. * posix-util.c (_gpgme_get_uiserver_socket_path): Make HOMEDIR const. * vfs-mount.c (gpgme_op_vfs_transact_start): Never define this potentially useful but currently unused function. * vfs-create.c (gpgme_op_vfs_transact_start): Likewise.
* 2009-11-10 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann2009-11-101-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Activate UIServer if FD passing is enabled and Assuan is available. m4/ 2009-11-10 Marcus Brinkmann <marcus@g10code.de> * libassuan.m4: Fix LIBASSUAN_VERSION. src/ 2009-11-10 Marcus Brinkmann <marcus@g10code.de> * 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.
* Provide inforation about smartcards.Werner Koch2009-02-041-0/+2
|
* 008-11-03 Marcus Brinkmann <marcus@g10code.com>Marcus Brinkmann2008-11-031-0/+724
* configure.ac: Replace gpgme paths with src. * gpgme: Move to ... * src: ... this new directory. assuan/ 2008-11-03 Marcus Brinkmann <marcus@g10code.com> * Makefile.am (INCLUDES): Replace gpgme path with src. tests/ 2008-11-03 Marcus Brinkmann <marcus@g10code.com> * gpgsm/Makefile.am (INCLUDES, LDADD): Replace gpgme path with src. * gpg/Makefile.am (INCLUDES, LDADD, t_thread1_LDADD): Likewise. * Makefile.am (LDADD): Likewise.