MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / check_LUKS

Function check_LUKS

src/luks.c:66–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66int check_LUKS(disk_t *disk_car,partition_t *partition)
67{
68 unsigned char *buffer=(unsigned char*)MALLOC(DEFAULT_SECTOR_SIZE);
69 if(disk_car->pread(disk_car, buffer, DEFAULT_SECTOR_SIZE, partition->part_offset) != DEFAULT_SECTOR_SIZE)
70 {
71 free(buffer);
72 return 1;
73 }
74 if(test_LUKS(disk_car, (struct luks_phdr*)buffer, partition, 0)!=0)
75 {
76 free(buffer);
77 return 1;
78 }
79 set_LUKS_info((struct luks_phdr*)buffer, partition);
80 free(buffer);
81 return 0;
82}
83
84int recover_LUKS(const disk_t *disk_car, const struct luks_phdr *sb,partition_t *partition,const int verbose, const int dump_ind)
85{

Callers 2

check_part_noneFunction · 0.85
check_linuxFunction · 0.85

Calls 3

MALLOCFunction · 0.85
test_LUKSFunction · 0.85
set_LUKS_infoFunction · 0.85

Tested by

no test coverage detected