ibmtss
ibmtss copied to clipboard
Questions about Remote Attestation, looking forward to a reply
Hello,
I am conducting an experiment based on "AttestProv.doc" from your other repository "acs". I have read the EK certificate(sm2_ek_cert.pem) using "nvread" and generate an attestation public attestation key(sm2_ak.pub) on the client and sent them to the server. I would like to know how to complete the "The server extracts the EK public key from the EK certificate" in section 3.2 "Server Challenge", and how to load the public attestation key using "loadexternal" correctly. I have tried many times, but all have failed.
Can you help me solve these problems , thank you!
server.c has sample code for RSA and ECC but not SM2. It may be similar.
The overall flow is processEnrollRequest(). Adapt it for SM2. validateEkCertificate() uses X509_get_pubkey() to extract the EK public key from the certificate. The function also converts the EK to a TPMT_PUBLIC.
generateCredentialBlob shows how to use loadexternal.
Thank you, I already know how to use it.