Changeset View
Changeset View
Standalone View
Standalone View
head/sys/boot/geli/geliboot.c
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | geli_taste(int read_func(void *vdev, void *priv, off_t off, void *buf, | ||||
} | } | ||||
/* Extract the last DEV_BSIZE bytes from the block. */ | /* Extract the last DEV_BSIZE bytes from the block. */ | ||||
error = eli_metadata_decode(buf + (DEV_GELIBOOT_BSIZE - DEV_BSIZE), | error = eli_metadata_decode(buf + (DEV_GELIBOOT_BSIZE - DEV_BSIZE), | ||||
&md); | &md); | ||||
if (error != 0) { | if (error != 0) { | ||||
return (error); | return (error); | ||||
} | } | ||||
if ((md.md_flags & G_ELI_FLAG_ONETIME)) { | if (!(md.md_flags & G_ELI_FLAG_GELIBOOT)) { | ||||
/* Swap device, skip it. */ | /* The GELIBOOT feature is not activated */ | ||||
return (1); | return (1); | ||||
} | } | ||||
if (!(md.md_flags & G_ELI_FLAG_BOOT)) { | if ((md.md_flags & G_ELI_FLAG_ONETIME)) { | ||||
/* Disk is not GELI boot device, skip it. */ | /* Swap device, skip it. */ | ||||
return (1); | return (1); | ||||
} | } | ||||
if (md.md_iterations < 0) { | if (md.md_iterations < 0) { | ||||
/* XXX TODO: Support loading key files. */ | /* XXX TODO: Support loading key files. */ | ||||
/* Disk does not have a passphrase, skip it. */ | /* Disk does not have a passphrase, skip it. */ | ||||
return (1); | return (1); | ||||
} | } | ||||
geli_e = malloc(sizeof(struct geli_entry)); | geli_e = malloc(sizeof(struct geli_entry)); | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |