aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* scd: Support KDF Data Object of OpenPGPcard V3.3.gniibe/scd-kdf-supportNIIBE Yutaka2017-11-071-25/+94
| | | | | | | | | | | | | * scd/app-openpgp.c (do_getattr, do_setattr): Add KDF support. (pin2hash_if_kdf): New. (verify_a_chv): Add PINLEN arg. Use pin2hash_if_kdf. (verify_chv2, do_sign): Follow the change of verify_a_chv. (verify_chv3, do_change_pin): Use pin2hash_if_kdf. -- GnuPG-bug-id: 3152 Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Use clock or clock_gettime for calibration.NIIBE Yutaka2017-11-072-6/+10
| | | | | | | | | | | | | | | | | * agent/protect.c (calibrate_get_time): Use clock or clock_gettime. -- For calibration, clock(3) is better than times(3) among UNIXen. Tested on NetBSD 7.1 and FreeBSD 11.1, using QEMU. Thanks to Damien Goutte-Gattat for the information of use of CLOCKS_PER_SEC; The old code with times(3) is not 100% correct, in terms of POSIX. It should have used sysconf (_SC_CLK_TCK) instead of CLOCKS_PER_SEC. CLOCKS_PER_SEC is specifically for clock(3). GnuPG-bug-id: 3056, 3276, 3472 Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Minor imporvement in agent invocationWerner Koch2017-11-061-0/+1
| | | | | | | | | | | | | | | | | | * tests/openpgp/defs.scm (create-gpghome): Add s2k-count. -- My tests show only 2.5% improvement, but as we have that option now let's use it. real 9m12.604s user 2m20.720s sys 0m11.452s real 8m3.815s user 2m16.700s sys 0m11.544s Signed-off-by: Werner Koch <[email protected]>
* agent: New GETINFO sub-commands "s2k_count_cal" and "s2k_time".Werner Koch2017-11-064-24/+69
| | | | | | | | | * agent/command.c (cmd_getinfo): New sub-commands. * agent/protect.c (get_standard_s2k_count): Factor some code out to ... (get_calibrated_s2k_count): new. (get_standard_s2k_time): New. Signed-off-by: Werner Koch <[email protected]>
* agent: New option --s2k-count.Werner Koch2017-11-064-0/+30
| | | | | | | | | | | | | | * agent/agent.h (opt): New field 's2k_count'. * agent/gpg-agent.c (oS2KCount): New enum value. (opts): New option --s2k-count. (parse_rereadable_options): Set opt.s2k_count. -- This option is useful to speed up the starting of gpg-agent and in cases where the auto-calibration runs into problems due to a broken time measurement facility. Signed-off-by: Werner Koch <[email protected]>
* gpg: Unifiy the message for re-configuring cards.Werner Koch2017-11-021-1/+5
| | | | | | | | | | * g10/card-util.c (ask_card_keyattr): Print "rsaNNNN". -- This is a separate patch from the previous to avoid string changes when backporting the other patch to 2.2. Signed-off-by: Werner Koch <[email protected]>
* gpg: Introduce magic value 25519 to switch a card to ECC.Werner Koch2017-11-021-27/+59
| | | | | | | | | | | | | | * g10/card-util.c (show_keysize_warning): Slightly change the text. (ask_card_keyattr): Handle special value 25519. (do_change_keyattr): Allow changing to cv25519/ed25519. (generate_card_keys): Ditto. (card_generate_subkey): Ditto. -- This is kludge to make it easier for gnuk to be switched into ECC mode. Signed-off-by: Werner Koch <[email protected]>
* build: Remove configure options --disable-gpgWerner Koch2017-11-021-1/+2
| | | | | | | | | | -- gpg is used by several other components as well as from the test suite. We need it. GnuPG-bug-id: 3479 Signed-off-by: Werner Koch <[email protected]>
* agent: Fix returning GPG_ERR_NOT_FOUND wrongly.NIIBE Yutaka2017-11-021-7/+5
| | | | | | | | | | | * agent/learncard.c (agent_handle_learn): Find SERIALNO. -- Bug is: "gpg-connect-agent learn /bye" just fails wrongly. Fixes-commit: 8c8ce8711d9c938fcb982b0341e6b052742cb887 Signed-off-by: NIIBE Yutaka <[email protected]>
* Register another OpenPGP card vendor.Werner Koch2017-11-011-0/+1
| | | | --
* gpg: Remove trailing comma in an enum.Werner Koch2017-11-011-1/+1
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Rename two card related functions in card-util.Werner Koch2017-11-011-6/+6
| | | | | | | | | | | * g10/card-util.c (ask_card_rsa_keysize): Rename to ask_card_keyattr. (do_change_rsa_keysize): Rename to do_change_keyattr. -- We want to support other algos than RSA and thus we need a better name for the functions. Signed-off-by: Werner Koch <[email protected]>
* g10: Unattended key generation "Key-Grip" and "Subkey-Grip".NIIBE Yutaka2017-11-011-9/+16
| | | | | | | | | | | | | | * g10/keygen.c (pSUBKEYGRIP): New. (read_parameter_file): Add "Key-Grip" and "Subkey-Grip". (do_generate_keypair): Support pSUBKEYGRIP. -- In the manual, it says "Key-Grip". gpgsm also supports "Key-Grip". Adding "Subkey-Grip" now, adding "Key-Grip" makes sense. GnuPG-bug-id: 3478 Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Simplify "factory-reset" procedure.NIIBE Yutaka2017-10-301-14/+0
| | | | | | | | | | | | | | | | | | | | | | | * g10/card-util.c (factory_reset): Simplify. -- In this summer, I got report about old code before this change didn't work with newer Yubikey. I got another report test version of OpenPGP card V3.3 implementation didn't work, either. Then, I confirmed that according to the OpenPGP card specification, the procedure of old code is not expected by its author. This change simplify "factory-reset" as simple. Only versions of Gnuk 1.2.2, 1.2.3, 1.2.4, won't work with this change. That's because the factory-reset feature of Gnuk was introduced by reading the implementation of GnuPG, instead of reading the specification. Gnuk 1.2.5 and later works well. All OpenPGPcard implementations I have work well (2.0, 2.1, 2.2, test version of 3). GnuPG-bug-id: 3286 Signed-off-by: NIIBE Yutaka <[email protected]>
* Merge branch 'STABLE-BRANCH-2-2' into masterWerner Koch2017-10-2715-120/+253
|\ | | | | | | | | | | -- Resolved Conflicts: configure.ac - Adjust due to new log_clock otions
| * agent, tests: Support --disable-scdaemon build case.NIIBE Yutaka2017-10-263-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/command.c (cmd_scd): Support !BUILD_WITH_SCDAEMON. * tests/openpgp/defs.scm (create-gpghome): Likewise. * tests/gpgsm/gpgsm-defs.scm (create-gpgsmhome): Likewise. -- We could modify gpg-agent to remove all support of scdaemon, with no inclusion of call-scd.c, divert-scd.c, and learncard.c, but it would not be worth to do that. GnuPG-bug-id: 3316 Signed-off-by: NIIBE Yutaka <[email protected]>
| * Fix comment of configure.NIIBE Yutaka2017-10-261-1/+1
| | | | | | | | | | | | * configure.ac (BUILD_WITH_DIRMNGR): Comment fix. Signed-off-by: NIIBE Yutaka <[email protected]>
| * gpg: Avoid superfluous sig check info during import.Werner Koch2017-10-241-47/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/key-check.c (print_info): New. (key_check_all_keysigs): Print sig checking results only in debug mode. Prettify the stats info and suppress them in quiet mode. -- This also makes usable stats by prefixing them with the key and the program name. GnuPG-bug-id: 3397 Signed-off-by: Werner Koch <[email protected]>
| * build: New configure option --enable-werrorWerner Koch2017-10-241-0/+11
| | | | | | | | | | | | | | | | | | | | * configure.ac: Implement that option. -- This can be used as a workaround in case of bogus autoconf tests. GnuPG-bug-id: 2423 Signed-off-by: Werner Koch <[email protected]>
| * build: Do not mess with CFLAGS in configure.Werner Koch2017-10-241-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Do not mess with the user provided CFLAGS. -- A problem was claimed with some configure tests if the user provided CFLAGS=-Werror. The commit introducing this Fixes-commit: 02eb9fc9d5863abcfed6af704e618f8cac7cc2e8 does not mention a concrete case. Anyway, messing with CFLAGS is a bad idea because configure tests will then test something different than what is used later (cf. autoconf manual). Tests which depend on the whether -Werror is used needsto be fixed. Note that in certain cases we modify CFLAGS. This is only done for some configure options or if the platform requires the use of special compiler flags (e.g. on HP/UX). GnuPG-bug-id: 2423
| * sm: Do not expect X.509 keyids to be uniqueRainer Perske2017-10-245-6/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/certlist.c (gpgsm_find_cert): Add arg allow_ambiguous and use it. * sm/call-dirmngr.c (inq_certificate): Pass true to ALLOW_AMBIGUOUS (run_command_inq_cb): Ditto. * sm/gpgsm.c (main): Pass false. * sm/server.c (cmd_passwd): Pass false. -- As described in my report T1644, it is possible that multiple certificates exist with the same Distinguished Name and the same key. In this case, verifying S/MIME signatures and other actions fail with "certificate not found: Ambiguous name". For details see the bug report. To circumvent the problem, I am patching GnuPG since 2014 so that in this case the newest of the ambiguous certificates is used. This is not an ultimate solution of the problem: You should try every certificate with the same DN until verification succeeds or until all certificates fail, and if multiple certificates of a chain are ambiguous you even have to check every combination. You may even consider checking the keyUsage attributes of the ambiguous certificates to reduce the number of combinations. But in the existing case of the certificates in the German Research Network (DFN) PKI where the newest one is the valid one and all ambiguous certificates have the same keyUsage attributes, this patch has proven to be sufficient over the last three years. With every GnuPG update, I have adapted the patch, luckily I never needed to change anything except line numbers. GnuPG-bug-id: 1644 ChangeLog log written by wk, comment taken from mail. Signed-off line was missing in the plain diff. However the mail with the patch and the DCO posted as reply to that mail were both signed. Signed-off-by: Werner Koch <[email protected]>
| * gpgconf: Ignore non-installed components with --apply-profile.Werner Koch2017-10-241-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/gpgconf-comp.c (retrieve_options_from_program): Add arg only_installed. (gc_component_retrieve_options): Use this if we want to process all components. -- Note that this also also ignores them in --with-defaults. This is useful for systems which come without scdaemon. GnuPG-bug-id: 3313 Signed-off-by: Werner Koch <[email protected]>
| * gpg: Improve the "secret key available" notice in keyedit.cWerner Koch2017-10-241-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keyedit.c (KEYEDIT_NEED_SUBSK): New. (cmds): Add this flag to keytocard, bkuptocard, expire, and passwd. (keyedit_menu): Check whether only subkeys are available and take care of that in the command check and in the HELP listing. Also print a different notice if only subkeys are available. -- Print "Secret key is available" and the bailing out in all commands which require the _primary_ secret key was surprising. Now we print another notice and adjust the checks. GnuPG-bug-id: 3463 Signed-off-by: Werner Koch <[email protected]>
| * gpg: Remove unused flags from keyedit.c.Werner Koch2017-10-241-39/+35
| | | | | | | | | | | | | | | | | | | | | | * g10/keyedit.c (KEYEDIT_NOT_SK, KEYEDIT_ONLY_SK): Remove. (cmds): Remove them. -- These flags were cruft from the time we had to switch between secret and public key view. Signed-off-by: Werner Koch <[email protected]>
| * doc: Fix "SEE ALSO" section of gpgv.Werner Koch2017-10-201-1/+1
| | | | | | | | --
| * gpg: Fix creating on-disk subkey with on-card primary key.Werner Koch2017-10-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keygen.c (generate_subkeypair): Ignore error code issued for trying to verify a card based key. -- We try to verify the primary key and thus seed the passphrase cache before generating the subkey. However, the verification does not yet work for on-card keys and thus the PASSWD --verify send to the agent returns an error. This patch detects this error and continues without a seeded passphrase cache. After all that pre-seeding is just a convenience. GnuPG-bug-id: 3280 Signed-off-by: Werner Koch <[email protected]>
| * gpg: Print sec/sbb with --import-option import-show or show-only.Werner Koch2017-10-192-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/import.c (import_one): Pass FROM_SK to list_keyblock_direct. -- Note that this will likely add the suffix '#' top "sec" because the secret key has not yet (or will not be) imported. If the secret key already exists locally another suffix might be printed. The upshot is that the suffix has no usefulness. GnuPG-bug-id: 3431 Signed-off-by: Werner Koch <[email protected]>
| * gpg: Make --dry-run and show-only work for secret keys.Werner Koch2017-10-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/import.c (import_secret_one): Check for dry-run before transferring keys. -- The use of --dry-run or --import-option show-only had no effect when importing a secret key and the public key already existed. If the public key did not exist an error message inhibited the import of the secret key. Signed-off-by: Werner Koch <[email protected]>
| * dirmngr: Do not follow https-to-http redirects.Damien Goutte-Gattat2017-10-191-4/+6
| | | | | | | | | | | | | | | | | | * dirmngr/ks-engine-http.c (ks_http_fetch): Forbid redirects from a https URI to a http URI. -- GnuPG-bug-id: 3436 Signed-off-by: Damien Goutte-Gattat <[email protected]>
| * g10: Fix find_and_check_key for multiple keyrings.NIIBE Yutaka2017-10-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/pkclist.c (find_and_check_key): Call get_validity on a specific keyblock. -- When we have multiple keyrings, get_validity after get_best_pubkey_byname should access same keyring. Or else, the situation of an expired key in keyring A but valid key in keyring B causes SEGV. Thanks to Guido Günther for the use case and the log. Debian-bug-id: 878812 Signed-off-by: NIIBE Yutaka <[email protected]>
| * gpg: Keep a lock during the read-update/insert cycle in import.Werner Koch2017-10-193-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keydb.c (keydb_handle): New field 'keep_lock'. (keydb_release): Clear that flag. (keydb_lock): New function. (unlock_all): Skip if KEEP_LOCK is set. * g10/getkey.c (get_keyblock_byfprint_fast): Call keep_lock if requested. -- That change is straightforward. It helps to avoid the race condition that another gpg process inserts a key while the first process is between the search and the insert. A similar change is due for gpgsm. Note that the key edit operations may still suffer from a race. GnuPG-bug-id: 3446
| * gpg: Improve keydb handling in the main import function.Werner Koch2017-10-193-60/+95
| | | | | | | | | | | | | | | | | | | | * g10/getkey.c (get_pubkey_byfprint_fast): Factor most code out to ... (get_keyblock_byfprint_fast): .. new function. * g10/import.c (revocation_present): s/int rc/gpg_error_t err/. (import_one): Use get_keyblock_byfprint_fast to get the keyblock and a handle. Remove the now surplus keyblock fetch in the merge branch. Signed-off-by: Werner Koch <[email protected]>
| * gpg: Simplify keydb handling of the main import function.Werner Koch2017-10-192-81/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/import.c (import_keys_internal): Return gpg_error_t instead of int. Change var names. (import_keys_es_stream): Ditto. (import_one): Ditto. Use a single keydb_new and simplify the use of of keydb_release. -- Note that this opens a keydb handle before we call get_pubkey_byfprint_fast which internally uses another key db handle. A further patch will cleanup this double use. Note that we also disable the keydb caching for the insert case. The s/int/gpg_error_t/ has been done while checking the call chains of the import functions and making sure that gpg_err_code is always used. Signed-off-by: Werner Koch <[email protected]>
| * sm: Fix colon listing of fields > 12 in crt records.Werner Koch2017-10-191-2/+1
| | | | | | | | | | | | | | | | | | * sm/keylist.c (print_capabilities): Move colon printing ... (list_cert_colon): to here. -- Fixes-commit: 7af008bfe1641938a6c2c995cb065829fa05a693 Signed-off-by: Werner Koch <[email protected]>
| * gpg: Workaround for junk after --trusted-key.Werner Koch2017-09-281-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/trust.c (register_trusted_key): Cut off everthing starting as a hash sign. -- This problem is fallout from commit f99830b72812395da5451152bdd2f2d90a7cb7fb which fixes GnuPG-bug-id: 1206 The same could happen with other options taking keyids but we won't change that because a trailing '#' does not indicate a comment. So this is really only a workaround and eventually we will deprecate --trusted-key anyway or require a fingerprint as a value. Signed-off-by: Werner Koch <[email protected]>
| * doc: Make --check-sigs more prominent.Werner Koch2017-09-271-39/+42
| | | | | | | | | | | | | | | | | | | | | | -- It seems people are using --list-sigs instead of --check-sigs and do not realize that the signatures are not checked at all. We better highlight the use of --check-sigs to avoid this UI problem. Suggested-by: Andrew Gallagher Signed-off-by: Werner Koch <[email protected]>
* | agent: Clean up pinentry access locking.NIIBE Yutaka2017-10-272-67/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/agent.h (struct server_control_s): Rename PINENTRY_ACTIVE. * agent/call-pinentry.c (entry_owner): Remove. (agent_reset_query): Use thread private object of PINENTRY_ACTIVE. (unlock_pinentry): Add CTRL to arguments to access thread private. Check and decrement PINENTRY_ACTIVE for recursive use. (start_pinentry): Check and increment PINENTRY_ACTIVE for recursion. (agent_askpin): Follow the change of unlock_pinentry API. (agent_get_passphrase, agent_get_confirmation): Likewise. (agent_show_message, agent_popup_message_start): Likewise. (agent_popup_message_stop, agent_clear_passphrase): Likewise. -- We use the member PINENTRY_ACTIVE as a thread private object. It's only valid for a single thread at a time. It would be possible to have a thread shared object of PINENTRY_ACTIVE, keeping ENTRY_OWNER for distinguishing its owner (which is also a thread shared object). But, in this case, access to ENTRY_OWNER is tricky (only comparison to accessing thread would be OK with no lock), or we need to introduce another lock for accessing ENTRY_OWNER, which complicates the code too much. So, simply have a thread private object for recursive pinentry access. GnuPG-bug-id: 3190 Signed-off-by: NIIBE Yutaka <[email protected]>
* | agent: Allow recursive use of pinentry.NIIBE Yutaka2017-10-262-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | * agent/agent.h (struct server_control_s): Add pinentry_level. * agent/call-pinentry.c (agent_popup_message_stop): Not clear ENTRY_CTX here. (unlock_pinentry): Handle recursion. Clear ENTRY_CTX here. (start_pinentry): Allow recursive use. -- GnuPG-bug-id: 3190 Signed-off-by: NIIBE Yutaka <[email protected]>
* | agent, tests: Support --disable-scdaemon build case.NIIBE Yutaka2017-10-263-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/command.c (cmd_scd): Support !BUILD_WITH_SCDAEMON. * tests/openpgp/defs.scm (create-gpghome): Likewise. * tests/gpgsm/gpgsm-defs.scm (create-gpgsmhome): Likewise. -- We could modify gpg-agent to remove all support of scdaemon, with no inclusion of call-scd.c, divert-scd.c, and learncard.c, but it would not be worth to do that. GnuPG-bug-id: 3316 Signed-off-by: NIIBE Yutaka <[email protected]>
* | Fix comment of configure.NIIBE Yutaka2017-10-261-1/+1
| | | | | | | | | | | | * configure.ac (BUILD_WITH_DIRMNGR): Comment fix. Signed-off-by: NIIBE Yutaka <[email protected]>
* | Register DCO for Rainer PerskeWerner Koch2017-10-241-0/+3
| | | | | | | | --
* | agent: Send pinentry the uid of connecting process where possible.Daniel Kahn Gillmor2017-10-194-13/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/agent.h (server_control_s): Add field 'client_uid'. * agent/call-pinentry.c (start_pinentry): Add uid field to assuan option "owner" sent to pinentry. * agent/command-ssh.c (peer_info_s): New static struct. (get_client_pid): Rename to... (get_client_info): Here, and extract uid in addition to pid. (start_command_handler_ssh): Use get_client_info() instead of get_client_pid(). * agent/command.c (start_command_handler): Try assuan_get_peercred, and only fall back to assuan_get_pid when assuan_get_peercred fails. -- This also requires an update to pinentry to handle the new uid field. Distributing the uid as well as the pid makes it harder for a different user on the same machine to take advantage of any race conditions between when a requesting process might ask for something that needs pinentry, and when pinentry gets around to inspecting the state of that process. We put the uid before the nodename because the uid is guaranteed to be a integer (represented in decimal), which makes it much simpler to parse past than the potentially arbitrarily structured nodename. Use a / instead of whitespace to delimit pid/uid at Werner's request. If we were willing to depend on the nodename being whitespace-delimited (as the current, unreleased pinentry code does), then we could add the uid after the nodename. But since no released pinentry depends on this option anyway, i think we should make the more conservative, easily-parseable choice and put the user ID first. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* | g10: Fix find_and_check_key for multiple keyrings.NIIBE Yutaka2017-10-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/pkclist.c (find_and_check_key): Call get_validity on a specific keyblock. -- When we have multiple keyrings, get_validity after get_best_pubkey_byname should access same keyring. Or else, the situation of an expired key in keyring A but valid key in keyring B causes SEGV. Thanks to Guido Günther for the use case and the log. Debian-bug-id: 878812 Signed-off-by: NIIBE Yutaka <[email protected]>
* | gpg: Keep a lock during the read-update/insert cycle in import.Werner Koch2017-10-183-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keydb.c (keydb_handle): New field 'keep_lock'. (keydb_release): Clear that flag. (keydb_lock): New function. (unlock_all): Skip if KEEP_LOCK is set. * g10/getkey.c (get_keyblock_byfprint_fast): Call keep_lock if requested. -- That change is straightforward. It helps to avoid the race condition that another gpg process inserts a key while the first process is between the search and the insert. A similar change is due for gpgsm. Note that the key edit operations may still suffer from a race. GnuPG-bug-id: 3446
* | gpg: Improve keydb handling in the main import function.Werner Koch2017-10-183-60/+95
| | | | | | | | | | | | | | | | | | | | * g10/getkey.c (get_pubkey_byfprint_fast): Factor most code out to ... (get_keyblock_byfprint_fast): .. new function. * g10/import.c (revocation_present): s/int rc/gpg_error_t err/. (import_one): Use get_keyblock_byfprint_fast to get the keyblock and a handle. Remove the now surplus keyblock fetch in the merge branch. Signed-off-by: Werner Koch <[email protected]>
* | gpg: Simplify keydb handling of the main import function.Werner Koch2017-10-182-81/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/import.c (import_keys_internal): Return gpg_error_t instead of int. Change var names. (import_keys_es_stream): Ditto. (import_one): Ditto. Use a single keydb_new and simplify the use of of keydb_release. -- Note that this opens a keydb handle before we call get_pubkey_byfprint_fast which internally uses another key db handle. A further patch will cleanup this double use. Note that we also disable the keydb caching for the insert case. The s/int/gpg_error_t/ has been done while checking the call chains of the import functions and making sure that gpg_err_code is always used. Signed-off-by: Werner Koch <[email protected]>
* | gpg: Fix wrong Tofu DB consistency check.Werner Koch2017-10-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | * g10/tofu.c (build_conflict_set): Do not assume MAX_FINGERPRINT_LEN is the size of the fingerprint. -- This problem was exhibited by commit ecbbafb88d920e713439b6b1b8e1b41a6f8d0e38. Signed-off-by: Werner Koch <[email protected]>
* | gpg,sm: New option --with-key-screening.Werner Koch2017-10-1711-5/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/pkscreening.c: New. * common/pkscreening.h: New. * common/Makefile.am (common_sources): Add them. * g10/gpg.c (opts): New option --with-key-screening. * g10/options.h (struct opt): New field with_key_screening. * g10/keylist.c: Include pkscreening.h. (print_pk_screening): New. (list_keyblock_print): Call it. (print_compliance_flags): Call it. * sm/gpgsm.c (opts): New option --with-key-screening. * sm/gpgsm.h (scruct opt): New field with_key_screening. * sm/keylist.c: Include pkscreening.h. (print_pk_screening): New. (print_compliance_flags): Call it. Add new arg cert. (list_cert_colon): Pass arg cert (list_cert_std): Call print_pk_screening. * sm/fingerprint.c (gpgsm_get_rsa_modulus): New. -- This new option can be used to detect ROCA affected keys. To scan an entire keyring and print the affected fingerprints use this: gpg -k --with-key-screening --with-colons | gawk -F: \ '$1~/pub|sub|sec|ssb|crt/ && $18~/\<6001\>/ {found=1;next}; $1=="fpr" && found {print $10}; {found=0}' The same works for gpgsm. Note that we need gawk due to the "\<" in the r.e. Signed-off-by: Werner Koch <[email protected]>
* | sm: Fix colon listing of fields > 12 in crt records.Werner Koch2017-10-171-2/+1
| | | | | | | | | | | | | | | | | | * sm/keylist.c (print_capabilities): Move colon printing ... (list_cert_colon): to here. -- Fixes-commit: 7af008bfe1641938a6c2c995cb065829fa05a693 Signed-off-by: Werner Koch <[email protected]>
* | gpg: Fix comparison.Neal H. Walfield2017-10-061-1/+1
| | | | | | | | | | | | | | * g10/gpgcompose.c (literal_name): Complain if passed zero arguments, not one or fewer. Signed-off-by: Neal H. Walfield <[email protected]>