aboutsummaryrefslogtreecommitdiffstats
path: root/g10/kbnode.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-03-15gpg: Avoid importing secret keys if the keyblock is not valid.Werner Koch1-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 <[email protected]>
2018-01-10gpg: Add option and preference framework for AEAD.Werner Koch1-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 <[email protected]>
2017-03-29gpg: Extend free_packet to handle a packet parser context.Werner Koch1-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 <[email protected]>
2017-03-08g10: Move more flags into the flag bitfield.Justus Winter1-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 <[email protected]>
2017-03-07Remove -I option to common.NIIBE Yutaka1-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 <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-07-01g10: Fix build with disabled kbnode cache.Justus Winter1-2/+2
* g10/kbnode.c (release_unused_nodes): Fix build with disabled kbnode cache. Signed-off-by: Justus Winter <[email protected]>
2016-04-29gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch1-1/+0
Signed-off-by: Werner Koch <[email protected]>
2014-11-13gpg: Fix a missing LF in debug output.Werner Koch1-0/+2
* g10/kbnode.c (dump_kbnode): Print a LF. Signed-off-by: Werner Koch <[email protected]>
2013-11-15Fix minor compiler warnings.Werner Koch1-0/+1
--
2013-03-20Add code to allow for late memory cleanup.Werner Koch1-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.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-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.
2010-10-20Make public key data structure easier to read.Werner Koch1-3/+3
Check vor v1 card while signing.
2010-03-15Finished the bulk of changes to use estream in most places instead ofWerner Koch1-57/+65
stdio.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2006-04-19Merged with gpg 1.4.3 code. Werner Koch1-10/+9
The gpg part does not yet build.
2005-07-27Converted all m_free to xfree etc.Werner Koch1-5/+5
2005-07-09* trustdb.c (clean_uids_from_key): Don't keep a valid selfsig aroundDavid Shaw1-7/+0
when compacting a uid. There is no reason to make an attacker's job easier - this way they only have a revocation which is useless in bringing the uid back. * keydb.h, kbnode.c (undelete_kbnode): Removed. No longer needed. * import.c (chk_self_sigs): Allow a uid revocation to be enough to allow importing a particular uid (no self sig needed). This allows importing compacted uids.
2005-06-10* keydb.h, kbnode.c (undelete_kbnode): New function to undelete aDavid Shaw1-1/+7
kbnode. * trustdb.c (clean_uids_from_key): Further tweak the algorithm so that the last good selfsig is kept when the chosen selfsig is a revocation.
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2003-06-18Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch1-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.
2003-06-05This commit was manufactured by cvs2svn to create branchRepo Admin1-0/+399
'GNUPG-1-9-BRANCH'.
2003-05-24* armor.c, g10.c, kbnode.c, misc.c, pkclist.c, sign.c, build-packet.c,David Shaw1-3/+3
getkey.c, keydb.c, openfile.c, plaintext.c, status.c, gpgv.c, keygen.c, options.h, sig-check.c, tdbio.h, encode.c, mainproc.c, parse-packet.c, signal.c, textfilter.c: Edit all preprocessor instructions to remove whitespace before the '#'. This is not required by C89, but there are some compilers out there that don't like it.
2002-10-19This commit was manufactured by cvs2svn to create branchRepo Admin1-399/+0
'GNUPG-1-9-BRANCH'.
2002-06-29Update head to match stable 1.0David Shaw1-20/+36
2000-07-14See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch1-3/+4
2000-01-24See ChangeLog: Mon Jan 24 13:04:28 CET 2000 Werner KochWerner Koch1-6/+6
1999-05-22See ChangeLog: Sat May 22 22:47:26 CEST 1999 Werner KochWerner Koch1-28/+92
1999-05-06See ChangeLog: Thu May 6 14:18:17 CEST 1999 Werner KochWerner Koch1-1/+2
1998-12-23See ChangeLog: Wed Dec 23 13:34:22 CET 1998 Werner KochWerner Koch1-3/+3
1998-10-21Epxerimenta support for GDBM keyings.Werner Koch1-0/+1
1998-10-12backupWerner Koch1-4/+32
1998-07-29edit-key is now completeWerner Koch1-2/+3
1998-06-29textual changesWerner Koch1-11/+11
1998-04-25changes from laptopWerner Koch1-1/+1
1998-04-14applied Mathews typo and grammar fixesWerner Koch1-6/+6
1998-04-08test releaseWerner Koch1-1/+2
1998-03-09partial DSA supportWerner Koch1-2/+2
1998-02-24Renamed to GNUPGV-0-2-8Werner Koch1-4/+4
1998-02-17import worksWerner Koch1-7/+69
1998-02-16some import functionalityWerner Koch1-1/+27
1998-02-13added option exportV0-2-6Werner Koch1-4/+5
1998-02-11bug fixesWerner Koch1-5/+2
1998-02-11a couple of changes; but some parts are now brokenWerner Koch1-39/+69
1998-01-02added more stuffWerner Koch1-17/+38
1997-12-19better prime number generator. improved ELG key generationWerner Koch1-0/+9
1997-12-16added some stuff for signing keysWerner Koch1-1/+62
1997-12-12added option file handlingWerner Koch1-3/+51
1997-11-18initially checkinWerner Koch1-0/+31