Lines Matching defs:header

53 /* Extension header types */
156 int8_t key_index; /* For header signatures verification only */
185 printf(" image header\n");
536 * Verify CSK array, header and image signatures and print results
538 * main_hdr Main header
551 /* Save headers signature and reset it in the secure header */
803 ext_header_t header;
818 header.type = EXT_TYPE_SECURITY;
819 header.offset = 0;
820 header.size = sizeof(sec_entry_t);
821 header.reserved = 0;
881 /* In the header DER data is aligned
957 * (image and header signature fields are still empty)
960 /* Write extension header */
961 written = fwrite(&header, sizeof(ext_header_t), 1, out_fd);
964 "Failed to write SEC extension header to the file\n");
980 * Make final changes to secure extension - calculate image and header
982 * The main header checksum and image size fields updated accordingly
984 * header Main header
994 int finalize_secure_ext(header_t *header,
1006 cur_ext < header->ext_count; cur_ext++) {
1016 /* If offset is Zero, the extension follows its header */
1042 header->boot_image_size = final_image_sz;
1043 header->boot_image_checksum =
1048 * signed along with the header signature
1071 * when the header signature field is empty
1079 fprintf(stderr, "Failed to sign header!\n");
1082 /* Check that the header signature is correct */
1089 fprintf(stderr, "Failed to verify header signature!\n");
1093 /* Finally, copy the header signature into the trusted boot extension */
1189 do_print_field(0, "header signature",
1286 /* clear the checksum field in header to calculate checksum */
1362 ext_header_t header;
1385 header.type = EXT_TYPE_BINARY;
1386 header.offset = 0;
1387 header.size = aligned_size;
1388 header.reserved = 0;
1390 /* Write header */
1391 written = fwrite(&header, sizeof(ext_header_t), 1, out_fd);
1393 fprintf(stderr, "failed writing header to extension file\n");
1451 void update_uart(header_t *header)
1453 header->uart_cfg = 0;
1454 header->baudrate = 0;
1457 uart_set_mode(header->uart_cfg, UART_MODE_DISABLE);
1460 header->baudrate = (opts.baudrate / 1200);
1466 * main header and extensions, to file
1473 header_t *header;
1495 header = (header_t *)buf;
1496 header->magic = MAIN_HDR_MAGIC;
1497 header->prolog_size = prolog_size;
1498 header->load_addr = opts.load_addr;
1499 header->exec_addr = opts.exec_addr;
1500 header->io_arg_0 = opts.nfc_io_args;
1501 header->ext_count = ext_cnt;
1502 header->aux_flags = 0;
1503 header->boot_image_size = (image_size + 3) & (~0x3);
1504 header->boot_image_checksum = checksum32((uint32_t *)image_buf,
1507 update_uart(header);
1509 /* Populate buffer with main header and extensions */
1529 ret = finalize_secure_ext(header, (uint8_t *)buf,
1542 header->prolog_checksum = checksum32((uint32_t *)buf, prolog_size);