MFC: sbin/geom/class/eli/geom_eli.c 1.4
Even if there are no valid keys in metadata, but provider is attached we can still use setkey subcommand. Found by: regression tests Approved by: re (scottl)
This commit is contained in:
parent
21628eb54c
commit
1bd06e2421
@ -727,6 +727,11 @@ eli_setkey_detached(struct gctl_req *req, const char *prov,
|
||||
unsigned nkey;
|
||||
int error;
|
||||
|
||||
if (md->md_keys == 0) {
|
||||
gctl_error(req, "No valid keys on %s.", prov);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Generate key for Master Key decryption. */
|
||||
if (eli_genkey(req, md, key, 0) == NULL) {
|
||||
bzero(key, sizeof(key));
|
||||
@ -838,11 +843,6 @@ eli_setkey(struct gctl_req *req)
|
||||
if (eli_metadata_read(req, prov, &md) == -1)
|
||||
return;
|
||||
|
||||
if (md.md_keys == 0) {
|
||||
gctl_error(req, "No valid keys on %s.", prov);
|
||||
return;
|
||||
}
|
||||
|
||||
if (eli_is_attached(prov))
|
||||
eli_setkey_attached(req, prov, &md);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user