diff --git a/src/swtpm/cuse_tpm.c b/src/swtpm/cuse_tpm.c index db37ff49..4b2914c0 100644 --- a/src/swtpm/cuse_tpm.c +++ b/src/swtpm/cuse_tpm.c @@ -646,10 +646,13 @@ ptm_set_stateblob_append(uint32_t blobtype, stateblob.is_encrypted, 0 /* tpm_number */, blobname); + if (res == TPM_SUCCESS && stateblob.length) + res = tpmlib_validate_blob(blobtype); } else { res = TPM_BAD_PARAMETER; } + TPM_Free(stateblob.data); stateblob.data = NULL; stateblob.length = 0;