aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Update --trusted-key to accept fingerprint as well as long key id.dkg/fix-4855Daniel Kahn Gillmor2020-02-262-7/+12
| | | | | | | | | | * g10/trustdb.c (tdb_register_trusted_key): accept fingerprint as well as long key ID. * doc/gpg.texi: document that --trusted-key can accept a fingerprint. -- GnuPG-bug-id: 4855 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Spelling cleanup.Daniel Kahn Gillmor2020-02-1883-122/+122
| | | | | | | | | | | | | | | | No functional changes, just fixing minor spelling issues. --- Most of these were identified from the command line by running: codespell \ --ignore-words-list fpr,stati,keyserver,keyservers,asign,cas,iff,ifset \ --skip '*.po,ChangeLog*,help.*.txt,*.jpg,*.eps,*.pdf,*.png,*.gpg,*.asc' \ doc g13 g10 kbx agent artwork scd tests tools am common dirmngr sm \ NEWS README README.maint TODO Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* doc: Correction of typo in documentation of KEY_CONSIDEREDNick Piper2020-02-181-1/+1
| | | | Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* sm: Remove left over debug output.Werner Koch2020-02-171-1/+0
| | | | --
* scd: Disable pinpad if it's impossible by KDF DO.NIIBE Yutaka2020-02-171-7/+30
| | | | | | | | | | | | * scd/app-openpgp.c (struct app_local_s): Add pinpad.disabled field. (do_getattr): Set pinpad.disabled field. (check_pinpad_request): Use the pinpad.disabled field. (do_setattr): Update pinpad.disabled field. -- GnuPG-bug-id: 4832 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgsm: Fix import of some CR,LF ternminated certificatesWerner Koch2020-02-151-8/+18
| | | | | | | | | | | * common/ksba-io-support.c (base64_reader_cb): Detect the END tag and don't just rely on the padding chars. This could happen only with CR+LF termnmated PEM files. Also move the detection into the invalid character detection branch for a minor parser speedup. -- GnuPG-bug-id: 4847 Signed-off-by: Werner Koch <[email protected]>
* build: New configure option --disable-keyboxdWerner Koch2020-02-132-2/+13
| | | | | | | | | | * configure.ac: Add option --dsiable-keyboxd * kbx/Makefile.am: Do not build keyboxd in that case. -- This is useful to build a minimal version of gpgv. Signed-off-by: Werner Koch <[email protected]>
* scd: Print the main app name also for not fully supported cards.Werner Koch2020-02-131-0/+9
| | | | | | | | | | | * scd/app.c (send_serialno_and_app_status): Add fallback. -- The app list was only printed for apps which support the with_keygrip function. That is not the case for the netkey and otehr cards. The new fallback prints the actual app name. Signed-off-by: Werner Koch <[email protected]>
* card: Fix openpgp subkey listing.Werner Koch2020-02-131-8/+12
| | | | | | * tools/gpg-card.c (list_one_kinfo): Fix printing of the subkeys. Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --full-timestrings.Werner Koch2020-02-136-4/+55
| | | | | | | | | | | | | | | | | | | | | * g10/options.h (opt): Add flags.full_timestrings. * g10/gpg.c (oFullTimestrings): New. (opts): New option. (main): Set new flag. * g10/keyid.c (dateonlystr_from_pk): New. (dateonlystr_from_sig): New. (datestr_from_pk): Divert to isotimestamp if requested. (datestr_from_sig): Ditto. (expirestr_from_pk): Ditto. (expirestr_from_sig): Ditto. (revokestr_from_pk): Ditto. * g10/import.c (impex_filter_getval): Use dateonlystr_from_sig and dateonlystr_from_pk. -- Quite helpful for debugging keys. Signed-off-by: Werner Koch <[email protected]>
* gpg: Changes to allow direct key generation from an OpenPGP card.Werner Koch2020-02-133-183/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/call-agent.h (struct keypair_info_s): Add fields keytime and usage. * g10/call-agent.c (struct keypairinfo_cb_parm_s): New. (scd_keypairinfo_status_cb): Rework to store parsed KEYPAIRINFO data. (agent_scd_keypairinfo): Change accordingly. (agent_scd_readkey): Add arg ctrl and change callers. Change return arg from an strlist_t to a keypair_info_t. (readkey_status_cb): Use KEYPAIRINFO instead of KEY-TIME. * g10/keygen.c (pSUBKEYCREATIONDATE): New. (pAUTHKEYCREATIONDATE): New. (get_parameter_u32): Allow for new parameters. (do_create_from_keygrip): For card keys use direct scd call which does not create a stub file. (ask_algo): Rework to use the new keypair_info_t as return from agent_scd_keypairinfo. (parse_key_parameter_part): Likewise. Also get and return the key creation time using a arg. (parse_key_parameter_string): New args r_keytime and r_subkeytime. (parse_algo_usage_expire): New arg r_keytime. (proc_parameter_file): Ignore the explict pCREATIONDATE for card keys. (quickgen_set_para): New arg keytime. (quick_generate_keypair): Get the keytimes and set the pCARDKEY flag. (generate_keypair): Likewise. (do_generate_keypair): Implement the cardkey with keytime thingy. (generate_subkeypair): Use the keytime parameters. * g10/keygen.c (pAUTHKEYCREATIONDATE): New. Not yet set but may come handy later. (get_parameter_u32): Take care of that. (do_generate_keypair): For cardkeys sign with the current time. -- Key generation direct from the card used to work for all cards except the OpenPGP cards. The key generation from card using an OpenPGP card is special because the fingerprint is stored on the card and we must make sure that the newly created key has the same fingerprint. This requires that we take the key creation date as stored on the card into account. Along with the recent change in gpg-agent this change also fixes a problem with existing stub files. Note that with a key take from a card the self-signature are created with the current time and not the creation time. This allows to better distinguish keys created using the same card. Signed-off-by: Werner Koch <[email protected]>
* card: Take the key creation time from the KEYPAIRINFOWerner Koch2020-02-131-45/+18
| | | | | | | | | * tools/card-call-scd.c (learn_status_cb): Adjust for recent change. -- This adjusts for the chnage in scdaemon. Signed-off-by: Werner Koch <[email protected]>
* scd:openpgp: Return key creation time as part of KEYPARIINFO.Werner Koch2020-02-133-18/+25
| | | | | | | | | | | | | * scd/app-openpgp.c (send_keypair_info): Reaturn the key creation time as part of a KEYPAIRINFO. (do_readkey): Do not return the KEY-TIME anymore. -- Sending the KEY_TIME status as part of a READKEY command was only recently added. It is better to merge that into the KEYPAIRINFO line. Another patch with chnage this for the consumers of that info. Signed-off-by: Werner Koch <[email protected]>
* agent: Allow signing with card key even without a stub key.Werner Koch2020-02-138-32/+172
| | | | | | | | | | | | | | | | | | | | * agent/call-scd.c (agent_card_serialno): Allow NULL for R_SERIAL. (struct readkey_status_parm_s): New. (readkey_status_cb): New. (agent_card_readkey): Add optional arg R_KEYREF and change all callers. * agent/findkey.c (key_parms_from_sexp): Allow also a "public-key". * agent/divert-scd.c (ask_for_card): Allow for SHADOW_INFO being NULL. * agent/pksign.c (agent_pksign_do): Fallback to sign with an on-card if there is no stub key yet. Create the stub key. Also fixed a misnaming between s_pkey and s_skey. -- This change allows to create OpenPGP keys directly from a card without first making sure that a stub key exists. It is also the less surprising behaviour. Signed-off-by: Werner Koch <[email protected]>
* gpg: Rename the struct card_key_info_s.Werner Koch2020-02-123-17/+22
| | | | | | | | | | | | | | | | * g10/call-agent.h (struct card_key_info_s): Rename to ... (struct keypair_info_s): this. (keypair_info_t): New. Use this everywhere instead of card_key_info_s. * g10/call-agent.c (agent_scd_free_keyinfo): Rename to .. (free_keypair_info): this. Change all callers. -- The struct is also useful to store the data from KEYPAIRINFO status lines. Thus renaming it makes sense. A future patch will extend the struct. Signed-off-by: Werner Koch <[email protected]>
* card: Fix parsing of the received card_list.Werner Koch2020-02-121-1/+1
| | | | | | | * tools/card-call-scd.c (scd_cardlist): Allow for SERIALNO without any apps. Signed-off-by: Werner Koch <[email protected]>
* card: List more info for an OpenPGP key.Werner Koch2020-02-123-12/+21
| | | | | | | | | | | | | | | | * tools/gpg-card.h (struct pubkey_s): Add field created. * tools/card-keys.c (parse_key_record): Set that field. * tools/gpg-card.c (print_shax_fpr): Print the fingerprint without spaces for easier c+p. (list_one_kinfo): Print the actual used fingerprint and creation date from the keyblock. -- A common problem with OpenPGP cards is that the fingerprint as stored on the card does not match the actual fingerprint. Print both values to be able to investigate such issues. Signed-off-by: Werner Koch <[email protected]>
* card: New option --no-key-lookup.Werner Koch2020-02-122-22/+40
| | | | | | | | | | | | | | | * tools/gpg-card.h (opt): Add var no_key_lookup. * tools/gpg-card.c (oNoKeyLookup): New const. (opts): New option --no-key-lookup. (list_one_kinfo): Add arg no_key_lookup and implement. (list_all_kinfo): Add arg no_key_lookup. (list_openpgp, list_piv, list_card): Ditto. (cmd_list): New option --no-key-lookup. -- Printing the OpenPGP and X.509 keys used for a specific card key can be a lengthy operation. The new command line option and option to "list" allows to suppress that part of the output.
* gpg: Improve key creation direct from the card.Werner Koch2020-02-113-26/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/call-agent.c (readkey_status_cb): New. (agent_scd_readkey): Add new arg r_keytime and allow NULL for r_result. Change all callers. (agent_readkey): Minor code reformatting. * g10/keygen.c (pCARDKEY): New. (struct para_data_s): Add u.bool. (get_parameter_bool): New. (do_create_from_keygrip): Add arg cardkey and make use of it. (ask_algo): Add args r_cardkey and r_keytime. Read the keytime of the selected card key and return it. (generate_keypair): Store CARDKEY and KEYTIME. (do_generate_keypair): Pass CARDKEY to do_create_from_keygrip. (generate_subkeypair): Ditto. -- This allows to first create keys on the card (e.g. using gpg-card) even without having any public key for OpenPGP. Then the key generation option 14 (cardkey) can be used to create a primary OpenPGP key from the key on the card. There are still a couple of problems related to the agent which creates the stub key and may run into problems if creating a second key from the card. This will be fixed in a future patch. Signed-off-by: Werner Koch <[email protected]>
* scd:openpgp: Send a KEY-TIME status with READKEYWerner Koch2020-02-112-1/+39
| | | | | | | | | | | * scd/app-openpgp.c (retrieve_fprtime_from_card): New. (do_readkey): Send a KEY_TIME status. -- It might be easier to fold this into KEYPAIRINFO but for backward compatibility using a separate status line is safer. Signed-off-by: Werner Koch <[email protected]>
* card: First code to actually create openpgp keys.Werner Koch2020-02-112-17/+3
| | | | | | | | | | | | | | | | | | | | | | | | * tools/gpg-card.c (generate_all_openpgp_card_keys): Add demo key generation. (generate_key): Allow generatiing one OpenPGP key. -- This does now allows to create a single OpenPGP key optioanlly with a specified parameter. For example to create an auth key: gpg-card generate --algo=ed25519 OPENPGP.3 Using option --force will overwrite and already existing key. scdaemon does here take care of swicthing the key attributes before generating the key. TODO: We need to add some more stuff to app-openpgp so that the user is not annoyed by beeing asked to enter the Admin-PIN twice (change the key attributes clear the verification state). gpg's key generation also needs some tweaks for using an existing card key which has no key stub in private-keys-v1.d. Signed-off-by: Werner Koch <[email protected]>
* scd:openpgp: Optional allow for lowercase keyrefs.Werner Koch2020-02-111-10/+10
| | | | | | | | | * scd/app-openpgp.c (do_readkey): Use case insensitive match of the keyref. (do_writekey, do_sign, do_auth, do_decipher): Ditto. -- Signed-off-by: Werner Koch <[email protected]>
* scd:openpgp: Allow auto-changing of the key attributes in genkey.Werner Koch2020-02-112-47/+181
| | | | | | | | | | | | | | | | * scd/app-openpgp.c (struct app_local_s): Add field keyalgo. (parse_algorithm_attribute): Store the new keyalgo field. (change_keyattr): Change info message. (change_keyattr_from_string): Rewrite to also accept a keyref and a keyalgo string. (do_genkey): Change the keyattr if a keyalgo string is given. -- Having this feature makes it easier to use OpenPGP cards in a similar way to other cards. Note that the explicit changing via SETATTR is still supported. Signed-off-by: Werner Koch <[email protected]>
* common: Extend the openpgp_curve_to_oid function.Werner Koch2020-02-119-16/+27
| | | | | | | | | * common/openpgp-oid.c (openpgp_curve_to_oid): Add optional arg R_NBITS. Change all callers. -- In particular for ed25519 and cv25519 it is quite useful to have an ability to get the required algorithm.
* doc: Improve the warning section of the gpg man page.Werner Koch2020-02-101-10/+16
| | | | | | * doc/gpg.texi: Update return valeu and warning sections. Signed-off-by: Werner Koch <[email protected]>
* build: Always use EXTERN_UNLESS_MAIN_MODULE pattern.Werner Koch2020-02-1032-18/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | * common/util.h (EXTERN_UNLESS_MAIN_MODULE): Add the definion only here but now without the Norcroft-C. Change all other places where it gets defined. * common/iobuf.h (iobuf_debug_mode): Declare unconditionally as extern. * common/iobuf.c (iobuf_debug_mode): Define it here. * agent/gpg-agent.c (INCLUDED_BY_MAIN_MODULE): Define here and also in all main modules of all other programs. * g10/main.h: Put util.h before the local header files. -- This change is required for use with gcc/ld's LTO feature which does not allow common blocks. Further gcc 10 will make -fno-common the default and thus this chnage is always needed. What a pitty. Co-authored-by: Tomáš Mráz GnuPG-bug-id: 4831 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 21d9bd8b87a9f793a106095e3838eb71825189d7) - Applied respective chnages also to gpg-card and keyboxd. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make really sure that --verify-files always returns an error.Werner Koch2020-02-101-5/+13
| | | | | | | | | | | | | | | | * g10/verify.c (verify_files): Track the first error code. -- It seems to be possible to play tricks with packet structures so that log_error is not used for a bad input data. By actually checking the return code and let the main driver in gpg call log_error, we can fix this case. Note that using gpg --verify-files and relying solely on gpg's return code is at best a questionable strategy. It is for example impossible to tell which data has been signed. Signed-off-by: Werner Koch <[email protected]>
* card: Remove command "key-attr" and hack on "generate".Werner Koch2020-02-103-398/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/gpg-card.h (struct key_attr): Remove. (struct key_info_s): Remove key_attr. Add keyalgo and keyalgo_id. * tools/card-call-scd.c (learn_status_cb): Rework the key-attr info. * tools/gpg-card.c (list_one_kinfo): Always show the algorithm; if there is no key show the key attributes instead. (list_openpgp): Do not print the "Key attributes". (generate_key): Factor the repalce key pormpt out to ... (ask_replace_keys): new. (generate_openpgp): Rename to generate_all_openpgp_card_keys and add an algo parameter. (generate_generic): Rename to generate_key. Prepare generation of a single OpenPGP key. (cmd_generate): Revamp. (ask_card_rsa_keysize): Remove. (ask_card_keyattr): Remove. (do_change_keyattr): Remove. (cmd_keyattr): Remove. (enum cmdids): Remove cmdKEYATTR. (cmds): Ditto. (dispatch_command): Ditto. (interactive_loop): Ditto. -- This change shows the key attributes of an OpenPGP card instead of the key's algorithm if no key exists. It also remove the key-attr command because for uniformity it is better to do this directly in scd/app-openpgp.c At least for this new gpg-card tool. There a couple of other changes but to the generate command but they are not yet ready. Signed-off-by: Werner Koch <[email protected]>
* scd:openpgp: Let the genkey function also accept a full keyref.Werner Koch2020-02-092-4/+13
| | | | | | | | | | | * scd/app-openpgp.c (send_key_attr): Use log_assert. (do_genkey): Allow prefix. -- It is more uniform to always use full keyref (e.g. "OPENPGP.1") instead of just the key number. Signed-off-by: Werner Koch <[email protected]>
* common: Extend the new get_keyalgo_string functionWerner Koch2020-02-092-5/+29
| | | | | | | | | | | | * common/openpgp-oid.c (openpgp_oid_or_name_to_curve): New. (get_keyalgo_string): Use it. -- We do not always have an OID, so except the name or the alias of the curve as well. This creates a second entry mapping to the same name but that does not matter. Signed-off-by: Werner Koch <[email protected]>
* common: Remove duplicated call to a function.Werner Koch2020-02-091-1/+0
| | | | | | | | | | * common/openpgp-oid.c (openpgp_oid_to_str): Remove duplicated call. -- The removed function was already called. No memleak etc, though. Fixes-commit: 4a1558d0c7190cf13d35385e47291a7aa121be3e Signed-off-by: Werner Koch <[email protected]>
* common: New function get_keyalgo_string.Werner Koch2020-02-094-3/+198
| | | | | | | | | | | | | | | | | * common/openpgp-oid.c (struct keyalgo_string_s): New. (keyalgo_strings): New. (keyalgo_strings_size, keyalgo_strings_used): New. (get_keyalgo_string): New. -- This function is intended as a more general version of gpg's pubkey_string function. It has the advantage to avoid mallocs and uses static table of algorithm strings instead. There should be only a few dozen of such strings (if at all) and thus all those allocations we do internally in gpg's pubkey_string and the static buffers all over the place are not too nice. Signed-off-by: Werner Koch <[email protected]>
* common: Add OpenPGP<->Gcrypt pubkey id mapping functions.Werner Koch2020-02-095-21/+41
| | | | | | | | | * g10/misc.c (map_pk_gcry_to_openpgp): Move to ... * common/openpgp-oid.c (map_gcry_pk_to_openpgp): here and rename. Change all 4 callers. (map_openpgp_pk_to_gcry): New. Signed-off-by: Werner Koch <[email protected]>
* card: Support brainpool curves in the generate command.Werner Koch2020-02-091-11/+26
| | | | | | | * tools/gpg-card.c (cmd_generate): Add brainpool curves and dummy name "help". Signed-off-by: Werner Koch <[email protected]>
* sm: New option --issuer-der for the listkey commands.Werner Koch2020-02-031-7/+73
| | | | | | | | | | | | | | | | | | | | | * sm/server.c (do_listkeys): Implement new option. -- This option can be used by clients who can only provide a DER encoded form of the issuer. For example in PKCS#11 providers. Testing: Put the DER encoded issuer DN into a file, say issuer.der. The run gpg-connect-agent -E -- gpgsm --server > /definqfile ISSUER_DER issuer.der > list-keys --issuer-der 01020304 and if the local keyring has a certifictate with that issuer and a s/n of 0x01020304 that certificate will be listed. Signed-off-by: Werner Koch <[email protected]>
* card: Add new OpenPGP card vendor.Werner Koch2020-01-282-0/+2
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Fix building w/o LDAP supportWerner Koch2020-01-211-0/+6
| | | | | | * dirmngr/Makefile.am: Conditionally build dirmngr_ldap. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix printing of keyring name (regression in master)Werner Koch2020-01-211-1/+1
| | | | | | | | * g10/keydb.c (keydb_get_resource_name): -- Fixes-commit: aba82684fe14289cf62b4694bc398f3a274b4762 Signed-off-by: Werner Koch <[email protected]>
* card: Add new OpenPGP card vendorWerner Koch2020-01-212-0/+2
| | | | --
* build: Require libgpg-error 1.37Werner Koch2020-01-212-2/+2
| | | | --
* tools: Let watchgnupg determine the socket name via gpgconf.Werner Koch2020-01-202-26/+159
| | | | | | | | | | | | | | * tools/watchgnupg.c: Include sys/wait.h. (GNUPG_DEF_COPYRIGHT_LINE): Add a default value for standalone building. (get_logname): New. (main): Use a default socket name and add option --homedir. -- This is quite convenient and saves a lot of typing or shell alias definitions. Signed-off-by: Werner Koch <[email protected]>
* gpgconf,w32: Print a warning for a suspicious homedir.Werner Koch2020-01-172-0/+17
| | | | | | | | * tools/gpgconf.c (list_dirs): Check whether the homedir has been taken from the registry. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Prefer card key on use in multiple subkeys situation.NIIBE Yutaka2020-01-172-42/+80
| | | | | | | | | | | | | * g10/call-agent.c (keyinfo_status_cb): Parse more fields. (agent_probe_secret_key): Use KEYINFO and returns bigger value representing the preference. * g10/getkey.c (finish_lookup): For subkeys, select one by using value of agent_probe_secret_key. -- GnuPG-bug-id: 3416 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Prepare enhancement of agent_probe_secret_key.NIIBE Yutaka2020-01-178-26/+32
| | | | | | | | | | | | | | | | | | | * g10/call-agent.c (agent_probe_secret_key): Change semantics of return value. * g10/call-agent.h (agent_probe_secret_key): Change comment. * g10/delkey.c (do_delete_key): Follow the change. * g10/getkey.c (get_seckey, parse_def_secret_key): Likewise. (finish_lookup, have_secret_key_with_kid): Likewise. * g10/gpgv.c (agent_probe_secret_key): Likewise. * g10/keyedit.c (keyedit_menu, quick_find_keyblock): Likewise. (show_key_with_all_names_colon): Likewise. * g10/revoke.c (gen_desig_revoke, gen_revoke): Likewise * g10/test-stubs.c (agent_probe_secret_key): Likewise. -- GnuPG-bug-id: 3416 Signed-off-by: NIIBE Yutaka <[email protected]>
* card: Allow switching of cards and applications.Werner Koch2020-01-163-24/+193
| | | | | | | | | | | | | | | | | | | | | * tools/card-call-scd.c (struct card_cardlist_parm_s): Add field with_apps. (card_cardlist_cb): Handle the new with_apps flag. (scd_switchcard): New. (scd_switchapp): New. (scd_applist): New. (scd_serialno): Pass --all also in --demand mode. * tools/gpg-card.c (cmd_list): Simplify switching of cards. Add switching of alls. Print a list of apps per card. -- Note that the output format of "list --card" slightly changes: The current card is indicated with an asterisk. That should not harm any robust parsers which might already be in use. It is anyway a development version. Signed-off-by: Werner Koch <[email protected]>
* scd: New commands SWITCHCARD and SWITCHAPP.Werner Koch2020-01-163-13/+262
| | | | | | | | | | | | | | | | | | | | * scd/app.c: Include membuf.h. (app_switch_current_card): New. (send_card_and_app_list): Factor code out to ... (send_serialno_and_app_status): new. (app_send_card_list): New. (app_send_active_apps): New. (app_switch_active_app): New. * scd/command.c (cmd_switchcard): New. (cmd_switchapp): New. (register_commands): Register new commands. (cmd_getinfo): New sub-commands "active_apps" and "all_active_apps". -- These new commands allow to switch between known cards and are in particular useful for the gpg-card tool. Signed-off-by: Werner Koch <[email protected]>
* scd:piv: Remove debug code from a recent commit.Werner Koch2020-01-161-2/+1
| | | | | | | | | | * scd/app-piv.c (ask_and_prepare_chv): here. -- The test code from the last PIV change was accidently kept enabled. Fixes-commit: 2dd6b4b998dd6e156e2e75ede0f40fb768c69f40 Signed-off-by: Werner Koch <[email protected]>
* gpg: Print better debug info in case of broken sig subpackets.Werner Koch2020-01-161-1/+4
| | | | | | | | | | | | | | | | | * g10/parse-packet.c (enum_sig_subpkt): Print a hexdump. -- A test key for this is 02DF08F5FD356BF27F5F7B838921B5DCCD15A883 . A key listing in verbose mode will now yield gpg: DBG: buffer shorter than subpacket (10/9/25);\ dump: 19100d87e54973647cff The error here is that the packet length is 0x19 but what follows is a long keyid (subpacket 16) which is shorter. The debug output might be helpful to better analyze broken signatures. Signed-off-by: Werner Koch <[email protected]>
* gpg: Use "SCD KEYINFO" to get available card keys.NIIBE Yutaka2020-01-161-80/+29
| | | | | | | | | | | | | * g10/skclist.c (enum_secret_keys): Don't use agent_scd_cardlist and agent_scd_serialno, but agent_scd_keyinfo. -- When there are multiple cards/tokens, this change can avoid switching card of foreground access. GnuPG-bug-id: 4784 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Add agent_scd_keyinfo to retrieve available card keys.NIIBE Yutaka2020-01-162-1/+178
| | | | | | | | * g10/call-agent.c (card_keyinfo_cb, agent_scd_free_keyinfo) (agent_scd_keyinfo): New. * g10/call-agent.h: Define new functions. Signed-off-by: NIIBE Yutaka <[email protected]>