aboutsummaryrefslogtreecommitdiffstats
path: root/g10/delkey.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Fix the previous commit.NIIBE Yutaka2020-11-111-1/+3
| | | | | | * g10/delkey.c (do_delete_key): Fix the condition for the error. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: In batch mode, delete-secret-key is not okay without --yes.NIIBE Yutaka2020-11-101-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]>
* gpg: Prepare enhancement of agent_probe_secret_key.NIIBE Yutaka2020-01-171-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]>
* gpg: Remove an unused variable.Werner Koch2019-11-061-2/+0
| | | | | | * g10/delkey.c (do_delete_key): here. Signed-off-by: Werner Koch <[email protected]>
* gpg: Also delete key-binding signature when deleting a subkey.Werner Koch2019-10-151-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]>
* gpg: New option --use-keyboxd.Werner Koch2019-09-091-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]>
* gpg: Allow deletion of subkeys with --delete-[secret-]key.Werner Koch2019-05-271-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
* gpg: Unify the the use of the print_pubkey_info functions.Werner Koch2019-05-211-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]>
* gpg: Do not delete any keys if --dry-run is passed.Werner Koch2019-05-201-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]>
* kbx: Unify the fingerprint search modes.Werner Koch2019-03-141-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]>
* kbx: Add support for 32 byte fingerprints.Werner Koch2019-03-141-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]>
* gpg: Pass CTRL to many more functions.Werner Koch2017-03-311-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]>
* Remove -I option to common.NIIBE Yutaka2017-03-071-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]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* gpg: Allow unattended deletion of secret keys.Werner Koch2016-05-101-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]>
* gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch2016-04-291-1/+0
| | | | Signed-off-by: Werner Koch <[email protected]>
* gpg: Write ERROR status on delete-key cancellationDaiki Ueno2015-12-041-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
* gpg: Add variant of 'key "%s" not found: %s' error message.Werner Koch2015-12-031-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]>
* gpg: Take care of keydb_new returning NULL.Werner Koch2015-12-031-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]>
* gpg: --delete-secret-key - check that a secret key exists.Werner Koch2014-09-201-0/+9
| | | | | | | * g10/delkey.c (do_delete_key): Check availibility of a secret key. -- Actually we check that at least one secret subkey exists.
* gpg: Re-enable secret key deletion.Werner Koch2014-04-151-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.
* gpg: Re-indent a file.Werner Koch2014-04-151-132/+151
| | | | | * g10/delkey.c: Re-indent. (do_delete_key, delete_keys): Change return type top gpg_error_t.
* gpg: Remove a function wrapper.Werner Koch2013-01-081-1/+1
| | | | | | * g10/keydb.h (keydb_search): Remove macro. * g10/keydb.c (keydb_search2): Rename to keydb_search. Change all callers.
* Give sensible error messages when trying to delete secret key.Marcus Brinkmann2011-04-291-11/+20
|
* Fix regression in gpg's mail address parsing.Werner Koch2011-04-251-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.
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-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.
* Removed more secret key related code.Werner Koch2010-09-061-24/+14
| | | | | | It builds fine and passes some of the tests but there are quite some features which don't work yet.
* More changes on the way to remove secring.gpg.Werner Koch2010-04-211-5/+2
|
* Unification of the search descriptor usage.Werner Koch2009-12-081-3/+4
|
* Started to implement the audit log feature.Werner Koch2007-11-191-1/+1
| | | | | | | | Pass PINENTRY_USER_DATA and XAUTHORITY to Pinentry. Improved support for the quality bar. Minor internal restructuring. Translation fixes.
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* Fix for bug 537Werner Koch2006-10-021-1/+1
|
* Merged with gpg 1.4.3 code. Werner Koch2006-04-191-34/+46
| | | | | The gpg part does not yet build.
* * g10.c: New command --card-status.Werner Koch2003-07-241-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.
* Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch2003-06-181-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.
* This commit was manufactured by cvs2svn to create branchRepo Admin2003-01-091-0/+209
| | | | 'GNUPG-1-9-BRANCH'.
* This commit was manufactured by cvs2svn to create branchRepo Admin2002-10-191-221/+0
| | | | 'GNUPG-1-9-BRANCH'.
* * delkey.c (do_delete_key): Always allow to delete a key in batch modeWerner Koch2002-08-021-0/+12
| | | | | when specified by fingerprint. Suggested by Enzo Michelangeli.
* Update head to match stable 1.0David Shaw2002-06-291-26/+78
|
* Changed keyring handling - saving still does not work.Werner Koch2000-10-101-0/+1
| | | | | Added new cipher mode and updated cipher test program.
* See ChangeLog: Fri Oct 6 14:29:16 CEST 2000 Werner KochWerner Koch2000-10-061-10/+3
|
* See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch2000-07-141-2/+5
|
* See ChangeLog: Thu Jan 27 18:00:44 CET 2000 Werner KochWerner Koch2000-01-271-5/+5
|
* See ChangeLog: Mon Jan 24 13:04:28 CET 2000 Werner KochWerner Koch2000-01-241-2/+2
|
* See ChangeLog: Tue Oct 26 14:10:21 CEST 1999 Werner KochWerner Koch1999-10-261-1/+1
|
* See ChangeLog: Wed Dec 23 13:34:22 CET 1998 Werner KochWerner Koch1998-12-231-3/+3
|
* See ChangeLog: Fri Nov 27 12:39:29 CET 1998 Werner KochWerner Koch1998-11-271-3/+3
|
* Epxerimenta support for GDBM keyings.Werner Koch1998-10-211-1/+1
|
* *** empty log message ***Werner Koch1998-09-111-0/+160