aboutsummaryrefslogtreecommitdiffstats
path: root/agent/learncard.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-03-17gpgsm: Extend --learn-card by an optional s/n argument.Werner Koch1-3/+7
* agent/command.c (cmd_learn): Allow for s/n argument. * agent/learncard.c (agent_handle_learn): Ditto. * agent/call-scd.c (agent_card_learn): Ditto. Pass it on to scd. * scd/command.c (cmd_switchcard): Factor most code out to ... (switchcard_core): new. (cmd_learn): Add option --demand to specify a s/n. * sm/gpgsm.c (main): Allow a s/n argument for --learn-card. -- This help Kleopatra to get a stable certificate listing. GnuPG-bug-id: 7379
2024-01-22agent: Add "ephemeral" Assuan option.Werner Koch1-10/+12
* agent/agent.h (struct ephemeral_private_key_s): New. (struct server_control_s): Add ephemeral_mode and ephemeral_keys. (GENKEY_FLAG_NO_PROTECTION, GENKEY_FLAG_PRESET): New. * agent/genkey.c (clear_ephemeral_keys): New. (store_key): Add arg ctrl and implement ephemeral_mode. Change all callers. (agent_genkey): Replace args no_protection and preset by a generic new flags arg. * agent/findkey.c (wipe_and_fclose): New. (agent_write_private_key): Add arg ctrl and implement ephemeral_mode. Change all callers. (agent_update_private_key): Ditto (read_key_file): Ditto. (agent_key_available): Ditto. * agent/command-ssh.c (card_key_available): Do not update display s/n in ephemeral mode. This is however enver triggred. * agent/gpg-agent.c (agent_deinit_default_ctrl): Cleanup ephemeral keys. * agent/command.c (cmd_genkey): Use the new flags instead of separate vars. (cmd_readkey): Create a shadow key only in non-ephemeral_mode. (cmd_getinfo): Add sub-command "ephemeral". (option_handler): Add option "ephemeral". -- The idea here that a session can be switched in an ephemeral mode which does not store or read keys from disk but keeps them local to the session. GnuPG-bug-id: 6944
2023-05-26agent: Create and use Token entries to track the display s/n.Werner Koch1-1/+9
* agent/findkey.c (agent_write_private_key): Add arg dispserialno and update the token. (agent_write_shadow_key): Add arg dispserialno and adjust all callers. -- GnuPG-bug-id: 6135 Note that this has been forward ported from 2.2
2023-05-26agent: Create and use Token entries to track the display s/n.Werner Koch1-1/+9
* agent/findkey.c (agent_write_private_key): Add arg dispserialno and update the token. (agent_write_shadow_key): Add arg dispserialno and adjust all callers. -- GnuPG-bug-id: 6135 Note that this has been forward ported from 2.2
2020-02-13agent: Allow signing with card key even without a stub key.Werner Koch1-1/+1
* agent/call-scd.c (agent_card_serialno): Allow NULL for R_SERIAL. (struct readkey_status_parm_s): New. (readkey_status_cb): New. (agent_card_readkey): Add optional arg R_KEYREF and change all callers. * agent/findkey.c (key_parms_from_sexp): Allow also a "public-key". * agent/divert-scd.c (ask_for_card): Allow for SHADOW_INFO being NULL. * agent/pksign.c (agent_pksign_do): Fallback to sign with an on-card if there is no stub key yet. Create the stub key. Also fixed a misnaming between s_pkey and s_skey. -- This change allows to create OpenPGP keys directly from a card without first making sure that a stub key exists. It is also the less surprising behaviour. Signed-off-by: Werner Koch <[email protected]>
2019-05-14agent: Replace most assert by log_assert.Werner Koch1-1/+0
--
2018-10-24all: fix spelling and typosDaniel Kahn Gillmor1-1/+1
Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2017-11-02agent: Fix returning GPG_ERR_NOT_FOUND wrongly.NIIBE Yutaka1-7/+5
* agent/learncard.c (agent_handle_learn): Find SERIALNO. -- Bug is: "gpg-connect-agent learn /bye" just fails wrongly. Fixes-commit: 8c8ce8711d9c938fcb982b0341e6b052742cb887 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit 5e96fe72e477d09e35ccee48af0fd9ab2b3ae409)
2017-11-02agent: Fix returning GPG_ERR_NOT_FOUND wrongly.NIIBE Yutaka1-7/+5
* agent/learncard.c (agent_handle_learn): Find SERIALNO. -- Bug is: "gpg-connect-agent learn /bye" just fails wrongly. Fixes-commit: 8c8ce8711d9c938fcb982b0341e6b052742cb887 Signed-off-by: NIIBE Yutaka <[email protected]>
2017-03-16agent,g10: Remove redundant SERIALNO request.NIIBE Yutaka1-10/+11
* agent/learncard.c (agent_handle_learn): Don't call agent_card_serialno. Get the serialno in status response. * g10/call-agent.c (agent_scd_learn): Don't request "SCD SERIALNO". (agent_scd_serialno): New. (card_cardlist_cb, agent_scd_cardlist): New. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-01-16agent: Ask specific SERIALNO for pksign/pkdecrypt.NIIBE Yutaka1-1/+1
* agent/call-scd.c (agent_card_serialno): Add DEMAND argument. * agent/command-ssh.c (card_key_available): Follow the change. * agent/learncard.c (agent_handle_learn): Likewise. * agent/divert-scd.c (ask_for_card): Use DEMAND argument. 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-10-20agent: Add --card option for READKEY.NIIBE Yutaka1-27/+3
* agent/findkey.c (agent_write_shadow_key): New. * agent/command-ssh.c (card_key_available): Use agent_write_shadow_key. * agent/learncard.c (agent_handle_learn): Likewise. * agent/command.c (cmd_readkey): Add --card option. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2016-08-03Fix spelling and grammar.Daniel Kahn Gillmor1-3/+3
* agent/learncard.c: s/coccured/occurred/ * doc/dirmngr.texi: s/ommitted/omitted/, s/orginally/originally/, s/reponses/responses/i * doc/gpg-agent.texi, doc/dirmngr.texi, doc/gpg.texi: Fix "allows to" to more conventional english usage. * doc/tools.texi, g10/gpgcommpose.c, tests/openpgp/armor.scm, tests/openpgp/armor.test: s/occured/occurred/ * tools/gpgsplit.c: s/calcualting/calculating/ * sm/server.c: s/formated/formatted/ Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2015-04-03agent: Add --force option for LEARN.NIIBE Yutaka1-3/+3
* agent/command.c (cmd_learn): Handle --force option. (cmd_keytocard): Don't update key storage file. * agent/agent.h (agent_handle_learn): Add FORCE. * agent/learncard.c (agent_handle_learn): Implement FORCE to update key stroage file. --
2014-12-12gpg: Let --card--status create a shadow key (card key stub).Werner Koch1-6/+6
* agent/command.c (cmd_learn): Add option --sendinfo. * agent/learncard.c (agent_handle_learn): Add arg "send" andsend certifciate only if that is set. * g10/call-agent.c (agent_scd_learn): Use --sendinfo. Make INFO optional. (agent_learn): Remove. * g10/keygen.c (gen_card_key): Replace agent_learn by agent_scd_learn. -- The requirement of using --card-status on the first use of card on a new box is a bit annoying but the alternative of always checking whether a card is available before a decryption starts does not sound promising either. Signed-off-by: Werner Koch <[email protected]>
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-1/+1
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.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-20/+18
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.
2009-06-09app-openpgp changesWerner Koch1-3/+18
2009-03-30Implement decryption for TCOS 3 cards.Werner Koch1-1/+3
2009-03-20Fix keygrip computation for TCOS 3 cards.Werner Koch1-5/+20
Emit PROGRESS status lines during --learn-card.
2008-12-05Add option --card-timeout.Werner Koch1-1/+1
Add a new attribyte to app-openpgp.c Fix two portability bugs. Have gpg-connect-agent autostart gpg-agent on W32.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2006-09-26let cmd learn also return KEYPAIRINFO Werner Koch1-0/+6
2006-09-06The big Assuan error code removal.Werner Koch1-2/+2
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2005-07-27Removed directories which are only used by the 1.9 branchWerner Koch1-448/+0
2005-02-25* findkey.c (modify_description): Keep invalid % escapes, so thatWerner Koch1-27/+1
%0A may pass through. * agent.h (server_control_s): New field USE_AUTH_CALL. * call-scd.c (agent_card_pksign): Make use of it. * command-ssh.c (data_sign): Set the flag. (ssh_send_key_public): New arg OVERRIDE_COMMENT. (card_key_available): Add new arg CARDSN. (ssh_handler_request_identities): Use the card s/n as comment. (sexp_key_extract): Use GCRYMPI_FMT_STD. (data_sign): Ditto. * learncard.c (make_shadow_info): Moved to .. * protect.c (make_shadow_info): .. here. Return NULL on malloc failure. Made global. * agent.h: Add prototype. * xasprintf.c (xtryasprintf): New. * app-openpgp.c (get_public_key): Make sure not to return negative numbers. (do_sign): Allow passing of indata with algorithm prefix. (do_auth): Allow OPENPGP.3 as an alternative ID. * app.c (app_getattr): Return just the S/N but not the timestamp. * no-libgcrypt.c (gcry_strdup): New.
2005-02-22(stream_read_string): Removed call to abort onWerner Koch1-8/+20
memory error because the CVS version of libgcrypt makes sure that ERRNO gets always set on error even with a faulty user supplied function.
2004-01-29* agent.h (server_control_s): Add connection_fd field.Werner Koch1-8/+8
* command.c (start_command_handler): Init it here. * gpg-agent.c (agent_init_default_ctrl): and here. * call-scd.c: Add the CTRL arg to all functions calling start_scd and pass it to start_scd. Changed all callers (start_scd): Keep track of the current active connection. (agent_reset_scd): New. * command.c (start_command_handler): Call it here. * learncard.c (agent_handle_learn): Add arg CTRL; changed caller. (send_cert_back): Ditto.
2004-01-28(agent_marktrusted): Check whether the trustlist isWerner Koch1-0/+1
writable.
2003-08-05This commit was manufactured by cvs2svn to create branchRepo Admin1-0/+448
'GNUPG-1-9-BRANCH'.
2003-06-27Key generation and signing using the OpenPGP card does rudimentary work.Werner Koch1-12/+80
2003-06-04Update error handling to match gpg-error in CVS.Marcus Brinkmann1-3/+3
2003-06-03Make use of libgpg-errorWerner Koch1-7/+7
2002-10-19This commit was manufactured by cvs2svn to create branchRepo Admin1-380/+0
'GNUPG-1-9-BRANCH'.
2002-08-16* call-scd.c (learn_status_cb): Handle CERTINFO status.Werner Koch1-25/+142
(agent_card_learn): Add args for certinfo cb. * learncard.c (release_certinfo,certinfo_cb): New. (send_cert_back): New. With factored out code from .. (agent_handle_learn): here. Return certinfo stuff.
2002-03-18Doc fixes, moved some fizmes to TODO, fixed minor bugs.Werner Koch1-4/+4
2002-03-06sm/Werner Koch1-0/+263
* gpgsm.c: New command --learn-card * call-agent.c (learn_cb,gpgsm_agent_learn): New. * gpgsm.c (main): Print error messages for non-implemented commands. agent/ * learncard.c: New. * divert-scd.c (ask_for_card): The serial number is binary so convert it to hex here. * findkey.c (agent_write_private_key): New. * genkey.c (store_key): And use it here. scd/ * pkdecrypt.c (agent_pkdecrypt): Changed the way the diversion is done. * divert-scd.c (divert_pkdecrypt): Changed interface and implemented it.