diff options
author | Ian Lepore <ian@FreeBSD.org> | 2018-07-13 17:50:25 +0000 |
---|---|---|
committer | Ian Lepore <ian@FreeBSD.org> | 2018-07-13 17:50:25 +0000 |
commit | c1418270b28edf9b99044181e9f48dfc0a7dc160 (patch) | |
tree | 7a3117380cd78465ddbc331e510018710a64f701 /stand/i386/libi386/bootinfo64.c | |
parent | 6ac05ba48600d2174b455f3773059bfbbfb9858c (diff) |
Extend loader(8) geli support to all architectures and all disk-like devices.
This moves the bulk of the geli support from lib386/biosdisk.c into a new
geli/gelidev.c which implements a devsw-type device whose dv_strategy()
function handles geli decryption. Support for all arches comes from moving
the taste-and-attach code to the devopen() function in libsa.
After opening any DEVT_DISK device, devopen() calls the new function
geli_probe_and_attach(), which will "attach" the geli code to the open_file
struct by creating a geli_devdesc instance to replace the disk_devdesc
instance in the open_file. That routes all IO for the device through the
geli code.
A new public geli_add_key() function is added, to allow arch/vendor-specific
code to add keys obtained from custom hardware or other sources.
With these changes, geli support will be compiled into all variations of
loader(8) on all arches because the default is WITH_LOADER_GELI.
Relnotes: yes
Sponsored by: Microchip Technology Inc
Differential Revision: https://reviews.freebsd.org/D15743
Notes
Notes:
svn path=/head/; revision=336252
Diffstat (limited to 'stand/i386/libi386/bootinfo64.c')
-rw-r--r-- | stand/i386/libi386/bootinfo64.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/stand/i386/libi386/bootinfo64.c b/stand/i386/libi386/bootinfo64.c index 80bb8357a113..c9e61cac7414 100644 --- a/stand/i386/libi386/bootinfo64.c +++ b/stand/i386/libi386/bootinfo64.c @@ -42,9 +42,6 @@ __FBSDID("$FreeBSD$"); #ifdef LOADER_GELI_SUPPORT #include "geliboot.h" - -static const size_t keybuf_size = sizeof(struct keybuf) + - (GELI_MAX_KEYS * sizeof(struct keybuf_ent)); #endif /* @@ -196,10 +193,6 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, vm_offset_t size; char *rootdevname; int howto; -#ifdef LOADER_GELI_SUPPORT - char buf[keybuf_size]; - struct keybuf *keybuf = (struct keybuf *)buf; -#endif if (!bi_checkcpu()) { printf("CPU doesn't support long mode\n"); @@ -248,11 +241,8 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t *modulep, file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof module, &module); if (add_smap != 0) bios_addsmapdata(kfp); - #ifdef LOADER_GELI_SUPPORT - geli_fill_keybuf(keybuf); - file_addmetadata(kfp, MODINFOMD_KEYBUF, keybuf_size, buf); - bzero(buf, sizeof(buf)); + geli_export_key_metadata(kfp); #endif size = bi_copymodules64(0); |