Lines 60-65
Link Here
|
60 |
|
60 |
|
61 |
#define GELI_BACKUP_DIR "/var/backups/" |
61 |
#define GELI_BACKUP_DIR "/var/backups/" |
62 |
#define GELI_ENC_ALGO "aes" |
62 |
#define GELI_ENC_ALGO "aes" |
|
|
63 |
#define GELI_VERSION "6" |
63 |
|
64 |
|
64 |
static void eli_main(struct gctl_req *req, unsigned flags); |
65 |
static void eli_main(struct gctl_req *req, unsigned flags); |
65 |
static void eli_init(struct gctl_req *req); |
66 |
static void eli_init(struct gctl_req *req); |
Lines 81-87
Link Here
|
81 |
/* |
82 |
/* |
82 |
* Available commands: |
83 |
* Available commands: |
83 |
* |
84 |
* |
84 |
* init [-bhPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] prov |
85 |
* init [-bhPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-V version] prov |
85 |
* label - alias for 'init' |
86 |
* label - alias for 'init' |
86 |
* attach [-dprv] [-j passfile] [-k keyfile] prov |
87 |
* attach [-dprv] [-j passfile] [-k keyfile] prov |
87 |
* detach [-fl] prov ... |
88 |
* detach [-fl] prov ... |
Lines 112-120
Link Here
|
112 |
{ 'l', "keylen", "0", G_TYPE_NUMBER }, |
113 |
{ 'l', "keylen", "0", G_TYPE_NUMBER }, |
113 |
{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, |
114 |
{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, |
114 |
{ 's', "sectorsize", "0", G_TYPE_NUMBER }, |
115 |
{ 's', "sectorsize", "0", G_TYPE_NUMBER }, |
|
|
116 |
{ 'V', "eliversion", GELI_VERSION, G_TYPE_NUMBER }, |
115 |
G_OPT_SENTINEL |
117 |
G_OPT_SENTINEL |
116 |
}, |
118 |
}, |
117 |
"[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] prov" |
119 |
"[-bPv] [-a aalgo] [-B backupfile] [-e ealgo] [-i iterations] [-l keylen] [-J newpassfile] [-K newkeyfile] [-s sectorsize] [-V version] prov" |
118 |
}, |
120 |
}, |
119 |
{ "label", G_FLAG_VERBOSE, eli_main, |
121 |
{ "label", G_FLAG_VERBOSE, eli_main, |
120 |
{ |
122 |
{ |
Lines 128-133
Link Here
|
128 |
{ 'l', "keylen", "0", G_TYPE_NUMBER }, |
130 |
{ 'l', "keylen", "0", G_TYPE_NUMBER }, |
129 |
{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, |
131 |
{ 'P', "nonewpassphrase", NULL, G_TYPE_BOOL }, |
130 |
{ 's', "sectorsize", "0", G_TYPE_NUMBER }, |
132 |
{ 's', "sectorsize", "0", G_TYPE_NUMBER }, |
|
|
133 |
{ 'V', "eliversion", GELI_VERSION, G_TYPE_NUMBER }, |
131 |
G_OPT_SENTINEL |
134 |
G_OPT_SENTINEL |
132 |
}, |
135 |
}, |
133 |
"- an alias for 'init'" |
136 |
"- an alias for 'init'" |
Lines 673-681
Link Here
|
673 |
return; |
676 |
return; |
674 |
} |
677 |
} |
675 |
|
678 |
|
|
|
679 |
version = gctl_get_intmax(req, "eliversion"); |
680 |
if (G_ELI_VERSION_06 < version) { |
681 |
gctl_error(req, "Invalid metadata version (must be between %d " |
682 |
"and %d): %d", G_ELI_VERSION_00, G_ELI_VERSION_06, |
683 |
version); |
684 |
return; |
685 |
} |
676 |
bzero(&md, sizeof(md)); |
686 |
bzero(&md, sizeof(md)); |
677 |
strlcpy(md.md_magic, G_ELI_MAGIC, sizeof(md.md_magic)); |
687 |
strlcpy(md.md_magic, G_ELI_MAGIC, sizeof(md.md_magic)); |
678 |
md.md_version = G_ELI_VERSION; |
688 |
md.md_version = version; |
679 |
md.md_flags = 0; |
689 |
md.md_flags = 0; |
680 |
if (gctl_get_int(req, "boot")) |
690 |
if (gctl_get_int(req, "boot")) |
681 |
md.md_flags |= G_ELI_FLAG_BOOT; |
691 |
md.md_flags |= G_ELI_FLAG_BOOT; |