aboutsummaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorTadeusz Struk <tadeusz.struk@intel.com>2020-01-09 15:16:08 -0800
committerAndreas Fuchs <andreas.fuchs@sit.fraunhofer.de>2020-01-10 17:09:00 +0100
commita727ab83d54b4887f3af9bd9476c39bab2a5d0f4 (patch)
tree2fc56f511e2a23bf6ac992b6f5c3fcf3e2b4b336 /test/integration
parentcb5cb5230b90322c22dd7ca590dbdcd0ebe36401 (diff)
downloadtpm2-tss-a727ab83d54b4887f3af9bd9476c39bab2a5d0f4.tar.gz
esys: update Esys_create test to call it with invalid ESYS_TR_NONE
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/esys-create-fail.int.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/test/integration/esys-create-fail.int.c b/test/integration/esys-create-fail.int.c
index 8cc0b8b5..2b335867 100644
--- a/test/integration/esys-create-fail.int.c
+++ b/test/integration/esys-create-fail.int.c
@@ -208,6 +208,78 @@ test_esys_create_fail(ESYS_CONTEXT * esys_context)
r = Esys_FlushContext(esys_context, primaryHandle);
goto_if_error(r, "Error during FlushContext", error);
+ TPM2B_SENSITIVE_CREATE inSensitive2 = {
+ .size = 0,
+ .sensitive = {
+ .userAuth = {
+ .size = 0,
+ .buffer = {}
+ },
+ .data = {
+ .size = 0,
+ .buffer = {}
+ }
+ }
+ };
+
+ TPM2B_PUBLIC inPublic2 = {
+ .size = 0,
+ .publicArea = {
+ .type = TPM2_ALG_RSA,
+ .nameAlg = TPM2_ALG_SHA256,
+ .objectAttributes = (TPMA_OBJECT_USERWITHAUTH |
+ TPMA_OBJECT_RESTRICTED |
+ TPMA_OBJECT_DECRYPT |
+ TPMA_OBJECT_FIXEDTPM |
+ TPMA_OBJECT_FIXEDPARENT |
+ TPMA_OBJECT_SENSITIVEDATAORIGIN),
+
+ .authPolicy = {
+ .size = 0,
+ },
+ .parameters.rsaDetail = {
+ .symmetric = {
+ .algorithm = TPM2_ALG_AES,
+ .keyBits.aes = 128,
+ .mode.aes = TPM2_ALG_CFB
+ },
+ .scheme = {
+ .scheme =
+ TPM2_ALG_NULL,
+ },
+ .keyBits = 2048,
+ .exponent = 0
+ },
+ .unique.rsa = {
+ .size = 0,
+ .buffer = {}
+ ,
+ }
+ }
+ };
+
+ TPM2B_DATA outsideInfo2 = {
+ .size = 0,
+ .buffer = {}
+ ,
+ };
+
+ TPML_PCR_SELECTION creationPCR2 = {
+ .count = 0,
+ };
+
+ r = Esys_Create(esys_context,
+ ESYS_TR_NONE,
+ ESYS_TR_PASSWORD, ESYS_TR_NONE, ESYS_TR_NONE,
+ &inSensitive2,
+ &inPublic2,
+ &outsideInfo2,
+ &creationPCR2,
+ &outPrivate2,
+ &outPublic2,
+ &creationData2, &creationHash2, &creationTicket2);
+ goto_error_if_not_failed(r, "Error esys create did not fail with bad value parameters", error);
+
Esys_Free(outPublic);
Esys_Free(creationData);
Esys_Free(creationHash);