diff --git a/include/swtpm/tpm_ioctl.h b/include/swtpm/tpm_ioctl.h index 18374fe..66c65db 100644 --- a/include/swtpm/tpm_ioctl.h +++ b/include/swtpm/tpm_ioctl.h @@ -97,7 +97,7 @@ struct ptm_getstate { struct { uint32_t state_flags; /* may be: STATE_FLAG_DECRYPTED */ uint32_t tpm_number; /* always set to zero */ - uint8_t type; /* which blob to pull */ + uint32_t type; /* which blob to pull */ uint32_t offset; /* offset from where to read */ } req; struct { @@ -129,7 +129,7 @@ struct ptm_setstate { struct { uint32_t state_flags; /* may be STATE_FLAG_ENCRYPTED */ uint32_t tpm_number; /* always set to 0 */ - uint8_t type; /* which blob to set */ + uint32_t type; /* which blob to set */ uint32_t length; uint8_t data[STATE_BLOB_SIZE]; } req; diff --git a/src/swtpm/cuse_tpm.c b/src/swtpm/cuse_tpm.c index 51a49ed..409c64c 100644 --- a/src/swtpm/cuse_tpm.c +++ b/src/swtpm/cuse_tpm.c @@ -425,7 +425,7 @@ error_terminate: * convert the blobtype integer into a string that libtpms * understands */ -static const char *ptm_get_blobname(uint8_t blobtype) +static const char *ptm_get_blobname(uint32_t blobtype) { switch (blobtype) { case PTM_BLOB_TYPE_PERMANENT: diff --git a/src/swtpm_ioctl/tpm_ioctl.c b/src/swtpm_ioctl/tpm_ioctl.c index 0ba1345..0f521c8 100644 --- a/src/swtpm_ioctl/tpm_ioctl.c +++ b/src/swtpm_ioctl/tpm_ioctl.c @@ -155,7 +155,7 @@ static int do_hash_start_data_end(int fd, const char *input) return 0; } -static uint8_t get_blobtype(const char *blobname) +static uint32_t get_blobtype(const char *blobname) { if (!strcmp(blobname, "permanent")) return PTM_BLOB_TYPE_PERMANENT; @@ -184,7 +184,7 @@ static int do_save_state_blob(int fd, const char *blobtype, ssize_t numbytes; bool had_error; int n; - uint8_t bt; + uint32_t bt; bt = get_blobtype(blobtype); if (!bt) { @@ -265,7 +265,7 @@ static int do_load_state_blob(int fd, const char *blobtype, ssize_t numbytes; bool had_error; int n; - uint8_t bt; + uint32_t bt; bt = get_blobtype(blobtype); if (!bt) {