diff options
Diffstat (limited to 'lib/pb-protocol/pb-protocol.c')
-rw-r--r-- | lib/pb-protocol/pb-protocol.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/pb-protocol/pb-protocol.c b/lib/pb-protocol/pb-protocol.c index e0cef36..06c81f2 100644 --- a/lib/pb-protocol/pb-protocol.c +++ b/lib/pb-protocol/pb-protocol.c @@ -272,6 +272,9 @@ int pb_protocol_system_info_len(const struct system_info *sysinfo) 4 + optional_strlen(bd_info->mountpoint); } + /* stb info */ + len += 3 * sizeof(bool); + return len; } @@ -560,6 +563,13 @@ int pb_protocol_serialise_system_info(const struct system_info *sysinfo, memset(pos, 0, HWADDR_SIZE); pos += HWADDR_SIZE; + *(bool *)pos = sysinfo->stb_fw_measurement; + pos += sizeof(bool); + *(bool *)pos = sysinfo->stb_fw_enforcing; + pos += sizeof(bool); + *(bool *)pos = sysinfo->stb_os_enforcing; + pos += sizeof(bool); + assert(pos <= buf + buf_len); return (pos <= buf + buf_len) ? 0 : -1; @@ -1160,6 +1170,14 @@ int pb_protocol_deserialise_system_info(struct system_info *sysinfo, pos += HWADDR_SIZE; len -= HWADDR_SIZE; + sysinfo->stb_fw_measurement = !!*pos; + pos += sizeof(bool); + sysinfo->stb_fw_enforcing = !!*pos; + pos += sizeof(bool); + sysinfo->stb_os_enforcing = !!*pos; + pos += sizeof(bool); + len -= 3 * sizeof(bool); + rc = 0; out: return rc; |