Commit c4fa8813 authored by Ondrej Kozina's avatar Ondrej Kozina

luks1: cleanup for added checks

related to bef56af7
parent d02b291e
......@@ -68,13 +68,12 @@ int LUKS_keyslot_area(const struct luks_phdr *hdr,
return 0;
}
/* because the array has 8 elements and it's mostly sorted. that's why */
static void _insertsort(int *array, int high, const void *usrptr)
/* insertsort: because the array has 8 elements and it's mostly sorted. that's why */
static void LUKS_sort_keyslots(const struct luks_phdr *hdr, int *array)
{
const struct luks_phdr *hdr = (const struct luks_phdr *)usrptr;
int i, j, x;
for (i = 1; i < high; i++) {
for (i = 1; i < LUKS_NUMKEYS; i++) {
j = i;
while (j > 0 && hdr->keyblock[array[j-1]].keyMaterialOffset > hdr->keyblock[array[j]].keyMaterialOffset) {
x = array[j];
......@@ -85,11 +84,6 @@ static void _insertsort(int *array, int high, const void *usrptr)
}
}
static void LUKS_sort_keyslots(const struct luks_phdr *phdr, int *sorted_areas)
{
_insertsort(sorted_areas, LUKS_NUMKEYS, phdr);
}
static size_t LUKS_device_sectors(const struct luks_phdr *hdr)
{
int sorted_areas[LUKS_NUMKEYS] = { 0, 1, 2, 3, 4, 5, 6, 7 };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment