Lines Matching refs:mgr
23 int vtpm_sync_disk(struct mem_tpm_mgr *mgr, int depth) in vtpm_sync_disk() argument
25 int old_active_root = mgr->active_root; in vtpm_sync_disk()
29 struct mem_group *group0 = mgr->groups[0].v; in vtpm_sync_disk()
35 mgr->sequence++; in vtpm_sync_disk()
36 mgr->active_root = new_active_root; in vtpm_sync_disk()
41 uint32_t ctr = be32_native(mgr->counter_value); in vtpm_sync_disk()
42 mgr->counter_value = native_be32(ctr + 1); in vtpm_sync_disk()
48 mgr->root_seals_valid = 0; in vtpm_sync_disk()
49 do_random(&mgr->tm_key, 16); in vtpm_sync_disk()
50 aes_setup(&mgr->tm_key_e, &mgr->tm_key); in vtpm_sync_disk()
51 do_random(&mgr->nv_key, 16); in vtpm_sync_disk()
52 for(i=0; i < mgr->nr_groups; i++) { in vtpm_sync_disk()
58 mgr->root_seals_valid = 0; in vtpm_sync_disk()
59 memcpy(&prev, &mgr->counter_auth, 20); in vtpm_sync_disk()
60 do_random(&mgr->counter_auth, 20); in vtpm_sync_disk()
63 mgr->root_seals_valid = 0; in vtpm_sync_disk()
64 memcpy(&prev, &mgr->nvram_auth, 20); in vtpm_sync_disk()
65 do_random(&mgr->nvram_auth, 20); in vtpm_sync_disk()
69 disk_write_all(mgr); in vtpm_sync_disk()
76 rc = TPM_disk_incr_counter(mgr->counter_index, mgr->counter_auth); in vtpm_sync_disk()
78 uint32_t ctr = be32_native(mgr->counter_value); in vtpm_sync_disk()
79 mgr->counter_value = native_be32(ctr - 1); in vtpm_sync_disk()
80 mgr->active_root = old_active_root; in vtpm_sync_disk()
86 rc = TPM_disk_nvwrite(&mgr->nv_key, 16, mgr->nvram_slot, mgr->nvram_auth); in vtpm_sync_disk()
92 rc = TPM_disk_change_counter(mgr->counter_index, prev, mgr->counter_auth); in vtpm_sync_disk()
98 rc = TPM_disk_nvchange(mgr->nvram_slot, prev, mgr->nvram_auth); in vtpm_sync_disk()
107 static struct mem_group_hdr* find_mem_group_hdr(struct mem_tpm_mgr *mgr, struct mem_group *group) in find_mem_group_hdr() argument
110 for (i = 0; i < mgr->nr_groups; i++) { in find_mem_group_hdr()
111 struct mem_group_hdr *hdr = mgr->groups + i; in find_mem_group_hdr()