Commit abe3fb4a authored by Milan Broz's avatar Milan Broz

Return no encryption if segment is not crypt type.

Currently the code expects "cipher" everywhere, this is temporary
workaround to enable basic operations if other segmens are present
in metadata.
parent 39905bd8
......@@ -1650,10 +1650,12 @@ const char *LUKS2_get_cipher(struct luks2_hdr *hdr, int segment)
if (!json_object_object_get_ex(jobj1, buf, &jobj2))
return NULL;
if (!json_object_object_get_ex(jobj2, "encryption", &jobj3))
return NULL;
if (json_object_object_get_ex(jobj2, "encryption", &jobj3))
return json_object_get_string(jobj3);
/* FIXME: default encryption (for other segment types) must be string here. */
return "null";
return json_object_get_string(jobj3);
}
static int luks2_keyslot_af_params(json_object *jobj_af, struct luks2_keyslot_params *params)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment