aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyedit.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* gpg: Print more info with "check selfsig".Werner Koch2015-10-011-0/+17
| | | | | * g10/keyedit.c (print_and_check_one_sig): Print more Some sigsub packets.
* gpg: Add debug helper to --edit-keys's check sub-command.Werner Koch2015-10-011-15/+35
| | | | | | | | | | | | | * g10/keyedit.c (print_and_check_one_sig): Add arg "extended" and print an asterisk for the chosen selfsig. (check_all_keysigs): Add arg "only_selfsig" (keyedit_menu) <cmdCHECK>: Add optional arg "selfsig". -- Using "check selfsig" prints only the self-signatures and indicates the chosen selfsig with an asterisk. Signed-off-by: Werner Koch <[email protected]>
* gpg: Change last commit to avoid extra translations.Werner Koch2015-09-161-4/+20
| | | | | | | * g10/keyedit.c (keyedit_menu): Do not print usage hints in expert mode. Signed-off-by: Werner Koch <[email protected]>
* g10: Improve error message.Neal H. Walfield2015-09-161-4/+4
| | | | | | | | * g10/keyedit.c (keyedit_menu): When complaining that a user ID or key must be selected, indicate what command to use to do this. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* gpg: Emit ERROR status for key signing failures.Werner Koch2015-08-251-0/+7
| | | | | | | | | | | | * g10/keyedit.c (sign_uids): Write an ERROR status for a signing failure. (menu_adduid, menu_addrevoker, menu_revsig): Ditto. (menu_revuid, menu_revkey, menu_revsubkey): Ditto. -- This change helps GPA to show better error messages. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add commands "fpr *" and "grip" to --edit-key.Werner Koch2015-08-061-5/+64
| | | | | | | | | | | | | * g10/keyedit.c (cmdGRIP): New. (cmds): Add command "grip". (keyedit_menu) <cmdFPR>: Print subkeys with argument "*". (keyedit_menu) <cmdGRIP>: Print keygrip. (show_key_and_fingerprint): Add arg "with_subkeys". (show_key_and_grip): New. * g10/keylist.c (print_fingerprint): Add mode 4. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Indicate secret keys and cards in a key-edit listing.Werner Koch2015-07-291-25/+77
| | | | | | | | | | | | | | | | | * g10/keyedit.c (sign_uids): Add arg "ctrl". (show_key_with_all_names_colon): Ditto. (show_key_with_all_names): Ditto. * g10/keyedit.c (show_key_with_all_names): Print key record indicators by checking with gpg-agent. (show_key_with_all_names): Ditto. May now also print sec/sbb. -- This also fixes a problem in the --with-colons mode. Before this patch the --with-colons output of --edit-key always showed pub/sub regardless of the old toogle state. Now it also prints sec/sbb. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove the edit-key toggle command.Werner Koch2015-07-281-13/+2
| | | | | | | | | | | | | | * g10/keyedit.c (cmds): Remove helptext from "toggle". (keyedit_menu): Remove "toggle" var and remove the sub/pub check against toggle. -- Because it is now easily possible to have only secret keys for some of the main/subkeys the current check on whether any secret is available is not really useful. A finer grained check should eventually be implemented. Signed-off-by: Werner Koch <[email protected]>
* gpg: New command --quick-adduid.Werner Koch2015-05-081-11/+109
| | | | | | | | | | | | | | | * g10/keygen.c (ask_user_id): Factor some code out to ... (uid_already_in_keyblock): new. (generate_user_id): Add arg UIDSTR. Fix leaked P. * g10/keyedit.c (menu_adduid): Add new arg uidstring. Adjust caller. (keyedit_quick_adduid): New. * g10/gpg.c (aQuickAddUid): New. (opts): Add command --quick-adduid. (main): Implement that. -- GnuPG-bug-id: 1956 Signed-off-by: Werner Koch <[email protected]>
* gpg: Minor code merging in keyedit.Werner Koch2015-05-081-17/+26
| | | | | | | | | | | * g10/keyedit.c (fix_keyblock): Rename to fix_key_signature_order. (fix_keyblock): New. Call fix_key_signature_order and other fix functions. (keyedit_menu): Factor code out to new fix_keyblock. (keyedit_quick_sign): Ditto. Check for primary fpr before calling fix_keyblock. Signed-off-by: Werner Koch <[email protected]>
* common: Rename log and gcc attribute macros (jnlib merge).Werner Koch2015-04-241-1/+1
| | | | | | | | | | | * common/logging.h: Rename JNLIB_LOG_* to GPGRT_LOG_*. * common/mischelp.h: Rename JNLIB_GCC_* to GPGRT_GCC_*. -- JNLIB has no more meaning. Thus we switch to a GPGRT_ prefix in anticipation that some code may eventually be moved to libgpg-error. Signed-off-by: Werner Koch <[email protected]>
* common: Remove two JNLIB_ macros (jnlib merge).Werner Koch2015-04-241-1/+0
| | | | | | | | | | * configure.ac: Merge seperate jnlib checks. (HAVE_JNLIB_LOGGING): Remove. * common/logging.c, common/simple-pwquery.c (JNLIB_NEED_AFLOCAL): Rename to GNUPG_COMMON_NEED_AFLOCAL. Change all tests. -- Signed-off-by: Werner Koch <[email protected]>
* g10: Fix keytocard.NIIBE Yutaka2015-04-031-5/+16
| | | | | | | | | | | | | | | | g10/call-agent.h (agent_scd_learn): Add FORCE option. g10/call-agent.c (agent_scd_learn): Implement FORCE option. g10/keygen.c (gen_card_key): Follow the change of option. g10/card-util.c (change_pin, card_status, factory_reset): Likewise. g10/keyedit.c (keyedit_menu): Update private key storage by agent_scd_learn. -- This is not a perfect solution since there is a possibility user unplug card before quitting 'gpg --keyedit' session. Usually, it works well. GnuPG-bug-id: 1846
* gpg: Replace remaining uses of stdio by estream.Werner Koch2015-02-191-10/+10
| | | | | | | | | | | | | | | | | | | | | | | * g10/sign.c (sign_file): Use log_printf instead of stderr. * g10/tdbdump.c (export_ownertrust): Use estream fucntions. (import_ownertrust): Ditto. * g10/tdbio.c (tdbio_dump_record): Ditto. Change arg to estream_t. -- Reported-by: Guilhem Moulin <[email protected]> Needed for unattended key edits with --status-fd, because since 2.1 status prompts are preceded by es_fflush (in cpr.c:do_get_from_fd) not fflush(3), so the standard output may not be flushed before each prompt. (Which breaks scripts using select(2) to multiplex between the standard and status outputs.) His patch only affected print_and_check_one_sig_colon() but there are many more places where stdio and estream are mixed. This patch now replaces most of them in g10/. At some places stdio is still used, but that is local to a function and should not have side effects. Signed-off-by: Werner Koch <[email protected]>
* gpg: Replace remaining old error code macros by GPG_ERR_.Werner Koch2015-01-221-27/+29
| | | | | | | | | * g10/gpg.h (g10_errstr): Remove macro and change all occurrences by gpg_strerror. (G10ERR_): Remove all macros and change all occurrences by their GPG_ERR_ counterparts. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove unused args from a function.Werner Koch2015-01-051-1/+1
| | | | | | | * g10/keyserver.c (parse_keyserver_uri): Remove args configname and configlineno. Change all callers. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove all support for v3 keys and always create v4-signatures.Werner Koch2014-10-171-28/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/build-packet.c (do_key): Remove support for building v3 keys. * g10/parse-packet.c (read_protected_v3_mpi): Remove. (parse_key): Remove support for v3-keys. Add dedicated warnings for v3-key packets. * g10/keyid.c (hash_public_key): Remove v3-key support. (keyid_from_pk): Ditto. (fingerprint_from_pk): Ditto. * g10/options.h (opt): Remove fields force_v3_sigs and force_v4_certs. * g10/gpg.c (cmd_and_opt_values): Remove oForceV3Sigs, oNoForceV3Sigs, oForceV4Certs, oNoForceV4Certs. (opts): Turn --force-v3-sigs, --no-force-v3-sigs, --force-v4-certs, --no-force-v4-certs int dummy options. (main): Remove setting of the force_v3_sigs force_v4_certs flags. * g10/revoke.c (gen_revoke, create_revocation): Always create v4 certs. * g10/sign.c (hash_uid): Remove support for v3-signatures (hash_sigversion_to_magic): Ditto. (only_old_style): Remove this v3-key function. (write_signature_packets): Remove support for creating v3-signatures. (sign_file): Ditto. (sign_symencrypt_file): Ditto. (clearsign_file): Ditto. Remove code to emit no Hash armor line if only v3-keys are used. (make_keysig_packet): Remove arg SIGVERSION and force using v4-signatures. Change all callers to not pass a value for this arg. Remove all v3-key related code. (update_keysig_packet): Remove v3-signature support. * g10/keyedit.c (sign_uids): Always create v4-signatures. * g10/textfilter.c (copy_clearsig_text): Remove arg pgp2mode and change caller. -- v3 keys are deprecated for about 15 years and due the severe weaknesses of MD5 it does not make any sense to keep code around to use these old and broken keys. Users who need to decrypt old messages should use gpg 1.4 and best re-encrypt them to modern standards. verification of old (i.e. PGP2) created signatures is thus also not anymore possible but such signatures have no values anyway - MD5 is just too broken. We have also kept support for v3 signatures until now. With the removal of support for v3 keys it is questionable whether it makes any sense to keep support for v3-signatures. What we do now is to keep support for verification of v3-signatures but we force the use of v4-signatures. The latter makes the --pgp6 and --pgp7 switch a bit obsolete because those PGP versions require v3-signatures for messages. These versions of PGP are also really old and not anymore maintained so they have not received any bug fixes and should not be used anyway. Signed-off-by: Werner Koch <[email protected]>
* gpg: Print a warning if the subkey expiration may not be what you want.Werner Koch2014-09-171-0/+63
| | | | | | | | | | * g10/keyedit.c (subkey_expire_warning): New. (keyedit_menu): Call it when needed. -- GnuPG-bug-id: 1715 The heuristic to detect a problem is not very advanced but it should catch the most common cases.
* gpg: Remove options --pgp2 and --rfc1991.Werner Koch2014-08-141-37/+1
| | | | | | | | | | | | | | * g10/gpg.c (oRFC1991, oPGP2): Remove (opts): Remove --pgp2 and --rfc1991. * g10/options.h (CO_PGP2, CO_RFC1991): Remove. Remove all users. (RFC2440, PGP2): Remove. Remove all code only enabled by these conditions. * tests/openpgp/clearsig.test: Remove --rfc1991 test. -- The use of PGP 2.c is considered insecure for quite some time now (e.g. due to the use of MD5). Thus we remove all support for _creating_ PGP 2 compatible messages.
* gpg: Add list-option "show-usage".Werner Koch2014-08-131-1/+1
| | | | | | | * g10/gpg.c (parse_list_options): Add "show-usage". * g10/options.h (LIST_SHOW_USAGE): New. * g10/keyid.c (usagestr_from_pk): Add arg FILL. Change caller. * g10/keylist.c (list_keyblock_print): Print usage info.
* gpg: Make --quick-sign-key promote local key signatures.Werner Koch2014-07-231-3/+1
| | | | * g10/keyedit.c (sign_uids): Promote local sigs in quick mode.
* Make more use of *_NAME macros.Werner Koch2014-05-081-1/+1
| | | | | | | | | * configure.ac (GPG_DISP_NAME, GPGSM_DISP_NAME): New. (GPG_AGENT_DISP_NAME, SCDAEMON_DISP_NAME): New. (DIRMNGR_DISP_NAME, G13_DISP_NAME): New. (GPGCONF_DISP_NAME): New. (SCDAEMON_SOCK_NAME): New. * common/argparse.c (show_help): Map description string.
* gpg: Change pinentry prompt to talk about "secret key".Werner Koch2014-04-151-1/+1
| | | | | | | | | * g10/passphrase.c (gpg_format_keydesc): Add mode 2. Change strings. * g10/keydb.h (FORMAT_KEYDESC_NORMAL, FORMAT_KEYDESC_IMPORT) (FORMAT_KEYDESC_EXPORT): New. Use them for clarity. -- The use of the term "certificate" was more confusing than helpful.
* gpg: Add commands --quick-sign-key and --quick-lsign-key.Werner Koch2014-03-271-101/+279
| | | | | | | | * g10/gpg.c (main): Add commands --quick-sign-key and --quick-lsign-key. * g10/keyedit.c (sign_uids): Add args FP and QUICK. (keyedit_quick_sign): New. (show_key_with_all_names): Add arg NOWARN.
* Change some keyedit functions to allow printing to arbitrary streams.Werner Koch2014-03-271-115/+130
| | | | | | | | | | | * common/ttyio.c (tty_print_string): Add optional arg FP. Change all callers. (tty_print_utf8_string2): Ditto. * g10/keyedit.c (show_prefs): Ditto. (show_key_with_all_names_colon): Ditto. (show_names): Ditto. * g10/keylist.c (print_revokers): Ditto. (print_fingerprint): Ditto.
* gpg: Print a "not found" message for an unknown key in --key-edit.Werner Koch2014-03-071-1/+4
| | | | | | | | | | | | * g10/keyedit.c (keyedit_menu): Print message. -- GnuPG-bug-id: 1420 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 0bf54e60d31389812d05c3fd29bece876204561d) Resolved conflicts: g10/keyedit.c: Fix white spaces
* gpg: Allow building without any trust model support.Werner Koch2014-02-101-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Add option --disable-trust-models (NO_TRUST_MODELS): New ac_define and am_conditional. * g10/Makefile.am (trust_source): New. (gpg2_SOURCES): Factor some files out to above. Add trust.c. * g10/gpg.c [NO_TRUST_MODELS]: Disable options --export-ownertrust, --import-ownertrust, --update-trustdb, --check-trustdb, --fix-trustdb, --list-trustdb, --trustdb-name, --auto-check-trustdb, --no-auto-check-trustdb, and --force-ownertrust. (parse_trust_model) [NO_TRUST_MODELS]: Do not build. (main) [NO_TRUST_MODELS]: Set trust_model to always and exclude all trustdb related option code. * g10/keyedit.c (cmds) [NO_TRUST_MODELS]: Remove menu items "trust", "enable", and "disable". * g10/keylist.c (public_key_list) [NO_TRUST_MODELS]: Do not print "tru" record. * g10/trust.c: New. * g10/trustdb.c (struct key_item): Move to trustdb.h. (register_trusted_keyid): Rename to tdb_register_trusted_keyid. (register_trusted_key): Rename to tdb_register_trusted_key. (trust_letter, uid_trust_string_fixed, trust_value_to_string) (string_to_trust_value, get_ownertrust_with_min, get_ownertrust_info) (get_ownertrust_string, get_validity_info, get_validity_string) (clean_sigs_from_uid, clean_uid_from_key, clean_key): Move to trust.c. (mark_usable_uid_certs): Move to trust.c and make global. (is_in_klist): Move as inline to trustdb.h. (trustdb_check_or_update): Rename to tdb_check_or_update (revalidation_mark): Rename to tdb_revalidation_mark. (get_ownertrust): Rename to tdb_get_ownertrust. (get_min_ownertrust): Rename to tdb_get_min_ownertrust. (update_ownertrust): Rename to tdb_update_ownertrust. (clear_ownertrusts): Rename to tdb_clear_ownertrusts. (cache_disabled_value): Rename to tdb_cache_disabled_value. (check_trustdb_stale): Rename to tdb_check_trustdb_stale. (get_validity): Rename to tdb_get_validity_core, add arg MAIN_PK and factor some code out to ... * trust.c (get_validity): ...new. (check_or_update_trustdb): New wrapper. (revalidation_mark): New wrapper. (get_ownertrust): New wrapper. (get_ownertrust_with_min): New wrapper. (update_ownertrust): New wrapper. (clear_ownertrusts): New wrapper. (cache_disabled_value): New wrapper. (check_trustdb_stale): New wrapper. * tests/openpgp/defs.inc (opt_always): New. Use in all tests instead of --always-trust.
* gpg: Change format for the key size in --list-key and --edit-key.Werner Koch2014-02-051-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oLegacyListMode, opts, main): Add --legacy-list-mode. * g10/options.h (struct opt): Add field legacy_list_mode. * g10/keydb.h (PUBKEY_STRING_SIZE): New. * g10/keyid.c (pubkey_string): New. * g10/import.c (import_one, import_secret_one): Use pubkey_string. * g10/keylist.c (print_seckey_info): Ditto. (print_pubkey_info, print_card_key_info): Ditto. (list_keyblock_print): Ditto. * g10/mainproc.c (list_node): Ditto. * g10/pkclist.c (do_edit_ownertrust, build_pk_list): Ditto. * g10/keyedit.c (show_key_with_all_names): Ditto. Also change the format. (show_basic_key_info): Ditto. * common/openpgp-oid.c (openpgp_curve_to_oid): Also allow "ed25519". (openpgp_oid_to_curve): Downcase "ed25519" -- For ECC it seems to be better to show the name of the curve and not just the size of the prime field. The curve name does not anymore fit into the "<size><letter>" descriptor (e.g. "2048R") and a fixed length format does not work either. Thus the new format uses "rsa2048" - RSA with 2048 bit "elg1024" - Elgamal with 1024 bit "ed25519" - ECC using the curve Ed25519. "E_1.2.3.4" - ECC using the unsupported curve with OID "1.2.3.4". unless --legacy-list-mode is given. In does not anymore line up nicely in columns thus I expect further changes to this new format. Signed-off-by: Werner Koch <[email protected]>
* Change all quotes in strings and comments to the new GNU standard.Werner Koch2012-06-051-7/+7
| | | | | | | | | | | | | | | | | | | The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
* Allow creating subkeys using an existing keyWerner Koch2011-11-061-1/+1
| | | | | | This works by specifying the keygrip instead of an algorithm (section number 13) and requires that the option -expert has been used. It will be easy to extend this to the primary key.
* Allow NULL for free_public_key.Werner Koch2011-09-201-7/+3
|
* Fixed set but unused variable bugsWerner Koch2011-08-101-2/+0
|
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-26/+26
| | | | | | | | We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
* Smartcard related updatesWerner Koch2010-11-171-48/+19
|
* Re-implemented GPG's --passwd command and improved it.Werner Koch2010-10-261-206/+76
|
* Make public key data structure easier to read.Werner Koch2010-10-201-8/+8
| | | | | Check vor v1 card while signing.
* More agent support for gpg.Werner Koch2010-10-131-1/+1
|
* Exporting secret keys via gpg-agent is now basically supported.Werner Koch2010-10-011-10/+10
| | | | | | A couple of forward ported changes. Doc updates.
* Removed more secret key related code.Werner Koch2010-09-061-55/+39
| | | | | | It builds fine and passes some of the tests but there are quite some features which don't work yet.
* Even less prompts for a new key now.Werner Koch2010-09-011-9/+12
|
* Decryption and signi via agent is now implemented.Werner Koch2010-04-231-8/+9
|
* More changes on the way to remove secring.gpg.Werner Koch2010-04-211-623/+327
|
* ReindentedWerner Koch2010-04-201-3637/+3833
|
* Generating an OpenPGP key cia gpg-agent basically works.Werner Koch2010-04-201-12/+17
|
* Use gpg_err_set_errno to assign values to ERRNO.Werner Koch2010-04-011-1/+1
|
* Finished the bulk of changes to use estream in most places instead ofWerner Koch2010-03-151-10/+13
| | | | | stdio.
* Use macros for iobuf ioctls. Werner Koch2010-03-081-1/+1
|
* Various changes to eventually support openpgp keys in pgp-agent.Werner Koch2010-02-021-24/+81
| | | | | | Comment fixes. Minor chnages in preparation of a W32CE port.
* Add dummu option --passwd for gpg.Werner Koch2010-01-081-1/+14
| | | | | Collected changes.
* More stuff for the audit-log.Werner Koch2009-12-021-8/+35
|