I've encountered an issue where using create_ek_template returns None as certificate, but using tpm2 tools createek and getekcertificate works and outputs a valid certificate.
Here's the tpm2 tools commands used, exactly:
tpm2_createek -c ek.ctx -G rsa -u ek.pub
tpm2_getekcertificate -o ek.cert -u ek.pub
tpm2-pytss code:
with ESAPI(tcti="tabrmd") as ectx:
nv_read = NVReadEK(ectx)
ek_cert, ek_template = create_ek_template("EK-RSA2048", nv_read)
ek_cert comes out as None.
I have no idea what might be causing this or how to fix this, so any help is appreciated.