gnupg/agent
James Bottomley 1f995b9ba4
agent: Add new shadow key type and functions to call tpm2daemon
* agent/call-tpm2d.c: New.
* divert-tpm2.c: New.
* agent/Makefile.am: Add new files.
* agent/agent.h (DAEMON_TPM2D): New.  Add stub fucntions.
* agent/call-daemon.c (GNUPG_MODULE_NAME_TPM2DAEMON): New.
* agent/command.c (do_one_keyinfo): Handle tpmv2.
* agent/gpg-agent.c (oTpm2daemonProgram): New.
(opts): New option --tpm2daemon-program.
(parse_rereadable_options): Handle option.
* agent/pkdecrypt.c (agent_pkdecrypt): Divert to tpm2d.
(agent_pksign_do): Ditto.
---

A new shadow key type: "tpm2-v1" is introduced signalling that the
shadowed key is handled by the tpm2daemon.  A function to identify
this type is introduced and diversions to the tpm2daemon functions are
conditioned on this function for pkign and pkdecrypt where the same
diversions to scd are currently done.  The (info) field of the
shadowed key stores the actual TPM key.  The TPM key is encrypted so
only the physical TPM it was created on can read it (so no special
protection is required for the info filed), but if the (info) field
becomes corrupt or damaged, the key will be lost (unlike the token
case, where the key is actually moved inside the token).

Note, this commit adds handling for existing TPM format shadow keys,
but there is still no way to create them.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

Additional changes:
* Add ChangeLog entries.
* Some minor indentation fixes.
* agent/Makefile.am (gpg_agent_SOURCES): Change to make distcheck
  work.
* agent/agent.h [!HAVE_LIBTSS]: Do not return -EINVAL but an
  gpg_error_t.  Mark args as unused.
* agent/protect.c (agent_is_tpm2_key): Free BUF.

Signed-off-by: Werner Koch <wk@gnupg.org>
2021-03-10 13:23:05 +01:00
..
ChangeLog-2011 Fix typos 2015-10-28 10:20:17 +01:00
Makefile.am agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
agent.h agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
all-tests.scm tests: Make it possible to run all tests using our infrastructure. 2017-05-11 18:12:37 +02:00
cache.c agent: Fix SEGV when debuging for cache enabled. 2020-10-09 13:57:29 +09:00
call-daemon.c agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
call-pinentry.c po: Change translatability of a fallback string. 2021-02-18 14:43:43 +01:00
call-scd.c Fix the previous comment changes help doc string. 2020-11-20 17:17:30 +09:00
call-tpm2d.c agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
command-ssh.c agent: Support ssh-agent extensions for environment variables. 2021-01-25 10:35:06 +01:00
command.c agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
cvt-openpgp.c agent: Fix SOS handling with libgcrypt 1.8. 2020-11-09 11:04:22 +09:00
cvt-openpgp.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
divert-scd.c agent: Fix YK s/n and prettify the request card prompt for Yubikeys 2020-11-26 15:56:37 +01:00
divert-tpm2.c agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
findkey.c Replace all calls to access by gnupg_access 2020-10-20 12:15:55 +02:00
genkey.c agent: Allow to pass a timestamp to genkey and import. 2020-08-17 15:05:49 +02:00
gpg-agent-w32info.rc w32: Add icons and version information. 2013-05-07 21:35:48 +02:00
gpg-agent.c agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
keyformat.txt agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
learncard.c agent: Allow signing with card key even without a stub key. 2020-02-13 11:45:41 +01:00
pkdecrypt.c agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
pksign.c agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
preset-passphrase.c Use gpgrt's new option parser for the tools. 2020-02-21 20:28:47 +01:00
protect-tool.c w32: Replace some fopen by es_fopen. 2020-11-11 15:23:22 +01:00
protect.c agent: Add new shadow key type and functions to call tpm2daemon 2021-03-10 13:23:05 +01:00
sexp-secret.c gpg,agent: Support Ed448 signing. 2020-06-24 10:05:03 +09:00
t-protect.c build: Always use EXTERN_UNLESS_MAIN_MODULE pattern. 2020-02-10 16:50:47 +01:00
trans.c agent: Replace most assert by log_assert. 2019-05-14 10:31:46 +02:00
trustlist.c Replace all calls to access by gnupg_access 2020-10-20 12:15:55 +02:00
w32main.c Spelling cleanup. 2020-02-18 18:07:46 -05:00
w32main.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00