Lines Matching refs:header

485     memcpy(metadata.get(), &v->header, sizeof(v->header));  in rewrite_metadata()
490 check(sizeof(v->header) + len <= VERITY_METADATA_SIZE); in rewrite_metadata()
491 memcpy(metadata.get() + sizeof(v->header), v->table.data(), len); in rewrite_metadata()
496 static int validate_header(const fec_handle *f, const verity_header *header, in validate_header() argument
500 check(header); in validate_header()
502 if (header->magic != VERITY_MAGIC && in validate_header()
503 header->magic != VERITY_MAGIC_DISABLE) { in validate_header()
507 if (header->version != VERITY_VERSION) { in validate_header()
508 error("unsupported verity version %u", header->version); in validate_header()
512 if (header->length < VERITY_MIN_TABLE_SIZE || in validate_header()
513 header->length > VERITY_MAX_TABLE_SIZE) { in validate_header()
516 stringify(VERITY_MAX_TABLE_SIZE) ")", header->length); in validate_header()
524 if (offset > UINT64_MAX - header->length) { in validate_header()
525 error("invalid verity table length: %u", header->length); in validate_header()
527 } else if (offset + header->length >= f->data_size) { in validate_header()
528 error("invalid verity table length: %u", header->length); in validate_header()
551 if (!raw_pread(f->fd, &v->header, sizeof(v->header), offset)) { in verity_parse_header()
558 if (v->header.magic == VERITY_MAGIC_DISABLE) { in verity_parse_header()
570 if (validate_header(f, &v->header, offset)) { in verity_parse_header()
579 if (!v->disabled && v->header.magic != v->ecc_header.magic) { in verity_parse_header()
581 v->header.magic = v->ecc_header.magic; in verity_parse_header()
584 if (v->header.version != v->ecc_header.version) { in verity_parse_header()
586 v->header.version = v->ecc_header.version; in verity_parse_header()
589 if (v->header.length != v->ecc_header.length) { in verity_parse_header()
591 v->header.length = v->ecc_header.length; in verity_parse_header()
594 if (memcmp(v->header.signature, v->ecc_header.signature, in verity_parse_header()
595 sizeof(v->header.signature))) { in verity_parse_header()
604 if (parse_table(f, offset + sizeof(v->header), v->header.length, in verity_parse_header()
606 parse_table(f, offset + sizeof(v->header), v->header.length, in verity_parse_header()