[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/7] Cryptomount support LUKS detached header
From: |
John Lane |
Subject: |
Re: [PATCH 1/7] Cryptomount support LUKS detached header |
Date: |
Sun, 18 Mar 2018 20:29:39 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 17/03/18 11:09, TJ wrote:
> On 14/03/18 09:44, John Lane wrote:
>> --- a/grub-core/disk/cryptodisk.c
>> +++ b/grub-core/disk/cryptodisk.c
>> @@ -880,7 +882,7 @@ grub_cryptodisk_cheat_mount (const char *sourcedev,
>> const char *cheat)
>>
>> FOR_CRYPTODISK_DEVS (cr)
>> {
>> - dev = cr->scan (source, search_uuid, check_boot);
>> + dev = cr->scan (source, search_uuid, check_boot,0);
>
> Minor nit; "boot,0" > "boot, 0"
>
>> @@ -934,6 +936,18 @@ grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int
>> argc, char **args)
>> if (argc < 1 && !state[1].set && !state[2].set)
>> return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required");
>>
>> + if (state[3].set) /* LUKS detached header */
>> + {
>> + if (state[0].set) /* Cannot use UUID lookup with detached header */
>
> Should there be specific warning for the user here, at least for #ifdef
> GRUB_UTIL
>
>> --- a/grub-core/disk/luks.c
>> +++ b/grub-core/disk/luks.c
>> @@ -391,13 +415,18 @@ luks_recover_key (grub_disk_t source,
>> return grub_crypto_gcry_error (gcry_err);
>> }
>>
>> + sector = grub_be_to_cpu32 (header.keyblock[i].keyMaterialOffset);
>> length = (keysize * grub_be_to_cpu32 (header.keyblock[i].stripes));
>>
>> /* Read and decrypt the key material from the disk. */
>> - err = grub_disk_read (source,
>> - grub_be_to_cpu32 (header.keyblock
>> - [i].keyMaterialOffset), 0,
>> - length, split_key);
>> + if (hdr)
>> + {
>> + grub_file_seek (hdr, sector * 512);
>
> Shouldn't 512 be GRUB_DISK_SECTOR_SIZE ?
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
I have applied these changes. Builds clean but I need to test it. I
might have time to do that tomorrow, otherwise next weekend will be soonest.
- [PATCH 7/7] Add support for using a whole device as a keyfile, (continued)
- [PATCH 7/7] Add support for using a whole device as a keyfile, John Lane, 2018/03/14
- [PATCH 6/7] Retain constness of parameters., John Lane, 2018/03/14
- Re: [PATCH 1/7] Cryptomount support LUKS detached header, Daniel Kiper, 2018/03/14
- Re: [PATCH 1/7] Cryptomount support LUKS detached header, John Lane, 2018/03/14
- Re: [PATCH 1/7] Cryptomount support LUKS detached header, Paul Menzel, 2018/03/21
- Re: [PATCH 1/7] Cryptomount support LUKS detached header, Daniel Kiper, 2018/03/22
- Re: [PATCH 1/7] Cryptomount support LUKS detached header, TJ, 2018/03/22
- Re: [PATCH 1/7] Cryptomount support LUKS detached header, John Lane, 2018/03/26
- Re: [PATCH 1/7] Cryptomount support LUKS detached header, Daniel Kiper, 2018/03/26
Re: [PATCH 1/7] Cryptomount support LUKS detached header, TJ, 2018/03/17
- Re: [PATCH 1/7] Cryptomount support LUKS detached header,
John Lane <=