aboutsummaryrefslogtreecommitdiffstats
path: root/g10/skclist.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Rename functions with an "fprint" part to "fpr"Werner Koch2024-06-041-1/+1
| | | | | | -- The fprint is too uncommon in our code base and to similar to fprintf.
* gpg: Allow decryption w/o public key but with correct card inserted.Werner Koch2021-04-231-0/+41
| | | | | | | | | | | * agent/command.c (cmd_readkey): Add option --no-data and special handling for $SIGNKEYID and $AUTHKEYID. * g10/call-agent.c (agent_scd_getattr): Create shadow keys for KEY-FPR output. * g10/skclist.c (enum_secret_keys): Automagically get a missing public key for the current card. Signed-off-by: Werner Koch <[email protected]>
* gpg: Change API of agent_scd_serialno.NIIBE Yutaka2020-11-201-7/+2
| | | | | | | | | | * g10/call-agent.c (agent_scd_serialno): Extend API to allow with R_SERIALNO == NULL. * g10/card-util.c (card_status): Use NULL for agent_scd_serialno. (factory_reset): Likewise. * g10/skclist.c (build_sk_list): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Rename the struct card_key_info_s.Werner Koch2020-02-121-3/+3
| | | | | | | | | | | | | | | | * 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]>
* 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]>
* scd: Minor fix for readibility.Werner Koch2020-01-031-1/+1
| | | | | | | | | | | | * scd/command.c (open_card_with_request): Use NULL instead of APPTYPE_NULL. -- Using the enum is wrong because a string is expected. However it did harm anything because the value of the enum is 0 and thus equivalent to NULL. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve the code to decrypt using PIV cards.Werner Koch2019-04-031-20/+13
| | | | | | | | | | | | | | * g10/call-agent.c (agent_scd_keypairinfo): Add arg 'keyref'. * g10/keygen.c (ask_algo): Adjust. * g10/skclist.c (enum_secret_keys): Request the keyref directly. -- This improves commit ec6a6779236a89d4784a6bb7de0def9cc0f9e8a4 to avoid looping over all keypairinfos. This way scdaemon does not need to compute all the keypairinfos for all keys of a card. This patch is possible due the enhanced READKEY command in scdaemon. Signed-off-by: Werner Koch <[email protected]>
* gpg: Allow decryption using PIV cards.Werner Koch2019-04-031-8/+53
| | | | | | | | | | | * g10/call-agent.c (struct getattr_one_parm_s): New. (getattr_one_status_cb): New. (agent_scd_getattr_one): New. * g10/pubkey-enc.c (get_it): Allow the standard leading zero byte from pkcs#1. * g10/skclist.c (enum_secret_keys): Handle non-OpenPGP cards. Signed-off-by: Werner Koch <[email protected]>
* gpg: Avoid endless loop if a card's serial number can't be read.Werner Koch2019-04-031-0/+1
| | | | | | | | | | * g10/skclist.c (enum_secret_keys): Move list forward on error. -- The error is not easy to reproduce but may occur if a card is removed at the wrong time. Tested by changing the code. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix another memory leak.NIIBE Yutaka2018-09-131-4/+3
| | | | | | | | | | | | * g10/skclist.c (enum_secret_keys): Use SK_LIST instead of pubkey_t. -- The use of pubkey_t was wrong. The use is just a list of keys, not with keyblock. With SK_LIST, release_sk_list releases memory by free_public_key. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix memory leak (more).NIIBE Yutaka2018-09-131-5/+9
| | | | | | | | * g10/skclist.c (enum_secret_keys): Free SERIALNO on update. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix memory leak in enum_secret_keys.NIIBE Yutaka2018-09-131-2/+10
| | | | | | | | | | | * g10/skclist.c (enum_secret_keys): Don't forget to call free_public_key in the error return paths. -- Reported-by: Philippe Antoine GnuPG-bug-id: 4140 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Prepare for longer card fingerprints.Werner Koch2018-08-271-5/+6
| | | | | | | | | | | | | | | | | | | | | | * g10/call-agent.h (agent_card_info_s): Rename the "*valid" fields to "*len". * g10/call-agent.c (unhexify_fpr): Change to take a FPRLEN and to return the actual length. (agent_release_card_info): Adjust for these changes. * g10/card-util.c (print_sha1_fpr): Rename to print_shax_fpr and add arg FPRLEN. Change all callers to pass the length. (print_sha1_fpr_colon): Rename to print_shax_fpr_colon and add arg FPRLEN. Change all callers to pass the length. (fpr_is_zero): Add arg FPRLEN. (fpr_is_ff): Ditto. (show_card_key_info): Use the new functions. * g10/skclist.c (enum_secret_keys): Use MAX_FINGERPRINT_LEN. -- This is not needed right now but we should get rid of all hard coded fingerprint lengths. Thus this change. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix enum_secret_keys for card keys.NIIBE Yutaka2018-08-271-3/+8
| | | | | | | * g10/skclist.c (enum_secret_keys): Since "KEY-FPR" returns fingerprint in binary, change it to hex string. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Prefer to available card keys for decryption.NIIBE Yutaka2018-08-271-9/+57
| | | | | | | * g10/skclist.c (enum_secret_keys): Add logic to prefer decryption keys on cards. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Move enum_secret_keys to skclist.c.NIIBE Yutaka2018-08-271-0/+198
| | | | | | | | | | | | | * g10/getkey.c (enum_secret_keys): Move to... * g10/skclist.c (enum_secret_keys): ... here. -- The function enum_secret_keys is not used by gpgv.c, but it is in getkey.c. Extending enum_secret_keys will require change of gpgv.c, so moving the function to the file for gpg is better. Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix default-key selection for signing, possibly by card.NIIBE Yutaka2017-05-221-12/+4
| | | | | | | | | | | | | | | * g10/call-agent.c (warn_version_mismatch): Revert. (start_agent): Suppress version mismatch if relevant. * g10/getkey.c (get_seckey_default_or_card): New. * g10/skclist.c (build_sk_list): Use get_seckey_default_or_card. -- The change of 97a2394, which prefers available card than default key specified is too strong. Fixes-commit: 97a2394ecafaa6f58e4a1f70ecfd04408dc15606 Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: For signing, prefer available card key when no -u option.NIIBE Yutaka2017-04-271-2/+28
| | | | | | | | | | * g10/skclist.c (build_sk_list): Ask gpg-agent if card is available. Then, use the card key if any. -- GnuPG-bug-id: 1983 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Pass CTRL to many more functions.Werner Koch2017-03-311-4/+4
| | | | | | | | | | -- 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-3/+3
| | | | | | | | | | | | | * 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: Remove all assert.h and s/assert/log_assert/.Werner Koch2016-04-291-1/+0
| | | | Signed-off-by: Werner Koch <[email protected]>
* gpg: Don't check for ambiguous keys.Neal H. Walfield2015-12-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (struct result): Move from here... * g10/keydb.h (struct pubkey): ... to here. Update users. * g10/gpg.c (check_user_ids): Move from here... * g10/getkey.c (get_pubkeys): ... to here. Update users. Use get_pubkey_byname to look up the keys (this also prunes invalid keys). (pubkey_free): New function. (pubkeys_free): New function. * g10/gpg.c (main): Don't check for ambiguous key specifications. -- Signed-off-by: Neal H. Walfield <[email protected]> Regression-due-to: e8c53fc This change not only moves the checks for ambiguous key specifications from gpg.c to getkey.c, it also disables the checks. The old code was too divorced from the actual key lookups and, as such, it reproduced the logic. Unfortunately, the reproduction was a poor one: despite fixing some inconsistencies (e.g., 10cca02), it still didn't deal with group expansion or the auto key lookup functionality. Given the amount of instability introduced by this change, we (Neal & Werner) decided it is better to defer introducing this functionality until 2.3.
* gpg: Allow multiple --default-key options. Take the last available key.Neal H. Walfield2015-11-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | * g10/getkey.c (parse_def_secret_key): New function. (get_seckey_default): Add parameter ctrl. Update callers. Use parse_def_secret_key to get the default secret key, if any. (getkey_byname): Likewise. (enum_secret_keys): Likewise. * g10/options.h (opt): Change def_secret_key's type from a char * to a strlist_t. * g10/gpg.c (main): When processing --default-key, add the key to OPT.DEF_SECRET_KEY. * g10/gpgv.c (get_session_key): Add parameter ctrl. Update callers. * g10/mainproc.c (proc_pubkey_enc): Likewise. (do_proc_packets): Likewise. * g10/pkclist.c (default_recipient): Likewise. * g10/pubkey-enc.c (get_session_key): Likewise. * g10/sign.c (clearsign_file): Likewise. (sign_symencrypt_file): Likewise. * g10/skclist.c (build_sk_list): Likewise. * g10/test-stubs.c (get_session_key): Likewise. -- Signed-off-by: Neal H. Walield <[email protected]> GnuPG-bug-id: 806
* gpg: Remove cipher.h and put algo ids into a common file.Werner Koch2014-01-291-1/+0
| | | | | | | | | | | | | | | | | | * common/openpgpdefs.h (cipher_algo_t, pubkey_algo_t, digest_algo_t) (compress_algo_t): New. * agent/gpg-agent.c: Remove ../g10/cipher.h. Add openpgpdefs.h. * g10/cipher.h (DEK): Move to ... * g10/dek.h: new file. * g10/cipher.h (is_RSA, is_ELGAMAL, is_DSA) (PUBKEY_MAX_NPKEY, PUBKEY_MAX_NSKEY, PUBKEY_MAX_NSIG, PUBKEY_MAX_NENC) (PUBKEY_USAGE_SIG, PUBKEY_USAGE_ENC, PUBKEY_USAGE_CERT) (PUBKEY_USAGE_AUTH, PUBKEY_USAGE_NONE): Move to * g10/packet.h: here. * g10/cipher.h: Remove. Remove from all files. * g10/filter.h, g10/packet.h: Include dek.h. * g10/Makefile.am (common_source): Remove cipher.h. Add dek.h. Signed-off-by: Werner Koch <[email protected]>
* Allow NULL for free_public_key.Werner Koch2011-09-201-2/+1
|
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-3/+3
| | | | | | | | 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.
* Decryption and signi via agent is now implemented.Werner Koch2010-04-231-15/+1
|
* Various changes to eventually support openpgp keys in pgp-agent.Werner Koch2010-02-021-173/+196
| | | | | | Comment fixes. Minor chnages in preparation of a W32CE port.
* Improved detection of bad/invalid signer keys.Werner Koch2009-08-061-0/+23
|
* Fix bug 1045.Werner Koch2009-05-111-1/+1
|
* Remove hacks which are not anymore needed since we now require Libgcrypt 1.4Werner Koch2008-09-291-12/+1
|
* 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-3/+3
|
* Migrated more stuff to doc/Werner Koch2006-08-211-8/+19
| | | | | | | | Migrated the gpg regression tests. Some changes tp the gpg code to fix bugs and for the use in testing. make distcheck works now with gpg enabled.
* g10/ does build again.Werner Koch2006-05-231-0/+13
|
* Continued with merging.Werner Koch2006-04-191-1/+1
| | | | | Still does not build.
* Merged with gpg 1.4.3 code. Werner Koch2006-04-191-40/+86
| | | | | The gpg part does not yet build.
* Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch2003-06-181-53/+13
| | | | | | | | | | | 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.
* Update head to match stable 1.0David Shaw2002-06-291-27/+106
|
* See ChangeLog: Fri Oct 6 14:29:16 CEST 2000 Werner KochWerner Koch2000-10-061-2/+2
|
* See ChangeLog: Wed Oct 4 13:16:18 CEST 2000 Werner KochWerner Koch2000-10-041-5/+8
|
* See ChangeLog: Mon Sep 18 16:35:45 CEST 2000 Werner KochWerner Koch2000-09-181-2/+2
|
* See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch2000-07-141-2/+2
|
* See ChangeLog: Mon Jan 31 16:37:34 CET 2000 Werner KochWerner Koch2000-01-311-1/+0
|
* 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-6/+5
|
* See ChangeLog: Wed Dec 8 21:58:32 CET 1999 Werner KochWerner Koch1999-12-081-1/+1
|
* See ChangeLog: Sat Nov 13 17:44:23 CET 1999 Werner KochWerner Koch1999-11-131-28/+8
|