summaryrefslogtreecommitdiffstats
path: root/kbx (follow)
Commit message (Collapse)AuthorAgeFilesLines
* kbx: Make sure the tables are joined in a select.Werner Koch2020-01-071-3/+3
| | | | | | | | * kbx/backend-sqlite.c (run_select_statement): Join the tables. -- For whatever reasons that part was missing or got lost before committing.
* kbx: Initial support for an SQLite backendWerner Koch2020-01-029-87/+1424
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/backend-sqlite.c: New. * kbx/Makefile.am (keyboxd_SOURCES): Add it. (keyboxd_CFLAGS, keyboxd_LDADD): Add SQLite flags. * kbx/backend.h (enum database_types): Add DB_TYPE_SQLITE. (be_sqlite_local_t): New typedef. (struct db_request_part_s): Add field besqlite. * kbx/backend-support.c (strdbtype): Add string for DB_TYPE_SQLITE. (be_generic_release_backend): Support SQLite. (be_release_request): Ditto. (be_find_request_part): Ditto. (is_x509_blob): Rename to ... (be_is_x509_blob): this and make global. * kbx/frontend.c (kbxd_set_database): Detect ".db" suffix and use that for SQLite. (kbxd_search): Support SQLite (kbxd_store): Ditto. (kbxd_delete): Ditto. * kbx/frontend.h (kbxd_store_modes): Move to ... * kbx/keyboxd.h (enum kbxd_store_modes): here. * kbx/keyboxd.c (main): USe pubring.db for now. This is a temporary hack. * kbx/backend-kbx.c (be_kbx_delete): Remove unused var cert. -- Take care: This is not finished and in particular filling the database takes quite long. Signed-off-by: Werner Koch <wk@gnupg.org>
* kbx: Change keyboxd to work only with one database.Werner Koch2019-12-233-162/+112
| | | | | | | | | | | | | | | | | | * kbx/frontend.c (the_database): New var. (db_desc_t): Remove. (kbxd_add_resource): Renamed to ... (kbxd_set_database): this. Simplify. (kbxd_search): Change to use only one database. (kbxd_store): Ditto. (kbxd_delete): Ditto. -- The original implementation was way to complicated and would have only brought back the problems deciding which database to use for each key. The new scheme used one configured database and only that. That database needs to be set right at the start. Signed-off-by: Werner Koch <wk@gnupg.org>
* kbx: Add new command DELETE.Werner Koch2019-11-285-0/+138
| | | | | | | | * kbx/kbxserver.c (cmd_delete): New. * kbx/frontend.c (kbxd_delete): New. * kbx/backend-kbx.c (be_kbx_delete): New. Signed-off-by: Werner Koch <wk@gnupg.org>
* kbx: Redefine the UBID which is now the primary fingerprint.Werner Koch2019-11-2812-167/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/util.h (UBID_LEN): New. Use it at all places. * kbx/keybox-blob.c (create_blob_finish): Do not write the UBID item. * kbx/keybox-dump.c (print_ubib): Remove. (_keybox_dump_blob): Do not print the now removed ubid flag. * kbx/keybox-search-desc.h (struct keydb_search_desc): Use constants for the size of the ubid and grip. * kbx/keybox-search.c (blob_cmp_ubid): New. (has_ubid): Make it a simple wrapper around blob_cmp_ubid. (keybox_get_data): Add arg 'r_ubid'. * kbx/frontend.h (enum kbxd_store_modes): New. * kbx/kbxserver.c (cmd_store): Add new option --insert. * kbx/backend-cache.c (be_cache_initialize): New. (be_cache_add_resource): Call it here. * kbx/backend-kbx.c (be_kbx_seek): Remove args 'fpr' and 'fprlen'. (be_kbx_search): Get the UBID from keybox_get_data. * kbx/backend-support.c (be_fingerprint_from_blob): Replace by ... (be_ubid_from_blob): new. Change all callers. * kbx/frontend.c (kbxd_add_resource): Temporary disable the cache but use the new cache init function. (kbxd_store): Replace arg 'only_update' by 'mode'. Seek using the ubid. Take care of the mode. -- It turned out that using the hash of the entire blob was not helpful. Thus we redefine the Unique-Blob-ID (UBID) as the primary fingerprint of the blob. In case this is a v5 OpenPGP key a left truncated version of the SHA-256 hash is used; in all other cases the full SHA-1 hash. Using a SHA-256 hash does not make sense because v4 keys are and will for some time be the majority of keys and thus padding them with zeroes won't make any difference. Even if fingerprint collisions can eventually be created we will assume that the keys are bogus and that it does not make sense to store its twin also in our key storage. We can also easily extend the update code to detect a collision and reject the update. Signed-off-by: Werner Koch <wk@gnupg.org>
* doc: Fixed variable naming.Werner Koch2019-11-261-1/+1
| | | | | | | | * kbx/keybox.h: Fix naming of arguments. * scd/ccid-driver.c (print_error) [TEST]: Add missing break. Note that this is anyway an impossible case. Signed-off-by: Werner Koch <wk@gnupg.org>
* kbx: Implement update for the STORE command.Werner Koch2019-10-073-1/+56
| | | | | | | * kbx/backend-kbx.c (be_kbx_update): New. * kbx/frontend.c (kbxd_store): Call it. Signed-off-by: Werner Koch <wk@gnupg.org>
* kbx: Add first version of STORE command to keyboxd.Werner Koch2019-10-018-20/+324
| | | | | | | | | | | | | * kbx/Makefile.am (keyboxd_CFLAGS): -DKEYBOX_WITH_X509. (keyboxd_LDADD): Add libksba. * kbx/kbxserver.c (cmd_store): New. * kbx/frontend.c (kbxd_store): New. * kbx/backend-support.c (is_x509_blob): New. (be_fingerprint_from_blob): New. * kbx/backend-kbx.c (be_kbx_seek): Add args FPR and FPRLEN. (be_kbx_insert): New. Signed-off-by: Werner Koch <wk@gnupg.org>
* Merge branch 'switch-to-gpgk' into masterWerner Koch2019-09-2718-18/+5295
|\ | | | | | | | | | | | | | | | | | | | | | | -- Resolved Conflicts: * common/asshelp.c: Keep the new code in master for spawing under Windows. * g10/Makefile.am: Keep all new file. * g10/photoid.c: Pass CTRL to pct_expando. Signed-off-by: Werner Koch <wk@gnupg.org>
| * kbx: Fix error code return in keyboxd.Werner Koch2019-09-272-2/+6
| | | | | | | | | | | | | | | | * kbx/frontend.c (kbxd_add_resource): Print a diagnostic on error. * kbx/backend-kbx.c (be_kbx_add_resource): Acttually returh the error code. Signed-off-by: Werner Koch <wk@gnupg.org>
| * kbx: Store the UBIB in the blob.Werner Koch2019-09-273-12/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-blob.c (create_blob_header): New blob flag UBIB. (create_blob_finish): Write the UBIB. * kbx/keybox-dump.c (print_ubib): New. (_keybox_dump_blob): Print UBIB flag. * kbx/keybox-search.c (has_ubid): Compare the stored UBIB if available. -- This make scanning the keybox for a given UBIB much faster once it has been stored. Signed-off-by: Werner Koch <wk@gnupg.org>
| * kbx,gpg: Allow lookup using a UBID.Werner Koch2019-09-273-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | * common/userids.c (classify_user_id): Detect UBIDs. * kbx/backend-cache.c (blob_table_put): Store the public key type. (be_cache_search): Add search mode for UBIDs. * kbx/backend.h (struct db_request_part_s): Add cache.seqno_ubid. * g10/keydb.c (keydb_search_desc_dump): Fix printing of keygrip. Add ubid printing. * g10/call-keyboxd.c (keydb_search): Support search by UBID. Signed-off-by: Werner Koch <wk@gnupg.org>
| * kbx: First take on a cache for the keyboxd.Werner Koch2019-09-279-44/+1420
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/backend.h (enum database_types): Add DB_TYPE_CACHE. (struct db_request_part_s): Add seqno fields. (struct db_request_s): Add infos for the cache backend. * kbx/backend-support.c (struct backend_handle_s): Add 'backend_id'. (strdbtype): Support DB_TYPE_CACHE. (be_generic_release_backend): Ditto. (be_find_request_part): New. (be_return_pubkey): New arg UBID and chnage status name. * kbx/backend-cache.c: New. * kbx/backend-kbx.c (be_kbx_init_request_part): New. (be_kbx_search): Factor some code out to a support function. (be_kbx_seek): New. * kbx/frontend.c (kbxd_add_resource): Support DB_TYPE_CACHE. (kbxd_search): Support the NEXR operation with the cache. * kbx/keybox-search-desc.h (KEYDB_SEARCH_MODE_UBID): New. (struct keydb_search_desc): Add field u.ubid. * kbx/keybox-search.c (has_ubid): New. (keybox_search): Support the UBID search. -- This adds a caching backend to the keyboxd. This tries to accommodate for duplicate use of fingerprints and thus be correct in case a fingerprint is used in several keys. It also turned out that we need to have a unique identifier (UBID) to identify a keyblock or X.509 certificate. In particular with an OpenPGP keyblob we can't easily use the primary fingerprint as an identifier because that fingerprint may also be used as subkey in another key. Thus using a hash of the entire keyblock is a better identifier to be used to address a keyblock for restarting a search or for identifying the keyblock to be updated. Note that this new UBID is not a permanent identifier because it changes with all keyblock update; it should be viewed as a handle to the keyblock or X509 cert.
| * kbx: Allow fd-passing for the keyboxd.Werner Koch2019-09-102-6/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/kbxserver.c: Include host2net.h (struct server_local_s): Add field outstream. (prepare_outstream): New. (kbxd_writen): New. (kbxd_write_data_line): Write to file descrptor. Disable the slow human reader friendly data line formatting. (cmd_search, cmd_next): Disable data logging. (kbxd_start_command_handler): Add OUTPUT command. * kbx/keyboxd.c (main): Enable log monitor. -- Signed-off-by: Werner Koch <wk@gnupg.org>
| * kbx: Fix keyboxd search first.Werner Koch2019-09-091-3/+17
| | | | | | | | | | | | | | * kbx/kbxserver.c (cmd_next): Switch to mode next if needed. -- Signed-off-by: Werner Koch <wk@gnupg.org>
| * kbx: Allow searching from start.Werner Koch2019-09-092-12/+24
| | | | | | | | | | | | | | * kbx/kbxserver.c (cmd_search): Detect empty pattern. -- Signed-off-by: Werner Koch <wk@gnupg.org>
| * kbx: Add framework for the SEARCH commandWerner Koch2019-08-0612-34/+1226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/backend-kbx.c: New. * kbx/backend-support.c: New. * kbx/backend.h: New. * kbx/frontend.c: New. * kbx/frontend.h: New. * kbx/kbxserver.c: Implement SEARCH and NEXT command. * kbx/keybox-search-desc.h (enum pubkey_types): New. * kbx/keybox-search.c (keybox_get_data): New. * kbx/keyboxd.c (main): Add a standard resource. Signed-off-by: Werner Koch <wk@gnupg.org>
| * kbx: Allow writing using a estream.Werner Koch2019-08-063-8/+17
| | | | | | | | | | | | | | * kbx/keybox-file.c (_keybox_write_header_blob): New optional arg stream. Change callers. Signed-off-by: Werner Koch <wk@gnupg.org>
| * Merge branch 'master' into switch-to-gpgkWerner Koch2019-07-125-21/+54
| |\
| * \ Merge branch 'master' into switch-to-gpgkWerner Koch2019-03-189-99/+428
| |\ \ | | | | | | | | | | | | --
| * | | kbx: Add framework for a public key daemon.Werner Koch2018-09-055-3/+2478
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keyboxd.c: New. * kbx/keyboxd.h: New. * kbx/kbxserver.c: New. * kbx/keyboxd-w32info.rc: New. * kbx/Makefile.am (EXTRA_DIST): Add new rc file. (resource_objs): Ditto. (libexec_PROGRAMS): New. (common_libs, commonpth_libs): New. (kbxutil_LDADD): Use here. (keyboxd_SOURCES): New. (keyboxd_CFLAGS): New. (keyboxd_LDADD): New. (keyboxd_LDFLAGS): New. (keyboxd_DEPENDENCIES): new. ($(PROGRAMS)): Extend. Signed-off-by: Werner Koch <wk@gnupg.org>
* | | | kbx: Include deleted records into the --stats output.Werner Koch2019-08-231-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-dump.c (_keybox_dump_file): Take deleted records in account. -- This also changes the numbering of the records to reflect the real record number. Signed-off-by: Werner Koch <wk@gnupg.org>
* | | | kbx: Fix regression in compression trigger from July 18Werner Koch2019-08-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-update.c (keybox_compress): Change condition back. Also use make_timestamp for CUT_TIME. -- Fixes-commit: 824ca6f042dc69edaf67bf9d4e875be75babab00 Note that the original change was not backported to 2.2. Signed-off-by: Werner Koch <wk@gnupg.org>
* | | | kbx: Allow "gpgsm --faked-system-time" to kick off a compression run.Werner Koch2019-07-182-2/+2
| |_|/ |/| | | | | | | | | | | | | | * kbx/keybox-update.c (keybox_compress): Use make_timestamp. Signed-off-by: Werner Koch <wk@gnupg.org>
* | | spelling: Fix "synchronize"Daniel Kahn Gillmor2019-06-241-2/+2
| | | | | | | | | | | | Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* | | kbx: Fix an endless loop under Windows due to an incomplete fix.Werner Koch2019-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-search.c (keybox_search): We need to seek to the last position in all cases not just when doing a NEXT. -- This is because search from the beginning needs a keybox_search_reset. We can only make an exception for KEYDB_SEARCH_MODE_FIRST.. Fixes-commit: 49b236af0ecbb6df67513feb4b63851f2e159ea2 Signed-off-by: Werner Koch <wk@gnupg.org>
* | | kbx: Fix deadlock in gpgsm on Windows due to a sharing violation.Werner Koch2019-05-143-14/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-init.c (keybox_lock) [W32]: Use _keybox_close_file instead of fclose so that a close is done if the file is opened by another handle. * kbx/keybox-search.c (keybox_search): Remember the last offset and use that in NEXT search mode if we had to re-open the file. -- GnuPG-bug-id: 4505 Signed-off-by: Werner Koch <wk@gnupg.org>
* | | sm: Change keydb code to use the keybox locking.Werner Koch2019-05-142-5/+10
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-init.c (keybox_lock): New arg TIMEOUT. Change all callers to pass -1 when locking. * sm/keydb.c (struct resource_item): Remove LOCKANDLE. (struct keydb_handle): Add KEEP_LOCK. (keydb_add_resource): Use keybox locking instead of a separate dotlock for testing whether we can run a compress. (keydb_release): Reset KEEP_LOCK. (keydb_lock): Set KEEP_LOCK. (unlock_all): Take care of KEEP_LOCK. (lock_all): Use keybox_lock instead of dotlock fucntions. (keydb_delete): Remove arg UNLOCK. * sm/delete.c (delete_one): Adjust keydb_delete. Due to the KEEP_LOCK the keydb_release takes care of unlocking. -- This aligns the code more with g10/keydb.c and avoids the separate calls to dotlock_take. GnuPG-bug-id: 4505 Signed-off-by: Werner Koch <wk@gnupg.org>
* | kbx: Unify the fingerprint search modes.Werner Koch2019-03-142-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-search-desc.h (KEYDB_SEARCH_MODE_FPR16) (KEYDB_SEARCH_MODE_FPR20, KEYDB_SEARCH_MODE_FPR32): Remove. Switch all users to KEYDB_SEARCH_MODE_FPR along with the fprlen value. -- These search modes were added over time and there has until recently be no incentive to remove the cruft. With the change for v5 keys I finally went over all places and allowed the generic fingerprint mode along with a given length of the fingerprint at all places. Consequently the other modes can now be removed. Signed-off-by: Werner Koch <wk@gnupg.org>
* | kbx: Add support for 32 byte fingerprints.Werner Koch2019-03-146-71/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/userids.c (classify_user_id): Support 32 byte fingerprints. * kbx/keybox-search-desc.h (KEYDB_SEARCH_MODE_FPR32): New. (struct keydb_search_desc): Add field fprlen. * kbx/keybox-defs.h (struct _keybox_openpgp_key_info): Add field version and increase size of fpr to 32. * kbx/keybox-blob.c: Define new version 2 for PGP and X509 blobs. (struct keyboxblob_key): Add field fprlen and increase size of fpr. (pgp_create_key_part_single): Allow larger fingerprints. (create_blob_header): Implement blob version 2 and add arg want_fpr32. (_keybox_create_openpgp_blob): Detect the need for blob version 2. * kbx/keybox-search.c (blob_get_first_keyid): Support 32 byte fingerprints. (blob_cmp_fpr): Ditto. (blob_cmp_fpr_part): Ditto. (has_fingerprint): Add arg fprlen and pass on. (keybox_search): Support KEYDB_SEARCH_MODE_FPR32 and adjust for changed has_fingerprint. * kbx/keybox-openpgp.c (parse_key): Support version 5 keys. * kbx/keybox-dump.c (_keybox_dump_blob): Support blob version 2. * g10/delkey.c (do_delete_key): Support KEYDB_SEARCH_MODE_FPR32. * g10/export.c (exact_subkey_match_p): Ditto. * g10/gpg.c (main): Ditto. * g10/getkey.c (get_pubkey_byfprint): Adjust for changed KEYDB_SEARCH_MODE_FPR. * g10/keydb.c (keydb_search_desc_dump): Support KEYDB_SEARCH_MODE_FPR32 and adjust for changed KEYDB_SEARCH_MODE_FPR. (keydb_search): Add new arg fprlen and change all callers. * g10/keyedit.c (find_by_primary_fpr): Ditto. * g10/keyid.c (keystr_from_desc): Ditto. * g10/keyring.c (keyring_search): Ditto. * g10/keyserver.c (print_keyrec): Ditto. (parse_keyrec): Ditto. (keyserver_export): Ditto. (keyserver_retrieval_screener): Ditto. (keyserver_import): Ditto. (keyserver_import_fprint): Ditto. (keyidlist): Ditto. (keyserver_get_chunk): Ditto. * g10/keydb.c (keydb_search): Add new arg fprlen and change all callers. * sm/keydb.c (keydb_search_fpr): Adjust for changed KEYDB_SEARCH_MODE_FPR. -- This prepares the support for OpenPGP v5 keys. The new version 2 blob format is needed for the longer fingerprints and we also use this opportunity to prepare for storing the keygrip in the blob for faster lookup by keygrip. Right now this is not yet functional. Signed-off-by: Werner Koch <wk@gnupg.org>
* | gpg: Implement searching keys via keygrip.Werner Koch2019-01-294-20/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-defs.h (struct _keybox_openpgp_key_info): Add field grip. * kbx/keybox-openpgp.c (struct keyparm_s): New. (keygrip_from_keyparm): New. (parse_key): Compute keygrip. * kbx/keybox-search.c (blob_openpgp_has_grip): New. (has_keygrip): Call it. -- This has been marked for too long as not yet working. However, it is a pretty useful feature and will come pretty handy when looking for all keys matching one keygrip. Can be optimized a lot by storing the keygrip in the meta data. This will be done along with the upgrade of KBX for v5 fingerprints. Signed-off-by: Werner Koch <wk@gnupg.org>
* | kbx: Increase size of field for fingerprint.NIIBE Yutaka2018-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-search-desc.h (fpr): Increase the size. -- In the function keydb_search_fpr in g10/keydb.c, it is copied using MAX_FINGERPRINT_LEN. So, more size is required. Fixes-commit: ecbbafb88d920e713439b6b1b8e1b41a6f8d0e38 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* | all: fix more spelling errorsDaniel Kahn Gillmor2018-10-251-1/+1
| |
* | all: fix spelling and typosDaniel Kahn Gillmor2018-10-243-3/+3
|/ | | | Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* Merge branch 'STABLE-BRANCH-2-2'Werner Koch2018-02-221-8/+8
|\
| * kbx: Fix detection of corrupted keyblocks on 32 bit systems.Werner Koch2018-02-151-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-search.c (blob_cmp_fpr): Avoid overflow in OFF+LEN checking. (blob_cmp_fpr_part): Ditto. (blob_cmp_name): Ditto. (blob_cmp_mail): Ditto. (blob_x509_has_grip): Ditto. (keybox_get_keyblock): Check OFF and LEN using a 64 bit var. (keybox_get_cert): Ditto. -- On most 32 bit systems size_t is 32 bit and thus the check size_t cert_off = get32 (buffer+8); size_t cert_len = get32 (buffer+12); if (cert_off+cert_len > length) return gpg_error (GPG_ERR_TOO_SHORT); does not work as intended for all supplied values. The simplest solution here is to cast them to 64 bit. In general it will be better to avoid size_t at all and work with uint64_t. We did not do this in the past because uint64_t was not universally available. GnuPG-bug-id: 3770 Signed-off-by: Werner Koch <wk@gnupg.org>
* | Merge branch 'STABLE-BRANCH-2-2' into masterWerner Koch2018-01-254-124/+3
|\| | | | | | | Signed-off-by: Werner Koch <wk@gnupg.org>
| * kbx: Simplify by removing custom memory functions.Werner Koch2017-12-224-124/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kbx/keybox-util.c (keybox_set_malloc_hooks): Remove. (_keybox_malloc, _keybox_calloc, keybox_realloc) (_keybox_free): Remove. (keybox_file_rename): Remove. Was not used. * sm/gpgsm.c (main): Remove call to keybox_set_malloc_hooks. * kbx/kbxutil.c (main): Ditto. * kbx/keybox-defs.h: Remove all separate includes. Include util.h. remove convenience macros. * common/logging.h (return_if_fail): New. Originally from keybox-defs.h but now using log_debug. (return_null_if_fail): Ditto. (return_val_if_fail): Ditto. (never_reached): Ditto. -- Originally the KBX code was written to allow standalone use. However this required lot of ugliness like separate memory allocators and such. It also precludes the use of some standard functions from common due to their use of the common gnupg malloc functions. Dropping all that makes things easier. Minor disadvantages: the kbx call done for gpg will now use gcry malloc fucntions and not the standard malloc functions. This might be a bit slower but removing them even fixes a possible bug in keybox_tmp_names which is used in gpg and uses gpg's xfree which is actually gcry_free. Signed-off-by: Werner Koch <wk@gnupg.org>
* | Adjust for changed macro names in libgpg-error master.Werner Koch2017-12-111-8/+8
|/ | | | | | | | | | * common/logging.h (GPGRT_LOGLVL_): New replacement macros for older libgpg-error versions. -- Updates-commit: b56dfdfc1865ceb7c3c025d79996e049faee7fdf Signed-off-by: Werner Koch <wk@gnupg.org>
* Fix usage of ARGPARSE_OPTS.NIIBE Yutaka2017-07-191-1/+1
| | | | | | | | | * agent/gpg-agent.c, agent/preset-passphrase.c, dirmngr/dirmngr-client.c, dirmngr/dirmngr_ldap.c, kbx/kbxutil.c, tools/gpg-check-pattern.c, tools/gpgconf.c, tools/gpgsplit.c, tools/symcryptrun.c: Use ARGPARSE_end. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Spelling fixes in docs and comments.NIIBE Yutaka2017-04-283-4/+4
| | | | | | | | | | -- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* kbx: Unify blob reading functions.Werner Koch2017-04-015-37/+54
| | | | | | | | | | | * 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 <wk@gnupg.org>
* gpg: Avoid multiple open calls to the keybox file.Werner Koch2017-03-311-2/+7
| | | | | | | | | | | | | | | | | | | * g10/keydb.h (KEYDB_HANDLE): Move typedef to ... * g10/gpg.h: here. (struct server_control_s): Add field 'cached_getkey_kdb'. * g10/gpg.c (gpg_deinit_default_ctrl): Release that keydb handle. * g10/getkey.c (getkey_end): Cache keydb handle. (get_pubkey): Use cached keydb handle. * kbx/keybox-search.c (keybox_search_reset): Use lseek instead of closing the file. -- Before this patch a "gpg --check-sigs" opened and closed the keybox file for almost every signature check. By caching the keydb handle and using lseek(2) this can be limited to just 2 times. This might speed up things on Windows. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Remove the use of the signature information from a KBX.Werner Koch2017-03-306-39/+16
| | | | | | | | | | | | | | | | | | | | | | | * g10/keydb.c (keyblock_cache): Remove field SIGSTATUS. (keyblock_cache_clear): Adjust for that removal. (parse_keyblock_image): Remove arg SIGSTATUS. Remove the signature cache setting; this is now done in the parser. (keydb_get_keyblock): Do not set SIGSTATUS. (build_keyblock_image): Remove arg SIGSTATUS and simplify. Change caller. * kbx/keybox-blob.c: Explain that the signature information is not anymore used. (_keybox_create_openpgp_blob): Remove arg SIGSTATUS and change callers. * kbx/keybox-search.c (keybox_get_keyblock): Remove arg R_SIGSTATUS and change callers. * kbx/keybox-update.c (keybox_insert_keyblock): Likewise. -- This thing was too complicated and has been replaced by the new ring trust packet code. Signed-off-by: Werner Koch <wk@gnupg.org>
* Remove -I option to common.NIIBE Yutaka2017-03-076-7/+7
| | | | | | | | | | | | | * 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>
* Clean up word replication.Yuri Chornoivan2017-02-211-2/+2
| | | | | | | | | -- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* common: Rename keybox_file_rename to gnupg_rename_file.Werner Koch2016-11-163-69/+3
| | | | | | | * kbx/keybox-util.c (keybox_file_rename): Rename to ... * common/sysutils.c (gnupg_rename_file): this. Change all callers. Signed-off-by: Werner Koch <wk@gnupg.org>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-0513-13/+13
| | | | --
* Fix more spellingDaniel Kahn Gillmor2016-09-171-1/+1
| | | | | | | | | | | | | | | | | | | * NEWS, acinclude.m4, agent/command-ssh.c, agent/command.c, agent/gpg-agent.c, agent/keyformat.txt, agent/protect-tool.c, common/asshelp.c, common/b64enc.c, common/recsel.c, doc/DETAILS, doc/HACKING, doc/Notes, doc/TRANSLATE, doc/dirmngr.texi, doc/faq.org, doc/gpg-agent.texi, doc/gpg.texi, doc/gpgsm.texi, doc/instguide.texi, g10/armor.c, g10/gpg.c, g10/keyedit.c, g10/mainproc.c, g10/pkclist.c, g10/tofu.c, g13/sh-cmd.c, g13/sh-dmcrypt.c, kbx/keybox-init.c, m4/pkg.m4, sm/call-dirmngr.c, sm/gpgsm.c, tests/Makefile.am, tests/gpgscm/Manual.txt, tests/gpgscm/scheme.c, tests/openpgp/gpgv-forged-keyring.scm, tests/openpgp/multisig.test, tests/openpgp/verify.scm, tests/pkits/README, tools/applygnupgdefaults, tools/gpg-connect-agent.c, tools/mime-maker.c, tools/mime-parser.c: minor spelling cleanup. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
* Portability build fix.Ben Kibbey2016-09-101-1/+2
| | | | | | | | | | * kbx/Makefile.am: Add NETLIBS. * dirmngr/Makefile.am: Ditto for dirmngr_ldap. -- Fixes OpenIndiana (Solaris) builds. Signed-off-by: Ben Kibbey <bjk@luxsci.net>