Check json size matches value from binary LUKS2 header.

We have max json area length parameter stored twice. In
LUKS2 binary header and in json metadata. Those two values
must match.
This commit is contained in:
Ondrej Kozina
2018-11-20 18:23:20 +01:00
committed by Milan Broz
parent c3a54aa59a
commit 21e259d1a4
4 changed files with 22 additions and 14 deletions

View File

@@ -73,7 +73,7 @@ void JSON_DBG(json_object *jobj, const char *desc);
json_object *json_contains(json_object *jobj, const char *name, const char *section,
const char *key, json_type type);
int LUKS2_hdr_validate(json_object *hdr_jobj);
int LUKS2_hdr_validate(json_object *hdr_jobj, uint64_t length);
int LUKS2_keyslot_validate(json_object *hdr_jobj, json_object *hdr_keyslot, const char *key);
int LUKS2_check_json_size(const struct luks2_hdr *hdr);
int LUKS2_token_validate(json_object *hdr_jobj, json_object *jobj_token, const char *key);