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.

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.

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