mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-01-03 15:39:32 +00:00
tpm_ioctl: convert blob type to 32 bit int
Convert the blob type to 32bit int (while we still can do that ... ) Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
parent
8f3b270ab0
commit
857daa32b9
@ -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;
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user