Skip to content
Snippets Groups Projects
Commit 01a2025d authored by Arie Peterson's avatar Arie Peterson
Browse files

Deal with failure of crypt_keyslot_max

parent 90bd751a
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,14 @@ int callback_encryption_keys_get(const struct _u_request * request, ...@@ -34,7 +34,14 @@ int callback_encryption_keys_get(const struct _u_request * request,
bool in_use; bool in_use;
bool last_used; bool last_used;
int keyslot = 0; int keyslot = 0;
for (keyslot = 0; keyslot <= crypt_keyslot_max(CRYPT_LUKS1); keyslot++) int keyslot_max = crypt_keyslot_max(CRYPT_LUKS1);
if (keyslot_max < 0)
{
return send_simple_response(response, 500, "error",
"crypt_keyslot_max failed");
}
for (keyslot = 0; keyslot < keyslot_max; keyslot++)
{ {
// Create new json object containing info for this keyslot. // Create new json object containing info for this keyslot.
key = json_object(); key = json_object();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment