| 1315 | } |
| 1316 | |
| 1317 | static void init_manifest_header(struct manifest_header *hdr, size_t size) |
| 1318 | { |
| 1319 | memset(hdr, 0, sizeof(*hdr)); |
| 1320 | |
| 1321 | hdr->header_type = 0x4; |
| 1322 | assert((MANIFEST_HDR_SIZE % DWORD_SIZE) == 0); |
| 1323 | hdr->header_length = MANIFEST_HDR_SIZE / DWORD_SIZE; |
| 1324 | hdr->header_version = 0x10000; |
| 1325 | hdr->vendor = 0x8086; |
| 1326 | |
| 1327 | struct tm *local_time; |
| 1328 | time_t curr_time; |
| 1329 | char buffer[11]; |
| 1330 | |
| 1331 | curr_time = time(NULL); |
| 1332 | local_time = localtime(&curr_time); |
| 1333 | strftime(buffer, sizeof(buffer), "0x%Y%m%d", local_time); |
| 1334 | hdr->date = strtoul(buffer, NULL, 16); |
| 1335 | |
| 1336 | assert((size % DWORD_SIZE) == 0); |
| 1337 | hdr->size = size / DWORD_SIZE; |
| 1338 | hdr->id = MANIFEST_ID_MAGIC; |
| 1339 | } |
| 1340 | |
| 1341 | static void init_signed_pkg_info_ext(struct signed_pkg_info_ext *ext, |
| 1342 | size_t count, const char *name) |
no test coverage detected