aboutsummaryrefslogtreecommitdiffstats
path: root/g10/skclist.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-06-04gpg: Rename functions with an "fprint" part to "fpr"Werner Koch1-1/+1
-- The fprint is too uncommon in our code base and to similar to fprintf.
2021-04-23gpg: Allow decryption w/o public key but with correct card inserted.Werner Koch1-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]>
2020-11-20gpg: Change API of agent_scd_serialno.NIIBE Yutaka1-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]>
2020-02-12gpg: Rename the struct card_key_info_s.Werner Koch1-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]>
2020-01-16gpg: Use "SCD KEYINFO" to get available card keys.NIIBE Yutaka1-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]>
2020-01-03scd: Minor fix for readibility.Werner Koch1-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]>
2019-04-03gpg: Improve the code to decrypt using PIV cards.Werner Koch1-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]>
2019-04-03gpg: Allow decryption using PIV cards.Werner Koch1-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]>
2019-04-03gpg: Avoid endless loop if a card's serial number can't be read.Werner Koch1-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]>
2018-09-13g10: Fix another memory leak.NIIBE Yutaka1-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]>
2018-09-13g10: Fix memory leak (more).NIIBE Yutaka1-5/+9
* g10/skclist.c (enum_secret_keys): Free SERIALNO on update. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2018-09-13g10: Fix memory leak in enum_secret_keys.NIIBE Yutaka1-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]>
2018-08-27gpg: Prepare for longer card fingerprints.Werner Koch1-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]>
2018-08-27g10: Fix enum_secret_keys for card keys.NIIBE Yutaka1-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]>
2018-08-27g10: Prefer to available card keys for decryption.NIIBE Yutaka1-9/+57
* g10/skclist.c (enum_secret_keys): Add logic to prefer decryption keys on cards. Signed-off-by: NIIBE Yutaka <[email protected]>
2018-08-27g10: Move enum_secret_keys to skclist.c.NIIBE Yutaka1-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]>
2017-05-22g10: Fix default-key selection for signing, possibly by card.NIIBE Yutaka1-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]>
2017-04-27g10: For signing, prefer available card key when no -u option.NIIBE Yutaka1-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]>
2017-03-31gpg: Pass CTRL to many more functions.Werner Koch1-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]>
2017-03-07Remove -I option to common.NIIBE Yutaka1-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]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
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-22gpg: Don't check for ambiguous keys.Neal H. Walfield1-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.
2015-11-04gpg: Allow multiple --default-key options. Take the last available key.Neal H. Walfield1-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
2014-01-29gpg: Remove cipher.h and put algo ids into a common file.Werner Koch1-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]>
2011-09-20Allow NULL for free_public_key.Werner Koch1-2/+1
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-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.
2010-04-23Decryption and signi via agent is now implemented.Werner Koch1-15/+1
2010-02-02Various changes to eventually support openpgp keys in pgp-agent.Werner Koch1-173/+196
Comment fixes. Minor chnages in preparation of a W32CE port.
2009-08-06Improved detection of bad/invalid signer keys.Werner Koch1-0/+23
2009-05-11Fix bug 1045.Werner Koch1-1/+1
2008-09-29Remove hacks which are not anymore needed since we now require Libgcrypt 1.4Werner Koch1-12/+1
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-3/+3
2006-08-21Migrated more stuff to doc/Werner Koch1-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.
2006-05-23g10/ does build again.Werner Koch1-0/+13
2006-04-19Continued with merging.Werner Koch1-1/+1
Still does not build.
2006-04-19Merged with gpg 1.4.3 code. Werner Koch1-40/+86
The gpg part does not yet build.
2005-07-27Converted all m_free to xfree etc.Werner Koch1-5/+5
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2004-10-28* skclist.c (build_sk_list): Don't need to warn about PGP-generatedDavid Shaw1-18/+17
Elgamal signing keys since we no longer support any Elgamal signing keys. * sign.c (sign_file, clearsign_file): Use "writing to" instead of "writing to file" to match other strings. * pkclist.c (check_signatures_trust): Fix typo. Noted by Moray Allan. This is Debian bug #278708. * passphrase.c (ask_passphrase, passphrase_to_dek): "password" -> "passphrase". * keyedit.c (show_key_with_all_names): Show designated revoker as part of translatable string.
2004-10-28* delkey.c, export.c, keyedit.c, pkclist.c, revoke.c, skclist.c: Fix a fewDavid Shaw1-15/+21
missed possible \"username\" quotes.
2004-02-26* delkey.c (do_delete_key): Allow deleting a public key with a secretDavid Shaw1-2/+2
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-06-18Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch1-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.
2002-06-29Update head to match stable 1.0David Shaw1-27/+106
2000-10-06See ChangeLog: Fri Oct 6 14:29:16 CEST 2000 Werner KochWerner Koch1-2/+2
2000-10-04See ChangeLog: Wed Oct 4 13:16:18 CEST 2000 Werner KochWerner Koch1-5/+8
2000-09-18See ChangeLog: Mon Sep 18 16:35:45 CEST 2000 Werner KochWerner Koch1-2/+2
2000-07-14See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch1-2/+2