summaryrefslogtreecommitdiffstats
path: root/agent/call-daemon.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2021-03-09 22:50:29 +0100
committerWerner Koch <wk@gnupg.org>2021-03-10 13:23:05 +0100
commit1f995b9ba42b76c1d83b484e5362548a54a70dab (patch)
tree7d0c02dfd604251dc98b8276a9f267df839055a8 /agent/call-daemon.c
parenttpm2d: Add tpm2daemon code (diff)
downloadgnupg2-1f995b9ba42b76c1d83b484e5362548a54a70dab.tar.xz
gnupg2-1f995b9ba42b76c1d83b484e5362548a54a70dab.zip
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>
Diffstat (limited to 'agent/call-daemon.c')
-rw-r--r--agent/call-daemon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/agent/call-daemon.c b/agent/call-daemon.c
index 5147f1557..144400875 100644
--- a/agent/call-daemon.c
+++ b/agent/call-daemon.c
@@ -45,7 +45,8 @@
* same order as given by the daemon_type enum. */
static const int daemon_modules[DAEMON_MAX_TYPE] =
{
- GNUPG_MODULE_NAME_SCDAEMON
+ GNUPG_MODULE_NAME_SCDAEMON,
+ GNUPG_MODULE_NAME_TPM2DAEMON
};
/* Definition of module local data of the CTRL structure. */