aboutsummaryrefslogtreecommitdiffstats
path: root/kbx/keybox-dump.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-04-01kbx: Unify blob reading functions.Werner Koch1-3/+3
* kbx/keybox-file.c (_keybox_read_blob): Remove. (_keybox_read_blob2): Rename to .... (_keybox_read_blob): this. Make arg options. Change all callers. * kbx/keybox-search.c (keybox_search): Factor fopen call out to ... (open_file): new. (keybox_seek): Als use open_file. Signed-off-by: Werner Koch <[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-01-07kbx: Avoid warnings about useless assignments.Werner Koch1-8/+8
* kbx/keybox-dump.c (_keybox_dump_blob): Remove setting of IN_RANGE and the last increment of P. -- Signed-off-by: Werner Koch <[email protected]>
2015-02-11Use inline functions to convert buffer data to scalars.Werner Koch1-19/+3
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New. (buf16_to_ushort, buf16_to_u16): New. (buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New. -- Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to avoid all sign extension on shift problems. Hanno Böck found a case with an invalid read due to this problem. To fix that once and for all almost all uses of "<< 24" and "<< 8" are changed by this patch to use an inline function from host2net.h. Signed-off-by: Werner Koch <[email protected]>
2014-10-31kbx: Let keydb_search skip unwanted blobs.Werner Koch1-17/+17
* kbx/keybox.h (keybox_blobtype_t): New. * kbx/keybox-defs.h (BLOBTYPE_*): Replace by KEYBOX_BLOBTYPE_*. * kbx/keybox-search.c (keybox_search): Add arg want_blobtype and skip non-matching blobs. * sm/keydb.c (keydb_search): Pass KEYBOX_BLOBTYPE_X509 to keybox_search. * g10/keydb.c (keydb_search): Pass KEYBOX_BLOBTYPE_PGP to keybox_search. -- Without this fix a listing of all keys would fail because the wrong blob type would be returned for the gpg or gpgsm. Signed-off-by: Werner Koch <[email protected]>
2014-10-09kbx: Fix handling of overlong keys.Werner Koch1-4/+25
* kbx/keybox-file.c (IMAGELEN_LIMIT): Change limit from 10^6 to 2MiB. (_keybox_read_blob2): Skip too long record records. (_keybox_write_blob): Do not accept too long record. * kbx/keybox-dump.c (file_stats_s): Add field skipped_long_blobs. (_keybox_dump_file): Print new counter. (_keybox_dump_file): Skip too long records. ---- To test this feature you may set the limit back to 1MiB and use key F7F0E70F307D56ED which is in my local copy close to 2MiB. Without this patch it was possible to import the key but access to that key and all keys stored after it was not possible. Signed-off-by: Werner Koch <[email protected]>
2014-10-09gpg: Take care to use pubring.kbx if it has ever been used.Werner Koch1-0/+19
* kbx/keybox-defs.h (struct keybox_handle): Add field for_openpgp. * kbx/keybox-file.c (_keybox_write_header_blob): Set openpgp header flag. * kbx/keybox-blob.c (_keybox_update_header_blob): Add arg for_openpgp and set header flag. * kbx/keybox-init.c (keybox_new): Rename to do_keybox_new, make static and add arg for_openpgp. (keybox_new_openpgp, keybox_new_x509): New. Use them instead of the former keybox_new. * kbx/keybox-update.c (blob_filecopy): Add arg for_openpgp and set the openpgp header flags. * g10/keydb.c (rt_from_file): New. Factored out and extended from keydb_add_resource. (keydb_add_resource): Switch to the kbx file if it has the openpgp flag set. * kbx/keybox-dump.c (dump_header_blob): Print header flags. -- The problem was reported by dkg on gnupg-devel (2014-10-07): I just discovered a new problem, though, which will affect people on systems that have gpg and gpg2 coinstalled: 0) create a new keyring with gpg2, and use it exclusively with gpg2 for a while. 1) somehow (accidentally?) use gpg (1.4.x) again -- this creates ~/.gnupg/pubring.gpg 2) future runs of gpg2 now only look at pubring.gpg and ignore pubring.kbx -- the keys you had accumulated in the keybox are no longer listed in the output of gpg2 --list-keys Note that gpgsm has always used pubring.kbx and thus this file might already be there but without gpg ever inserted a key. The new flag in the KBX header gives us an indication whether a KBX file has ever been written by gpg >= 2.1. If that is the case we will use it instead of the default pubring.gpg. Signed-off-by: Werner Koch <[email protected]>
2013-11-15kbx: Implement update operation for OpenPGP keyblocks.Werner Koch1-2/+2
* kbx/keybox-update.c (keybox_update_keyblock): Implement. * kbx/keybox-search.c (get_blob_flags): Move to ... * kbx/keybox-defs.h (blob_get_type): here. * kbx/keybox-file.c (_keybox_read_blob2): Fix calling without R_BLOB. * g10/keydb.c (build_keyblock_image): Allow calling without R_SIGSTATUS. (keydb_update_keyblock): Implement for keybox. * kbx/keybox-dump.c (_keybox_dump_blob): Fix printing of the unhashed size. Print "does not expire" also on 64 bit platforms. Signed-off-by: Werner Koch <[email protected]>
2013-11-15kbx: Fix possible segv in kbxdump.Werner Koch1-1/+1
* kbx/keybox-dump.c (_keybox_dump_blob): Check length before get32. Signed-off-by: Werner Koch <[email protected]>
2013-01-08kbx: Switch from MD5 to SHA-1 for the checksum.Werner Koch1-6/+65
* kbx/keybox-blob.c (put_membuf): Use a NULL buf to store zero bytes. (create_blob_finish): Write just the needed space. (create_blob_finish): Switch to SHA-1. * kbx/keybox-dump.c (print_checksum): New. (_keybox_dump_blob): Print the checksum and the verification status. -- The checksum was never used in the past. Due to fast SHA-1 computations in modern CPUs we now use SHA-1. Eventually we will support a First blob flag to enable the use of a secret or public HMAC-SHA1. The first may be used for authentication of keyblocks and the latter to mitigate collission attacks on SHA-1. It is not clear whether this will be useful at all.
2012-12-28kbxutil: Improve format of the Sig-Expire lines.Werner Koch1-2/+2
* kbx/keybox-dump.c (_keybox_dump_blob): Print the expirate timestamp.
2012-12-28kbxutil: Print algo number and fold similar lines.Werner Koch1-21/+44
* kbx/keybox-defs.h (_keybox_openpgp_key_info): Add field ALGO. * kbx/keybox-openpgp.c (parse_key): Store algo. * kbx/kbxutil.c (dump_openpgp_key): Print algo number. * kbx/keybox-dump.c (_keybox_dump_blob): Print identical Sig-Expire value lines with a range of indices.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-7/+7
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-25/+25
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-03-10Merged jnlib into common.Werner Koch1-1/+1
2008-10-20Marked all unused args on non-W32 platforms.Werner Koch1-0/+2
2007-08-23Add new features to kbxutil.Werner Koch1-13/+227
Fixed bug 829 (can't encrypt if duplicated certs are in the keybox)
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2004-06-18* keybox-dump.c (_keybox_dump_file): New arg STATS_ONLY.Werner Koch1-4/+123
(update_stats): New. * kbxutil.c (main): New command --stats.
2004-04-26The keybox gets now compressed after 3 hours and ephemeralWerner Koch1-4/+23
stored certificates are deleted after about a day.
2003-06-05This commit was manufactured by cvs2svn to create branchRepo Admin1-0/+346
'GNUPG-1-9-BRANCH'.
2003-06-03Make use of libgpg-errorWerner Koch1-4/+4
2002-10-19This commit was manufactured by cvs2svn to create branchRepo Admin1-346/+0
'GNUPG-1-9-BRANCH'.
2002-07-22* keybox-defs.h: New BLOBTYPTE_EMPTY.Werner Koch1-0/+4
* keybox-dump.c (_keybox_dump_blob): Handle new type. * keybox-file.c (_keybox_read_blob): Skip over empty blobs. Store the file offset. * keybox-blob.c (_keybox_new_blob): Add new arg OFF. (_keybox_get_blob_fileoffset): New. * keybox-update.c (keybox_delete): Implemented.
2002-06-19* keybox-init.c (keybox_set_ephemeral): New.Werner Koch1-2/+22
* keybox-blob.c (create_blob_header): Store epheermal flag. (_keybox_create_x509_blob): Pass epheermal flag on. * keybox-update.c (keybox_insert_cert): Ditto. * keybox-search.c (blob_get_blob_flags): New. (keybox_search): Ignore ephemeral blobs when not in ephemeral mode. * keybox-dump.c (_keybox_dump_blob): Print blob flags as strings.
2001-11-13We have reached a state where we are able to import certs andWerner Koch1-11/+83
check the certification path.
2001-11-10Started with keybox implementation by basing it on code from the GnuPGWerner Koch1-0/+250
devel branch.