Skip to content

Commit 288e406

Browse files
Revert "Add support for importing TPM2 keys with PKCS11 vendor attributes"
This reverts commit 50a636b. Signed-off-by: Bill Roberts <[email protected]>
1 parent d5bc3d3 commit 288e406

29 files changed

+80
-1738
lines changed

Makefile-integration.am

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ integration_scripts = \
1010
test/integration/pkcs11-javarunner.sh.java \
1111
test/integration/nss-tests.sh \
1212
test/integration/ptool-link.sh.nosetup \
13-
test/integration/python-pkcs11.sh \
14-
test/integration/key_import-link.sh.nosetup
13+
test/integration/python-pkcs11.sh
1514

1615
# Note that -fapi.sh.fapi is symlinked to .sh.nosetup
1716
# If we'd use the .fapi extension then .nosetup and .fapi overwrite each others .log
1817
# thus we use -fapi.sh.fapi as suffix.
1918
if HAVE_FAPI
2019
integration_scripts += \
2120
test/integration/p11-tool-fapi.sh.fapi \
22-
test/integration/pkcs11-tool-init-fapi.sh.fapi \
23-
test/integration/key_import-link-fapi.sh.fapi
21+
test/integration/pkcs11-tool-init-fapi.sh.fapi
2422
endif
2523

2624
EXTRA_DIST += \

Makefile.am

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,6 @@ endif
7878

7979
AM_DISTCHECK_CONFIGURE_FLAGS = --with-p11kitconfigdir='$$(datarootdir)/p11kitconfigdir' --with-p11kitmoduledir='$$(libdir)'
8080

81-
# The key_import tool
82-
bin_PROGRAMS = tools/key_import/key_import
83-
if ENABLE_ASAN
84-
tools_key_import_key_import_LDFLAGS = $(AM_LDFLAGS) -shared-libasan
85-
else
86-
tools_key_import_key_import_LDFLAGS = $(AM_LDFLAGS)
87-
endif
88-
tools_key_import_key_import_LDADD = $(libtpm2_pkcs11)
89-
tools_key_import_key_import_SOURCES = tools/key_import/import.c
90-
9181
#
9282
# Due to limitations in how cmocka works, we build a separate library here so we
9383
# can have a PKCS11 shared object with undefined calls into the rest of the lib
@@ -129,8 +119,8 @@ AM_TESTS_ENVIRONMENT = \
129119
PYTHON_INTERPRETER=@PYTHON_INTERPRETER@ \
130120
TEST_FUNC_LIB=$(srcdir)/test/integration/scripts/int-test-funcs.sh \
131121
TEST_FIXTURES=$(abs_top_srcdir)/test/integration/fixtures \
132-
PATH=$(abs_top_srcdir)/tools/tpm2_ptool:$(abs_builddir)/tools/key_import:./src:$(PATH) \
133-
PYTHONPATH=$(abs_top_srcdir)/tools/tpm2_ptool:$(PYTHONPATH) \
122+
PATH=$(abs_top_srcdir)/tools:./src:$(PATH) \
123+
PYTHONPATH=$(abs_top_srcdir)/tools:$(PYTHONPATH) \
134124
TPM2_PKCS11_MODULE=$(abs_builddir)/src/.libs/libtpm2_pkcs11.so \
135125
TEST_JAVA_ROOT=$(JAVAROOT) \
136126
PACKAGE_URL=$(PACKAGE_URL) \

docs/KEY_IMPORT_TOOL.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/lib/attrs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,10 @@ static attr_handler2 attr_handlers[] = {
167167
ADD_ATTR_HANDLER(CKA_WRAP_TEMPLATE, TYPE_BYTE_TEMP_SEQ),
168168
ADD_ATTR_HANDLER(CKA_UNWRAP_TEMPLATE, TYPE_BYTE_TEMP_SEQ),
169169
ADD_ATTR_HANDLER(CKA_ALLOWED_MECHANISMS, TYPE_BYTE_INT_SEQ),
170-
ADD_ATTR_HANDLER(CKA_TPM2_OBJAUTH, TYPE_BYTE_HEX_STR),
171170
ADD_ATTR_HANDLER(CKA_TPM2_OBJAUTH_ENC, TYPE_BYTE_HEX_STR),
172171
ADD_ATTR_HANDLER(CKA_TPM2_PUB_BLOB, TYPE_BYTE_HEX_STR),
173172
ADD_ATTR_HANDLER(CKA_TPM2_PRIV_BLOB, TYPE_BYTE_HEX_STR),
174173
ADD_ATTR_HANDLER(CKA_TPM2_ENC_BLOB, TYPE_BYTE_HEX_STR),
175-
ADD_ATTR_HANDLER(CKA_TPM2_PERSISTENT_HANDLE, TYPE_BYTE_INT),
176174
};
177175

178176
static attr_handler2 default_handler = { .memtype = 0, .name="UNKNOWN" };

src/lib/attrs.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@
1010
/*
1111
* We will allow these to be accessed, but the values are not stable
1212
*/
13-
#define CKA_VENDOR_TPM2_DEFINED 0x0F000000UL
14-
#define CKA_TPM2_OBJAUTH_ENC (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x1UL)
15-
#define CKA_TPM2_PUB_BLOB (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x2UL)
16-
#define CKA_TPM2_PRIV_BLOB (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x3UL)
17-
#define CKA_TPM2_ENC_BLOB (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x4UL)
18-
#define CKA_TPM2_OBJAUTH (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x5UL)
19-
#define CKA_TPM2_PERSISTENT_HANDLE (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x6UL)
13+
#define CKA_VENDOR_TPM2_DEFINED 0x0F000000UL
14+
#define CKA_TPM2_OBJAUTH_ENC (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x1UL)
15+
#define CKA_TPM2_PUB_BLOB (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x2UL)
16+
#define CKA_TPM2_PRIV_BLOB (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x3UL)
17+
#define CKA_TPM2_ENC_BLOB (CKA_VENDOR_DEFINED|CKA_VENDOR_TPM2_DEFINED|0x4UL)
2018

2119
/* Invalid values for error detection */
2220
#define CK_OBJECT_CLASS_BAD (~(CK_OBJECT_CLASS)0)

0 commit comments

Comments
 (0)