aboutsummaryrefslogtreecommitdiffstats
path: root/g10/delkey.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-11-11gpg: Fix the previous commit.NIIBE Yutaka1-1/+3
* g10/delkey.c (do_delete_key): Fix the condition for the error. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-11-10gpg: In batch mode, delete-secret-key is not okay without --yes.NIIBE Yutaka1-1/+6
* g10/delkey.c (do_delete_key): Emit an error when not --yes. -- GnuPG-bug-id: 4667 Signed-off-by: NIIBE Yutaka <[email protected]>
2020-01-17gpg: Prepare enhancement of agent_probe_secret_key.NIIBE Yutaka1-1/+1
* 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]>
2019-11-06gpg: Remove an unused variable.Werner Koch1-2/+0
* g10/delkey.c (do_delete_key): here. Signed-off-by: Werner Koch <[email protected]>
2019-10-15gpg: Also delete key-binding signature when deleting a subkey.Werner Koch1-14/+7
* g10/delkey.c (do_delete_key): Simplify and correct subkey deletion. -- GnuPG-bug-id: 4665, 4457 Fixes-commit: cc6069ac6ecd57dcbb808f28d54fd9f89dc55014 Signed-off-by: Werner Koch <[email protected]>
2019-09-09gpg: New option --use-keyboxd.Werner Koch1-3/+3
* g10/gpg.c (oUseKeyboxd,oKeyboxdProgram): New consts. (opts): New options --use-keyboxd and --keyboxd-program. (main): Implement them. * g10/keydb.c: Move some defs out to ... * g10/keydb-private.h: new file. * g10/keydb.c: prefix function names with "internal" and move original functions to ... * g10/call-keyboxd.c: new file. Divert to the internal fucntion if --use-keyboxd is used. Add a CTRL arg to most fucntions and change all callers. * g10/Makefile.am (common_source): Add new files. (noinst_PROGRAMS): Do bot build gpgcompose. -- Note that this is just the framework with only a basic implementation of searching via keyboxd. Signed-off-by: Werner Koch <[email protected]>
2019-05-27gpg: Allow deletion of subkeys with --delete-[secret-]key.Werner Koch1-7/+97
* common/userids.c (classify_user_id): Do not set the EXACT flag in the default case. * g10/export.c (exact_subkey_match_p): Make static, * g10/delkey.c (do_delete_key): Implement subkey only deleting. -- GnuPG-bug-id: 4457
2019-05-21gpg: Unify the the use of the print_pubkey_info functions.Werner Koch1-4/+1
* g10/keylist.c (format_seckey_info): Remove. (print_pubkey_info, print_seckey_info): Remove. (format_key_info): New. (print_key_info): New. (print_key_info_log): New. * g10/card-util.c (current_card_status): Use print_key_info and remove the useless condition on KEYBLOCK. * g10/delkey.c (do_delete_key): Replace print_pubkey_info and print_seckey_info by print_key_info. * g10/keyedit.c (menu_addrevoker): Replace print_pubkey_info by print_key_info. * g10/pkclist.c (do_we_trust_pre): Ditto. * g10/revoke.c (gen_desig_revoke): Ditto. (gen_revoke): Ditto. Also use print_key_info_log instead of separate functions. Signed-off-by: Werner Koch <[email protected]>
2019-05-20gpg: Do not delete any keys if --dry-run is passed.Werner Koch1-3/+3
* g10/delkey.c (do_delete_key): Don't delete the keyblock on dry runs. Do not clear the ownertrust. Do not let the agent delete the key. -- Co-authored-by: Matheus Afonso Martins Moreira Signed-off-by: Werner Koch <[email protected]>
2019-03-14kbx: Unify the fingerprint search modes.Werner Koch1-4/+1
* kbx/keybox-search-desc.h (KEYDB_SEARCH_MODE_FPR16) (KEYDB_SEARCH_MODE_FPR20, KEYDB_SEARCH_MODE_FPR32): Remove. Switch all users to KEYDB_SEARCH_MODE_FPR along with the fprlen value. -- These search modes were added over time and there has until recently be no incentive to remove the cruft. With the change for v5 keys I finally went over all places and allowed the generic fingerprint mode along with a given length of the fingerprint at all places. Consequently the other modes can now be removed. Signed-off-by: Werner Koch <[email protected]>
2019-03-14kbx: Add support for 32 byte fingerprints.Werner Koch1-1/+2
* common/userids.c (classify_user_id): Support 32 byte fingerprints. * kbx/keybox-search-desc.h (KEYDB_SEARCH_MODE_FPR32): New. (struct keydb_search_desc): Add field fprlen. * kbx/keybox-defs.h (struct _keybox_openpgp_key_info): Add field version and increase size of fpr to 32. * kbx/keybox-blob.c: Define new version 2 for PGP and X509 blobs. (struct keyboxblob_key): Add field fprlen and increase size of fpr. (pgp_create_key_part_single): Allow larger fingerprints. (create_blob_header): Implement blob version 2 and add arg want_fpr32. (_keybox_create_openpgp_blob): Detect the need for blob version 2. * kbx/keybox-search.c (blob_get_first_keyid): Support 32 byte fingerprints. (blob_cmp_fpr): Ditto. (blob_cmp_fpr_part): Ditto. (has_fingerprint): Add arg fprlen and pass on. (keybox_search): Support KEYDB_SEARCH_MODE_FPR32 and adjust for changed has_fingerprint. * kbx/keybox-openpgp.c (parse_key): Support version 5 keys. * kbx/keybox-dump.c (_keybox_dump_blob): Support blob version 2. * g10/delkey.c (do_delete_key): Support KEYDB_SEARCH_MODE_FPR32. * g10/export.c (exact_subkey_match_p): Ditto. * g10/gpg.c (main): Ditto. * g10/getkey.c (get_pubkey_byfprint): Adjust for changed KEYDB_SEARCH_MODE_FPR. * g10/keydb.c (keydb_search_desc_dump): Support KEYDB_SEARCH_MODE_FPR32 and adjust for changed KEYDB_SEARCH_MODE_FPR. (keydb_search): Add new arg fprlen and change all callers. * g10/keyedit.c (find_by_primary_fpr): Ditto. * g10/keyid.c (keystr_from_desc): Ditto. * g10/keyring.c (keyring_search): Ditto. * g10/keyserver.c (print_keyrec): Ditto. (parse_keyrec): Ditto. (keyserver_export): Ditto. (keyserver_retrieval_screener): Ditto. (keyserver_import): Ditto. (keyserver_import_fprint): Ditto. (keyidlist): Ditto. (keyserver_get_chunk): Ditto. * g10/keydb.c (keydb_search): Add new arg fprlen and change all callers. * sm/keydb.c (keydb_search_fpr): Adjust for changed KEYDB_SEARCH_MODE_FPR. -- This prepares the support for OpenPGP v5 keys. The new version 2 blob format is needed for the longer fingerprints and we also use this opportunity to prepare for storing the keygrip in the blob for faster lookup by keygrip. Right now this is not yet functional. Signed-off-by: Werner Koch <[email protected]>
2017-03-31gpg: Pass CTRL to many more functions.Werner Koch1-9/+11
-- For proper operations as a server we need to avoid global variables. Thus we need to pass the session state CTRL to most functions. Quite a lot of changes but fortunately straightforward to do. Signed-off-by: Werner Koch <[email protected]>
2017-03-07Remove -I option to common.NIIBE Yutaka1-6/+5
* dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-05-10gpg: Allow unattended deletion of secret keys.Werner Koch1-1/+7
* 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]>
2016-04-29gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch1-1/+0
Signed-off-by: Werner Koch <[email protected]>
2015-12-04gpg: Write ERROR status on delete-key cancellationDaiki Ueno1-1/+4
* g10/delkey.c (do_delete_key): Write ERROR status code with the error location "delete_key.secret", when the user cancelled the operation on Pinentry. -- I changed the original patch to emit the full gpg_error_t code. -wk
2015-12-03gpg: Add variant of 'key "%s" not found: %s' error message.Werner Koch1-1/+1
* g10/gpg.c (check_user_ids): Change error message. * g10/delkey.c (do_delete_key): Ditto. Signed-off-by: Werner Koch <[email protected]>
2015-12-03gpg: Take care of keydb_new returning NULL.Werner Koch1-0/+2
* g10/keydb.c (keydb_new): Print an error message if needed. Also use xtrycalloc because we return an error anyway. * g10/delkey.c (do_delete_key): Handle error retruned by keydb_new. * g10/export.c (do_export_stream): Ditto. * g10/getkey.c (get_pubkey): Ditto. (get_pubkey_fast): Ditto. (get_pubkeyblock): Ditto. (get_seckey): Ditto. (key_byname): Ditto. (get_pubkey_byfprint): Ditto. (get_pubkey_byfprint_fast): Ditto. (parse_def_secret_key): Ditto. (have_secret_key_with_kid): Ditto. * g10/import.c (import_one): Ditto. (import_revoke_cert): Ditto. * g10/keyedit.c (keyedit_quick_adduid): Ditto. * g10/keygen.c (quick_generate_keypair): Ditto. (do_generate_keypair): Ditto. * g10/trustdb.c (validate_keys): Ditto. * g10/keyserver.c (keyidlist): Ditto. * g10/revoke.c (gen_desig_revoke): Ditto. (gen_revoke): Ditto. * g10/gpg.c (check_user_ids): Ditto. (main): Do not print an error message for keydb_new error. * g10/keylist.c (list_all): Use actual error code returned by keydb_new. * g10/t-keydb-get-keyblock.c (do_test): Abort on keydb_new error. * g10/t-keydb.c (do_test): Ditto. * g10/keyring.c (keyring_new): Actually return an error so that the existing keydb_new error checking makes sense for a keyring resource. (keyring_rebuild_cache): Take care of keyring_new returning an error. -- Commit 04a6b903 changed keydb_new to return an error. However the error was not checked at most places which we fix with this patch. To make things easier keydb_new prints an error message itself. Signed-off-by: Werner Koch <[email protected]>
2014-09-20gpg: --delete-secret-key - check that a secret key exists.Werner Koch1-0/+9
* g10/delkey.c (do_delete_key): Check availibility of a secret key. -- Actually we check that at least one secret subkey exists.
2014-04-15gpg: Re-enable secret key deletion.Werner Koch1-4/+43
* g10/call-agent.c (agent_delete_key): New. * g10/keydb.h (FORMAT_KEYDESC_DELKEY): New. * g10/passphrase.c (gpg_format_keydesc): Support new format. * g10/delkey.c (do_delete_key): Add secret key deletion.
2014-04-15gpg: Re-indent a file.Werner Koch1-132/+151
* g10/delkey.c: Re-indent. (do_delete_key, delete_keys): Change return type top gpg_error_t.
2013-01-08gpg: Remove a function wrapper.Werner Koch1-1/+1
* g10/keydb.h (keydb_search): Remove macro. * g10/keydb.c (keydb_search2): Rename to keydb_search. Change all callers.
2011-04-29Give sensible error messages when trying to delete secret key.Marcus Brinkmann1-11/+20
2011-04-25Fix regression in gpg's mail address parsing.Werner Koch1-1/+1
Since 2009-12-08 gpg was not able to find email addresses indicated by a leading '<'. This happened when I merged the user id classification code of gpgsm and gpg.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-2/+2
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.
2010-09-06Removed more secret key related code.Werner Koch1-24/+14
It builds fine and passes some of the tests but there are quite some features which don't work yet.
2010-04-21More changes on the way to remove secring.gpg.Werner Koch1-5/+2
2009-12-08Unification of the search descriptor usage.Werner Koch1-3/+4
2007-11-19Started to implement the audit log feature.Werner Koch1-1/+1
Pass PINENTRY_USER_DATA and XAUTHORITY to Pinentry. Improved support for the quality bar. Minor internal restructuring. Translation fixes.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2006-10-02Fix for bug 537Werner Koch1-1/+1
2006-04-19Merged with gpg 1.4.3 code. Werner Koch1-34/+46
The gpg part does not yet build.
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2005-03-10* delkey.c (do_delete_key, delete_keys): Fix problem with --expertDavid Shaw1-22/+32
preventing --delete-secret-and-public-keys from deleting secret keys.
2004-10-28* card-util.c, delkey.c, keygen.c, plaintext.c, keyedit.c, passphrase.c,David Shaw1-2/+2
revoke.c: Collapse the two different "can't do that in batch mode" strings into one.
2004-10-28* delkey.c, export.c, keyedit.c, pkclist.c, revoke.c, skclist.c: Fix a fewDavid Shaw1-1/+1
missed possible \"username\" quotes.
2004-10-10* card-util.c, keyedit.c, openfile.c, pkclist.c, delkey.c, keygen.c,David Shaw1-2/+2
photoid.c, revoke.c: Some yes-or-no prompts end in "(y/n)". Some don't. Consistently use y/n everywhere.
2004-02-26* delkey.c (do_delete_key): Allow deleting a public key with a secretDavid Shaw1-2/+3
present if --expert is set. * plaintext.c (handle_plaintext): Make bytecount static so it works with multiple literal packets inside a message. * encode.c, helptext.c (keygen.algo, keygen.algo.elg_se), keygen.c (ask_algo), sig-check.c (do_check_messages), skclist.c (build_sk_list): Rename "ElGamal" to "Elgamal" as that is the proper spelling nowadays. Suggested by Jon Callas.
2003-10-02* cardglue.c (learn_status_cb): Release values before assignmentWerner Koch1-1/+1
so that it can be used by getattr to update the structure. (agent_scd_getattr): New. * keylist.c (print_pubkey_info): Add FP arg for optional printing to a stream. Changed all callers.
2003-07-24* g10.c: New command --card-status.Werner Koch1-1/+1
* card-util.c (card_status): New. * call-agent.c (learn_status_cb): Parse more information. * keylist.c (print_pubkey_info): Add FP arg for optinal printing to a stream. Changed all callers.
2003-06-18Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch1-8/+8
to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
2003-01-09This commit was manufactured by cvs2svn to create branchRepo Admin1-0/+209
'GNUPG-1-9-BRANCH'.
2002-10-30* packet.h, trustdb.h, trustdb.c (trust_string): New. Return a stringDavid Shaw1-1/+1
like "fully trusted", "marginally trusted", etc. (get_min_ownertrust): New. Return minimum ownertrust. (update_min_ownertrust): New. Set minimum ownertrust. (check_regexp): New. Check a regular epression against a user ID. (ask_ownertrust): Allow specifying a minimum value. (get_ownertrust_info): Follow the minimum ownertrust when returning a letter. (clear_validity): Remove minimum ownertrust when a key becomes invalid. (release_key_items): Release regexp along with the rest of the info. (validate_one_keyblock, validate_keys): Build a trust sig chain while validating. Call check_regexp for regexps. Use the minimum ownertrust if the user does not specify a genuine ownertrust. * pkclist.c (do_edit_ownertrust): Only allow user to select a trust level greater than the minimum value. * parse-packet.c (can_handle_critical): Can handle critical trust and regexp subpackets. * trustdb.h, trustdb.c (clear_ownertrusts), delkey.c (do_delete_key), import.c (import_one): Rename clear_ownertrust to clear_ownertrusts and have it clear the min_ownertrust value as well. * keylist.c (list_keyblock_print): Indent uid to match pub and sig.
2002-10-19This commit was manufactured by cvs2svn to create branchRepo Admin1-221/+0
'GNUPG-1-9-BRANCH'.
2002-10-182002-10-18 Timo Schulz <[email protected]>Timo Schulz1-17/+5
* keylist.c: (print_pubkey_info): New. (print_seckey_info): New. * main.h: Prototypes for the new functions. * delkey.c (do_delete_key): Use it here. * revoke.c (gen_desig_revoke): Ditto.
2002-08-02* delkey.c (do_delete_key): Always allow to delete a key in batch modeWerner Koch1-0/+12
when specified by fingerprint. Suggested by Enzo Michelangeli.
2002-06-29Update head to match stable 1.0David Shaw1-26/+78
2000-10-10Changed keyring handling - saving still does not work.Werner Koch1-0/+1
Added new cipher mode and updated cipher test program.
2000-10-06See ChangeLog: Fri Oct 6 14:29:16 CEST 2000 Werner KochWerner Koch1-10/+3