Skip to content

The unsealed secret flows through the TPM interface in clear text #83

@jx6f

Description

@jx6f

Thank you for sharing your valuable insights.

I read Protecting Secrets At Tpm Interface article and tried the demo script while capturing packets using SWTPM simulator. And then I found that unsealed secret is not encrypted.

image

I think that adding --enable-encrypt option to tpm2_sessionconfig command fixes this.

--- a/_posts/2021-02-17-Protecting-secrets-at-TPM-interface.md
+++ b/_posts/2021-02-17-Protecting-secrets-at-TPM-interface.md
@@ -231,7 +231,7 @@ setup_salted_param_encrypt_session_with_ek() {
     --tpmkey-context ek.ctx
     rm -f ek.ctx
 
-    tpm2_sessionconfig -Q  salted_session.ctx --enable-decrypt
+    tpm2_sessionconfig -Q  salted_session.ctx --enable-decrypt --enable-encrypt
 }
 
 #

Here is the result.

image

If this fix is suitable, I can also submit a merge request. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions