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

Function test_LUKS

src/luks.c:49–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49static int test_LUKS(const disk_t *disk_car, const struct luks_phdr *sb, const partition_t *partition, const int dump_ind)
50{
51 static const uint8_t LUKS_MAGIC[LUKS_MAGIC_L] = {'L','U','K','S', 0xba, 0xbe};
52 if(memcmp(sb->magic, LUKS_MAGIC, LUKS_MAGIC_L)!=0)
53 return 1;
54 if(dump_ind!=0)
55 {
56 if(partition!=NULL && disk_car!=NULL)
57 log_info("\nLUKS magic value at %u/%u/%u\n",
58 offset2cylinder(disk_car,partition->part_offset),
59 offset2head(disk_car,partition->part_offset),
60 offset2sector(disk_car,partition->part_offset));
61 dump_log(sb,DEFAULT_SECTOR_SIZE);
62 }
63 return 0;
64}
65
66int check_LUKS(disk_t *disk_car,partition_t *partition)
67{

Callers 2

check_LUKSFunction · 0.85
recover_LUKSFunction · 0.85

Calls 4

offset2cylinderFunction · 0.85
offset2headFunction · 0.85
offset2sectorFunction · 0.85
dump_logFunction · 0.85

Tested by

no test coverage detected