aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* gpg: Add experimental support for an issuer fpr.Werner Koch2016-06-207-31/+99
| | | | | | | | | | | | | | | | | | | | | * common/openpgpdefs.h (SIGSUBPKT_ISSUER_FPR): New. * g10/build-packet.c (build_sig_subpkt_from_sig): Add arg PKSK and insert the issuer fpr if needed. * g10/sign.c (write_signature_packets): Pass signing key. (make_keysig_packet): Ditto. (update_keysig_packet): Ditto. * g10/parse-packet.c (dump_sig_subpkt): Print issuer fpr. (parse_one_sig_subpkt): Detect issuer fpr. (can_handle_critical): Add issuer fpr. * g10/mainproc.c (check_sig_and_print): Try to get key via fingerprint. * g10/gpgv.c (keyserver_import_fprint): New stub. * g10/test-stubs.c (keyserver_import_fprint): New stub. -- This support is enabled with the --rfc4880bis option and intended to test to recently proposed issuer fpr. Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --rfc4880bis.Werner Koch2016-06-202-0/+10
| | | | | | | | | | | | | * g10/options.h (struct opt): Add field flags.rfc4880bis. * g10/gpg.c (oRFC4880bis): new. (opts): add --rfc4880bis. (main): Implement that and print a warning. -- This is option enables experimental features which may be dropped or changed with the next release. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix another race condition for trustdb access.Niibe Yutaka2016-06-141-2/+6
| | | | | | | | | | | | | * g10/tdbio.c (create_version_record): Call create_hashtable to always make hashtable, together with the version record. (get_trusthashrec): Remove call to create_hashtable. -- GnuPG-bug-id: 1675 Thanks to Scott Moser for a reproducible script and patience. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Print the subkey's curve and not the primary key curve.Werner Koch2016-06-141-4/+4
| | | | | | | | * g10/keylist.c (list_keyblock_colon): Use PK2 for the subkey's curve. -- Reported-by: mantorix at vollbio punkt de Signed-off-by: Werner Koch <[email protected]>
* gpg: Avoid endless loop in a tofu error case.Werner Koch2016-06-141-1/+1
| | | | | | | * g10/tofu.c (get_trust): Do not jump to out. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Split tofu's get_trust function into several smaller ones.Werner Koch2016-06-141-434/+480
| | | | | | | | | * g10/tofu.c (get_trust): Factor code out to ... (format_conflict_msg_part1): new and to ... (ask_about_binding): new. -- Signed-off-by: Werner Koch <[email protected]>
* doc: Consistently use 'keyserver'.Werner Koch2016-06-144-8/+8
| | | | | | | -- GnuPG-bug-id: 2383 Signed-off-by: Werner Koch <[email protected]>
* gpg: Un-deprecate option --auto-key-retrieve.Werner Koch2016-06-131-6/+0
| | | | | | | | | | | * g10/gpg.c (main): Remove deprecation warning. -- Most options for the keyserver have been moved to dirmngr and thus it does not make sense to favor "--keyserver-options auto-key-retrieve" over the direct options --auto-key-retrieve and --no-auto-key-retrieve. Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --disable-signer-uid, create Signer's UID sub-packet.Werner Koch2016-06-134-2/+24
| | | | | | | | | | | | | | * g10/gpg.c (oDisableSignerUID): New. (opts): New option '--disable-signer-uid'. (main): Set option. * g10/options.h (opt): Add field flags.disable_signer_uid. * g10/sign.c: Include mbox-util.h. (mk_notation_policy_etc): Embed the signer's uid. * g10/mainproc.c (check_sig_and_print): Do not use WKD for auto key retrieval if --disable-signer-uid is used. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Try Signer's User ID sub-packet with --auto-key-retrieve.Werner Koch2016-06-134-12/+84
| | | | | | | | | | | | | | * g10/packet.h (PKT_signature): Add field 'signers_uid'. * g10/parse-packet.c (parse_signature): Set this field. * g10/free-packet.c (free_seckey_enc): Free field. (copy_signature): Copy field. * g10/mainproc.c (akl_has_wkd_method): New. (check_sig_and_print): Extend NEWSIG status. If WKD is enabled try to locate a missing key via the signature's Signer's User ID sub-packet. Do this right before trying a keyserver lookup. -- Signed-off-by: Werner Koch <[email protected]>
* gpg,indent: Re-indent and chnage var names in sign.cWerner Koch2016-06-131-70/+69
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove C-99ism, re-indent, and simplify one function.Werner Koch2016-06-114-77/+107
| | | | | | | | | | | | | * g10/call-agent.c (struct keyinfo_data): Rename to keyinfo_data_parm_s. (agent_get_keyinfo): Replace C-99 style init. (keyinfo_status_cb): Use new fucntion split_fields. * g10/export.c (match_curve_skey_pk): Add missings returns error cases. (cleartext_secret_key_to_openpgp): Better clear PK->PKEY first. -- Signed-off-by: Werner Koch <[email protected]>
* g10: Export cleartext keys as cleartextDaniel Kahn Gillmor2016-06-111-2/+3
| | | | | | | | | | | | | | * g10/export.c (do_export_stream): If a key is stored by the agent in cleartext, then try to export it as cleartext. * tests/openpgp/export.test: For secret keys that are stored in cleartext, test should try to export without pinentry interaction. -- This restores the behavior of GnuPG 2.0 and 1.4 when exporting passphraseless secret keys, and fixes the test suite accordingly. GnuPG-bug-id: 2070, 2324 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* g10: Allow receiving cleartext secret keys from agentDaniel Kahn Gillmor2016-06-113-4/+223
| | | | | | | | | | | | | | | | | | | | * g10/export.c (match_curve_skey_pk): New function, testing whether an OpenPGP public key and an S-expression use the same curve. * g10/export.c (cleartext_secret_key_to_openpgp): New function, filling in the secret key parameters of a PKT_public_key object from a corresponding cleartext S-expression. * g10/export.c, g10/main.h (receive_seckey_from_agent): Add cleartext parameter, enabling retrieval of the secret key, unlocked. * g10/export.c (do_export_stream): Send cleartext as 0, keeping current behavior. * g10/keygen.c (card_store_key_with_backup): Use cleartext=0 to ensure that smartcard backups are all passphrase-locked. -- This sets up internal functionality to be capable of exporting cleartext secret keys, but does not change any existing behavior. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* g10: Add openpgp_protected flag to agent secret key export functionsDaniel Kahn Gillmor2016-06-113-8/+12
| | | | | | | | | | | | | | | | | * g10/call-agent.c, g10/call-agent.h (agent_export_key): Add openpgp_protected flag. * g10/export.c (receive_seckey_from_agent): Request openpgp_protected secret keys from agent. * agent/command.c (hlp_export_key): EXPORT_KEY help text: add a brief description of the effect of --openpgp. -- The --openpgp flag for gpg-agent's EXPORT_KEY actually forces encryption in a certain (RFC 4880-compatible format). This changeset exposes that functionality in internal functions, and clarifies functionality in the agent's help text. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* g10: report whether key in agent is passphrase-protected or notDaniel Kahn Gillmor2016-06-119-31/+60
| | | | | | | | | | | | | | | * g10/call-agent.c, g10/call-agent.h (agent_get_keyinfo): add r_cleartext parameter to report whether a key is stored without passphrase protection. * g10/gpgv.c, g10/test-stubs.c: augment dummy agent_get_keyinfo to match new API. * g10/export.c, g10/keyedit.c, g10/keygen.c, g10/keylist.c, g10/sign.c: pass NULL to agent_get_keyinfo since we do not yet need to know whether agent is passphrase-protected. -- Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* w32: Fix recent build regression.Werner Koch2016-06-081-1/+1
| | | | | | | | | | | * common/homedir.c (_gnupg_socketdir_internal) [W32]: Add definition for NAME. * g10/gpg.c (main) [W32]: Fix use og gnupg_homedir. * agent/gpg-agent.c (remove_socket): Remove unused var P. * scd/scdaemon.c (cleanup): Ditto. Signed-off-by: Werner Koch <[email protected]>
* common: Remove homedir arg from start_new_{dirmngr,gpg_agent}.Werner Koch2016-06-072-2/+0
| | | | | | | | | | * common/asshelp.c (start_new_gpg_agent): Remove arg 'homedir' in favor of gnupg_homedir (). Change all callers. (start_new_dirmngr): Ditto. * common/get-passphrase.c (gnupg_prepare_get_passphrase): Remove arg 'homedir'. Signed-off-by: Werner Koch <[email protected]>
* Replace use of opt.homedir by accessor functions.Werner Koch2016-06-0714-52/+38
| | | | | | | | | | | | | | | | | | | * common/homedir.c (the_gnupg_homedir): New var. (gnupg_set_homedir): New. (gnupg_homedir): New. * g10/options.h (struct opt): Remove 'homedir' and replace all users by the new accessor functions. * g13/g13-common.h (struct opt): Ditto. * scd/scdaemon.h (struct opt): Ditto. * sm/gpgsm.h (struct opt): Ditto. * dirmngr/dirmngr.h (struct opt): Ditto. * agent/preset-passphrase.c (opt_homedir): Ditto. * agent/protect-tool.c (opt_homedir): Ditto. -- This will make detection of a non-default homedir easier. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix command line parsing of --quick-addkey and --quick-gen-key.NIIBE Yutaka2016-06-071-2/+6
| | | | | | * g10/gpg.c (main): Compose a block by curly braces. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Use --keyid-format=none by default.Werner Koch2016-06-062-3/+3
| | | | | | | | | | * g10/gpg.c (main): Init keyid_format to KF_NONE. * g10/keyid.c (format_keyid): Ditto. (keystrlen): Ditto. -- GnuPG-bug-id: 2379 Signed-off-by: Werner Koch <[email protected]>
* gpg: Add option --with-subkey-fingerprint.Werner Koch2016-06-064-4/+27
| | | | | | | | | | | | * g10/gpg.c (oWithSubkeyFingerprint): New. (opts): Add --with-subkey-fingerprint[s]. (main): Set that option. * g10/options.h (struct opt): Add 'with_subkey_fingerprint'. * g10/keylist.c (list_keyblock_print): Print subkey fingerprint. (print_fingerprint): Tweak printing to use compact format if desirable. Signed-off-by: Werner Koch <[email protected]>
* gpg: Implement --keyid-format=none.Werner Koch2016-06-068-137/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (main): Add option "none" to --keyid-format. * g10/options.h (KF_NONE): New. * g10/keyid.c (format_keyid): Implement that. (keystr): Use format "long" is KF_NONE is in use. (keystr_with_sub): Ditto. * g10/keylist.c (list_keyblock_print): Adjust indentaion for KF_NONE. Factor some code out to ... (print_key_line): new. (print_fingerprint): Add mode 20. * g10/mainproc.c (list_node): Use print_key_line. Replace MAINKEY by flags.primary in the PK. Fix putting a " revoked..." string into the colons format. * g10/pkclist.c (do_edit_ownertrust): Use print_key_line. This slightly changes the putput format. * g10/revoke.c (gen_standard_revoke): Use print_key_line. This may also put "expires: " into the output. -- Due to user experience problems with the keyid and we better allow to show the fingerprint instead. Note that we do not support v3 keys anymore and thus there is no technical need for a user to know the keyid. GnuPG-bug-id: 2379 Signed-off-by: Werner Koch <[email protected]>
* indent: Wrap strings in debug messages.Werner Koch2016-06-061-3/+5
| | | | --
* gpg: Add the fingerprint to KEY_CREATED for subkeys.Werner Koch2016-06-021-9/+12
| | | | | | | | | * g10/keygen.c (print_status_key_created): Make more robust by allowing a NULL for PK. (generate_subkeypair): Use print_status_key_created. (generate_card_subkeypair): Ditto. Signed-off-by: Werner Koch <[email protected]>
* gpg: Try to use the passphrase from the primary for --quick-addkey.Werner Koch2016-06-024-48/+112
| | | | | | | | | | | | | | | * agent/command.c (cmd_genkey): Add option --passwd-nonce. (cmd_passwd): Return a PASSWD_NONCE in verify mode. * g10/call-agent.c (agent_genkey): Add arg 'passwd_nonce_addr' and do not send a RESET if given. (agent_passwd): Add arg 'verify'. * g10/keygen.c (common_gen): Add optional arg 'passwd_nonce_addr'. (gen_elg, gen_dsa, gen_ecc, gen_rsa, do_create): Ditto. (generate_subkeypair): Use sepeare hexgrip var for the to be created for hexgrip feature. Verify primary key first. Make use of the passwd nonce. Allow for a static passphrase. Signed-off-by: Werner Koch <[email protected]>
* gpg: Extend the --quick-gen-key command.Werner Koch2016-06-023-21/+84
| | | | | | | | | | * g10/keygen.c (quickgen_set_para): Add arg 'use'. (quick_generate_keypair): Add args 'algostr', 'usagestr', and 'expirestr'. Implement primary only key mode. (parse_algo_usage_expire): Set NBITS for the default algo. * g10/gpg.c (main): Extend --quick-gen-key command. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve the new parse_subkey_algostr_usagestr fucntion.Werner Koch2016-06-021-28/+34
| | | | | | | | | | * g10/keygen.c (parse_usagestr): Allow "cert". (generate_subkeypair): Factor expire parsing out to ... (parse_subkey_algostr_usagestr): here. Rename to ... (parse_algo_usage_expire): this. Add arg 'for_subkey'. Set CERT for primary key and check that it is not set for subkeys. Signed-off-by: Werner Koch <[email protected]>
* gpg: New command --quick-addkey.Werner Koch2016-06-024-155/+482
| | | | | | | | | | | | | | | | | | | * g10/keygen.c (DEFAULT_STD_SUBKEYUSE): New. (ask_keysize): Factor code out to ... (get_keysize_range, fixup_keysize): new. (parse_parameter_usage): Factor parsing out to ... (parse_usagestr): new. Allow use of "encr" as alias for "encrypt". (parse_subkey_algostr_usagestr): New. (generate_subkeypair): Add new args. Implement unattended mode. * g10/keyedit.c (keyedit_quick_sign): Factor some code out to ... (find_by_primary_fpr): new. (keyedit_quick_addkey): New. * g10/gpg.c (aQuickAddKey): New. (opts): Add --quick-addkey. (main): Implement. Signed-off-by: Werner Koch <[email protected]>
* gpg: Do not abort on certain invalid packets.Werner Koch2016-06-022-3/+8
| | | | | | | | | | | | | | | * g10/build-packet.c (write_fake_data): Check for non-opaque data. * g10/seskey.c (do_encode_md): Return NULL instead of abort. -- The first may happen if the usage flags of an algorithm do not match the allowed usage. When writing a backsig this would lead to a log_bug in libgcrypt due to the use of a regular MPI as opaque data. The second may happen with all kind of invalid data. It is easy to avoid an abort, though. Signed-off-by: Werner Koch <[email protected]>
* g10: Allow User ID length >= 256.NIIBE Yutaka2016-06-011-1/+1
| | | | | | | | | | * build-packet.c (do_user_id): Call write_header2 with HDRLEN not set. -- Reported-by: Daniel Kahn Gillmor <[email protected]> GnuPG-bug-id: 2374 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: New status code NOTATION_FLAGS.Werner Koch2016-05-313-5/+16
| | | | | | | | * common/status.h (STATUS_NOTATION_FLAGS: New. * g10/packet.h (struct notation): Add flags.human. (notation_t): New typedef. * g10/build-packet.c (sig_to_notation): Set flags.human. * g10/keylist.c (show_notation): Write STATUS_NOTATION_FLAGS.
* gpg: Keep current and total of PROGESS status lines small enough.Werner Koch2016-05-271-15/+45
| | | | | | | | | * g10/progress.c (progress_filter): Factor status wrote out to... (write_status_progress): New. Scale values down. -- GnuPG-bug-id: 2368 Signed-off-by: Werner Koch <[email protected]>
* gpg, w32: Fix build regression.Werner Koch2016-05-241-0/+2
| | | | | | -- Fixes-commit: 754b1c463034a634a678d8efc76c27fd46aad9b9
* g10: Fix typo in comment.Daniel Kahn Gillmor2016-05-231-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* gpg: Speed up key listing in Tofu mode.Werner Koch2016-05-211-50/+18
| | | | | | | | | | | | | | | | | | * g10/tofu.c (get_trust): Add arg PK. Uses this instead of a an extra lookup of the public key by fingerrpint. (tofu_register): Pass PK to get_trust. (tofu_get_validity): Ditto. *g10/tofu.c (tofu_register): Remove unused FINGERPRINT_PP. -- With my test keybox I see a speedup of 10 times (33s to 3.1s). The reason for this was the extra key lookup which I hacked in at some point to make the extraction of a keyid correct also for non v4 keys. However our caller already has the public key and thus can easily pass it to get_trust along with the fingerprint. Signed-off-by: Werner Koch <[email protected]>
* gpg: Avoid name spaces clash with future sqlite versions.Werner Koch2016-05-215-97/+96
| | | | | | | | | | | | | | * g10/sqlite.c: Rename to gpgsql.c. Change function prefixes to gpgsql_. * g10/sqlite.h: Rename to gpgsql.h. * g10/tofu.c: Adjust for changes. -- We used for our own extensions symbols with an sqlite_ names prefix. This may in theory lead to duplicated symbols but more important, it is harder to understand what is from gpg and what is from libsqlite. Signed-off-by: Werner Koch <[email protected]>
* gpg: Explicitly close a combined Tofu DB.Werner Koch2016-05-211-3/+8
| | | | * g10/tofu.c (tofu_closedbs): Close combined DB.
* gpg: Remove debug output accidently introduced with 027c4e5.Werner Koch2016-05-211-3/+0
| | | | | | | -- Fixes-commit: 027c4e55522b8e18711a3331932a9869ab89ca26 Signed-off-by: Werner Koch <[email protected]>
* gpg: Store the Tofu meta handle for databases in CTRL.Werner Koch2016-05-219-47/+70
| | | | | | | | | | | | | | | | | | * g10/gpg.h (struct tofu_dbs_s, tofu_dbs_t): New declarations. (struct server_control_s): Add field tofu.dbs. * g10/tofu.c (struct dbs): Rename to tofu_dbs_s. Replace all users by by tofu_dbs_t. (opendbs): Add arg CTRL. Cache the DBS in CTRL. (closedbs): Rename to tofu_closedbs and make global. Add arg CTRL. (tofu_register): Add arg CTRL. Change all callers. Do not call closedbs. (tofu_get_validity): Ditto. (tofu_set_policy): Ditto. (tofu_get_policy): Ditto. (tofu_set_policy_by_keyid): Add arg CTRL. * g10/gpg.c (gpg_deinit_default_ctrl): Call tofu_closedbs. Signed-off-by: Werner Koch <[email protected]>
* gpg: Pass CTRL object down to the trust functionsWerner Koch2016-05-2116-152/+180
| | | | Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix the TOFU_STATS_LONG status.Werner Koch2016-05-211-4/+7
| | | | | | | | | | | * g10/tofu.c (show_statistics): Print TOFU STATS with formatting characters. -- We better leave the non-breaking space character in the status messages so that the caller can make use of them. Signed-off-by: Werner Koch <[email protected]>
* gpg: Print "[ never ]" instead of err for validity.Werner Koch2016-05-191-0/+1
| | | | | | * g10/trust.c (uid_trust_string_fixed): Handle NEVER. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add --weak-digest to gpgv's help screen.Werner Koch2016-05-181-1/+2
| | | | | | -- Suggested-by: Daniel Kahn Gillmor
* gpg: Emit new status line KEY_CONSIDERED.Werner Koch2016-05-171-82/+138
| | | | | | | | | | | | | * common/status.h (STATUS_KEY_CONSIDERED): New. * g10/getkey.c: Include status.h. (LOOKUP_NOT_SELECTED, LOOKUP_ALL_SUBKEYS_EXPIRED): New. (finish_lookup): Add arg R_FLAGS. Count expired and revoked keys and set flag. Check a requested usage before checking for expiraion or revocation. (print_status_key_considered): New. (lookup): Print new status. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix signature checking.NIIBE Yutaka2016-05-111-4/+9
| | | | | | | | | | | | * g10/sig-check.c (check_signature_over_key_or_uid): Fix call to walk_kbnode. -- Thanks to Vincent Brillault (Feandil). GnuPG-bug-id: 2351 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Allow unattended deletion of secret keys.Werner Koch2016-05-103-5/+14
| | | | | | | | | | | | | | | * agent/command.c (cmd_delete_key): Make the --force option depend on --disallow-loopback-passphrase. * g10/call-agent.c (agent_delete_key): Add arg FORCE. * g10/delkey.c (do_delete_key): Pass opt.answer_yes to agent_delete_key. -- Unless the agent has been configured with --disallow-loopback-passpharse an unattended deletion of a secret key is now possible with gpg by using --batch _and_ --yes. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix buglet in the check_all_keysigs function.Werner Koch2016-05-091-2/+3
| | | | | | | | | | | | | | | * g10/keyedit.c (sig_comparison): Actually compare the pubkey algorithms. -- This fixes two bugs: The first was a typo which led to us comparing A with A. The second problem was the use of an assert at a place where this can't be asserted: Two signature may have different algorithms; they won't verify but after all it is about corrupted signatures. Reported-by: Guilhem Moulin <[email protected]> GnuPG-bug-id: 2236 Signed-off-by: Werner Koch <[email protected]>
* gpg: Request a "save" after cmd "check" fixed something.Werner Koch2016-05-091-2/+3
| | | | | | | | | * g10/keyedit.c (keyedit_menu) <cmdCHECK>: Set modified. -- Reported-by: Guilhem Moulin <[email protected]> GnuPG-bug-id: 2236 Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix const char pointer mismatch with gettext.Werner Koch2016-05-041-3/+4
| | | | | | * g10/tofu.c (get_trust): Use const char *. Signed-off-by: Werner Koch <[email protected]>