]> git.proxmox.com Git - swtpm.git/commit
swtpm: Abstract NVRAM interface for pluggable state store
authorEiichi Tsukata <eiichi.tsukata@nutanix.com>
Fri, 25 Jun 2021 02:29:44 +0000 (11:29 +0900)
committerStefan Berger <stefanb@us.ibm.com>
Fri, 13 Aug 2021 10:35:18 +0000 (06:35 -0400)
commit2d3deaef291e045a2188287d18d42f2dd58173bf
tree826288308f39f78bffc613be3909e6ebe42e43e4
parent3eac24775249367394c949cc8a452b4101a96371
swtpm: Abstract NVRAM interface for pluggable state store

Related GH issue: https://github.com/stefanberger/swtpm/issues/461

This patch adds an abstraction layer to NVRAM state store implementation
for pluggable storage backends. No functional changes are intended in
this change. The default state store backend ("dir backend") keeps
current behavior.

To make swtpm ready for pluggable store, this patch moves file related
operations to the seperate file (swtpm_nvstore_dir.c) and defined the
interface for plugins (nvram_backend_ops in swtpm_nvstore.h). The
interface can be used by each plugin which will be added later.

With the interface, each plugin can access its "backend_uri" which
points to the location of the backend storage, for example S3 bucket
URL or iSCSI URL, and decide how it stores TPM state data.

Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
15 files changed:
src/swtpm/Makefile.am
src/swtpm/common.c
src/swtpm/ctrlchannel.c
src/swtpm/cuse_tpm.c
src/swtpm/swtpm.c
src/swtpm/swtpm_chardev.c
src/swtpm/swtpm_nvfile.c [deleted file]
src/swtpm/swtpm_nvfile.h [deleted file]
src/swtpm/swtpm_nvstore.c [new file with mode: 0644]
src/swtpm/swtpm_nvstore.h [new file with mode: 0644]
src/swtpm/swtpm_nvstore_dir.c [new file with mode: 0644]
src/swtpm/swtpm_nvstore_dir.h [new file with mode: 0644]
src/swtpm/tpmlib.c
src/swtpm/tpmstate.c
src/swtpm/tpmstate.h