summaryrefslogtreecommitdiffstats
path: root/g10/kbnode.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Avoid importing secret keys if the keyblock is not valid.Werner Koch2019-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keydb.h (struct kbnode_struct): Replace unused field RECNO by new field TAG. * g10/kbnode.c (alloc_node): Change accordingly. * g10/import.c (import_one): Add arg r_valid. (sec_to_pub_keyblock): Set tags. (resync_sec_with_pub_keyblock): New. (import_secret_one): Change return code to gpg_error_t. Return an error code if sec_to_pub_keyblock failed. Resync secret keyblock. -- When importing an invalid secret key ring for example without key binding signatures or no UIDs, gpg used to let gpg-agent store the secret keys anyway. This is clearly a bug because the diagnostics before claimed that for example the subkeys have been skipped. Importing the secret key parameters then anyway is surprising in particular because a gpg -k does not show the key. After importing the public key the secret keys suddenly showed up. This changes the behaviour of GnuPG-bug-id: 4392 to me more consistent but is not a solution to the actual bug. Caution: The ecc.scm test now fails because two of the sample keys don't have binding signatures. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Add option and preference framework for AEAD.Werner Koch2018-01-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/openpgpdefs.h (aead_algo_t): New. (SIGSUBPKT_PREF_AEAD): New. * g10/gpg.c (oAEADAlgo, oPersonalAEADPreferences): New. (opts): New options --aead-algo and --personal-aead-preferences. (set_compliance_option): Clar aead algo. (main): Parse and check the new options * g10/options.h (struct opt): Add fields def_aead_algo and personal_aead_prefs. * g10/packet.h (PREFTYPE_AEAD): New enum value. (PKT_user_id): Add field flags.aead. (PKT_public_key): Add field flags.aead. * g10/pkclist.c (select_algo_from_prefs): Support PREFTYPE_AEAD. * g10/getkey.c (fixup_uidnode): Set AEAD flag. (merge_selfsigs): Ditto. * g10/kbnode.c (dump_kbnode): Show aead flag. * g10/keyedit.c (show_prefs): Ditto. (show_key_with_all_names_colon): Ditto. * g10/keygen.c (aead_presf, n_aead_prefs): New vars. (set_one_pref): Suppport PREFTYPE_AEAD. (keygen_set_std_prefs): Parse AEAD preferences. (keygen_get_std_prefs): Ditto. (add_feature_aead): New. (keygen_upd_std_prefs): Call that and build AEAD pref packet. * g10/main.h (DEFAULT_AEAD_ALGO): New const. * g10/misc.c (openpgp_aead_test_algo): New. (openpgp_aead_algo_name): New. (string_to_aead_algo): New. (default_aead_algo): New. -- This is only used in --rfc4880bis mode and not really tested. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Extend free_packet to handle a packet parser context.Werner Koch2017-03-291-4/+4
| | | | | | | | | | | | | | | * g10/packet.h (struct parse_packet_ctx_s): Add fields LAST_PKT and FREE_LAST_PKT. (init_parse_packet): Clear them. (deinit_parse_packet): New macro. Change all users if init_parse_packet to also call this macro. * g10/free-packet.c (free_packet): Add arg PARSECTX and handle shallow packet copies in the context. Change all callers. * g10/parse-packet.c (parse): Store certain packets in the parse context. -- Signed-off-by: Werner Koch <wk@gnupg.org>
* g10: Move more flags into the flag bitfield.Justus Winter2017-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/packet.h (PKT_user_id): Move 'is_primary', 'is_revoked', and 'is_expired' into the flags bitfield, and drop the prefix. * g10/call-dirmngr.c: Adapt accordingly. * g10/export.c: Likewise. * g10/getkey.c: Likewise. * g10/import.c: Likewise. * g10/kbnode.c: Likewise. * g10/keyedit.c: Likewise. * g10/keylist.c: Likewise. * g10/keyserver.c: Likewise. * g10/mainproc.c: Likewise. * g10/pkclist.c: Likewise. * g10/pubkey-enc.c: Likewise. * g10/tofu.c: Likewise. * g10/trust.c: Likewise. * g10/trustdb.c: Likewise. -- This patch has been created by applying the following semantic patch: @@ expression E; @@ -E->is_expired +E->flags.expired @@ expression E; @@ -E->is_primary +E->flags.primary @@ expression E; @@ -E->is_revoked +E->flags.revoked Signed-off-by: Justus Winter <justus@g10code.com>
* Remove -I option to common.NIIBE Yutaka2017-03-071-1/+1
| | | | | | | | | | | | | * dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* g10: Fix build with disabled kbnode cache.Justus Winter2016-07-011-2/+2
| | | | | | | * g10/kbnode.c (release_unused_nodes): Fix build with disabled kbnode cache. Signed-off-by: Justus Winter <justus@g10code.com>
* gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch2016-04-291-1/+0
| | | | Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Fix a missing LF in debug output.Werner Koch2014-11-131-0/+2
| | | | | | * g10/kbnode.c (dump_kbnode): Print a LF. Signed-off-by: Werner Koch <wk@gnupg.org>
* Fix minor compiler warnings.Werner Koch2013-11-151-0/+1
| | | | --
* Add code to allow for late memory cleanup.Werner Koch2013-03-201-18/+41
| | | | | | | | | | | | | | | | | | | * common/init.c (mem_cleanup_item_t): New. (run_mem_cleanup): New. (_init_common_subsystems): Add an atexit for it. (register_mem_cleanup_func): New. * g10/kbnode.c (cleanup_registered): New. (release_unused_nodes): New. (alloc_node): Call register_mem_cleanup_func. -- It is often time consuming to figure out whether still allocated memory at process termination is fine (e.g. a cache) or a problem. To help for that register_mem_cleanup_func may now be used to cleanup such memory. The run time of the program will be longer; if that turns out to be a problem we can change the code to only run in debugging mode.
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-5/+5
| | | | | | | | We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
* Make public key data structure easier to read.Werner Koch2010-10-201-3/+3
| | | | | Check vor v1 card while signing.
* Finished the bulk of changes to use estream in most places instead ofWerner Koch2010-03-151-57/+65
| | | | | stdio.
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* Merged with gpg 1.4.3 code. Werner Koch2006-04-191-10/+9
| | | | | The gpg part does not yet build.
* Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch2003-06-181-5/+7
| | | | | | | | | | | to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
* This commit was manufactured by cvs2svn to create branchRepo Admin2003-06-051-0/+399
| | | | 'GNUPG-1-9-BRANCH'.
* This commit was manufactured by cvs2svn to create branchRepo Admin2002-10-191-399/+0
| | | | 'GNUPG-1-9-BRANCH'.
* Update head to match stable 1.0David Shaw2002-06-291-20/+36
|
* See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch2000-07-141-3/+4
|
* See ChangeLog: Mon Jan 24 13:04:28 CET 2000 Werner KochWerner Koch2000-01-241-6/+6
|
* See ChangeLog: Sat May 22 22:47:26 CEST 1999 Werner KochWerner Koch1999-05-221-28/+92
|
* See ChangeLog: Thu May 6 14:18:17 CEST 1999 Werner KochWerner Koch1999-05-061-1/+2
|
* See ChangeLog: Wed Dec 23 13:34:22 CET 1998 Werner KochWerner Koch1998-12-231-3/+3
|
* Epxerimenta support for GDBM keyings.Werner Koch1998-10-211-0/+1
|
* backupWerner Koch1998-10-121-4/+32
|
* edit-key is now completeWerner Koch1998-07-291-2/+3
|
* textual changesWerner Koch1998-06-291-11/+11
|
* changes from laptopWerner Koch1998-04-251-1/+1
|
* applied Mathews typo and grammar fixesWerner Koch1998-04-141-6/+6
|
* test releaseWerner Koch1998-04-081-1/+2
|
* partial DSA supportWerner Koch1998-03-091-2/+2
|
* Renamed to GNUPGV-0-2-8Werner Koch1998-02-241-4/+4
|
* import worksWerner Koch1998-02-171-7/+69
|
* some import functionalityWerner Koch1998-02-161-1/+27
|
* added option exportV0-2-6Werner Koch1998-02-131-4/+5
|
* bug fixesWerner Koch1998-02-121-5/+2
|
* a couple of changes; but some parts are now brokenWerner Koch1998-02-111-39/+69
|
* added more stuffWerner Koch1998-01-021-17/+38
|
* better prime number generator. improved ELG key generationWerner Koch1997-12-191-0/+9
|
* added some stuff for signing keysWerner Koch1997-12-161-1/+62
|
* added option file handlingWerner Koch1997-12-121-0/+79