Skip to content

Commit

Permalink
WIP: EK Cert Verification (no wolfCrypt).
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Jan 19, 2025
1 parent bcf2647 commit 55c78c6
Show file tree
Hide file tree
Showing 4 changed files with 327 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/endorsement/endorsement.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#endif

int TPM2_EndorsementCert_Example(void* userCtx, int argc, char *argv[]);
int TPM2_EndorsementCertVerify_Example(void* userCtx, int argc, char *argv[]);

#ifdef __cplusplus
} /* extern "C" */
Expand Down
3 changes: 3 additions & 0 deletions examples/endorsement/get_ek_certs.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ int TPM2_EndorsementCert_Example(void* userCtx, int argc, char *argv[])
printf("Endorsement Cert PEM\n");
puts(pem);
}

XFREE(pem, NULL, DYNAMIC_TYPE_TMP_BUFFER);
pem = NULL;
#endif /* WOLFSSL_DER_TO_PEM */
}
#endif /* !WOLFTPM2_NO_WOLFCRYPT && !NO_ASN */
Expand Down
12 changes: 10 additions & 2 deletions examples/endorsement/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ if BUILD_EXAMPLES
examples_endorsement_get_ek_certs_SOURCES = examples/endorsement/get_ek_certs.c
examples_endorsement_get_ek_certs_LDADD = src/libwolftpm.la $(LIB_STATIC_ADD)
examples_endorsement_get_ek_certs_DEPENDENCIES = src/libwolftpm.la

noinst_PROGRAMS += examples/endorsement/verify_ek_cert
examples_endorsement_verify_ek_cert_SOURCES = examples/endorsement/verify_ek_cert.c
examples_endorsement_verify_ek_cert_LDADD = src/libwolftpm.la $(LIB_STATIC_ADD)
examples_endorsement_verify_ek_cert_DEPENDENCIES = src/libwolftpm.la
endif

EXTRA_DIST+=examples/endorsement/README.md
example_endorsementdir = $(exampledir)/endorsement
dist_example_endorsement_DATA = \
examples/endorsement/get_ek_certs.c
examples/endorsement/get_ek_certs.c \
examples/endorsement/verify_ek_cert.c

DISTCLEANFILES+= examples/endorsement/.libs/get_ek_certs
DISTCLEANFILES+= \
examples/endorsement/.libs/get_ek_certs \
examples/endorsement/.libs/verify_ek_cert
Loading

0 comments on commit 55c78c6

Please sign in to comment.