Lines Matching refs:v
445 verity_info *v = &f->verity; in parse_table() local
446 if (v->metadata_start < hash_start) { in parse_table()
447 check(data_blocks == v->metadata_start / FEC_BLOCKSIZE); in parse_table()
452 v->table = std::move(table); in parse_table()
454 v->hashtree.initialize(hash_start, data_blocks, salt, NID_sha256); in parse_table()
456 if (v->hashtree.verify_tree(f, root) == -1) { in parse_table()
460 check(!v->hashtree.hash_data.empty()); in parse_table()
461 check(!v->hashtree.zero_hash.empty()); in parse_table()
484 verity_info *v = &f->verity; in rewrite_metadata() local
485 memcpy(metadata.get(), &v->header, sizeof(v->header)); in rewrite_metadata()
487 check(!v->table.empty()); in rewrite_metadata()
488 size_t len = v->table.size(); 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()
548 verity_info *v = &f->verity; in verity_parse_header() local
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()
561 v->disabled = true; in verity_parse_header()
564 if (fec_pread(f, &v->ecc_header, sizeof(v->ecc_header), offset) != in verity_parse_header()
565 sizeof(v->ecc_header)) { in verity_parse_header()
570 if (validate_header(f, &v->header, offset)) { in verity_parse_header()
574 if (validate_header(f, &v->ecc_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()
602 v->metadata_start = offset; 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()
618 if (v->metadata_start < v->hashtree.hash_start) { in verity_parse_header()
619 f->data_size = v->metadata_start; in verity_parse_header()
621 f->data_size = v->hashtree.hash_start; in verity_parse_header()
637 verity_info *v = &f->verity; in fec_verity_set_status() local
639 if (!v->metadata_start) { in fec_verity_set_status()
645 if (v->disabled == !enabled) { in fec_verity_set_status()
651 if (!raw_pwrite(f->fd, &magic, sizeof(magic), v->metadata_start)) { in fec_verity_set_status()
659 v->disabled = !enabled; in fec_verity_set_status()