If a key does not belong to any key domain, it cannot be wrapped.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-03-07 23:45:37 +01:00
parent 963456051e
commit 6aa8d37d07
2 changed files with 4 additions and 1 deletions

View File

@@ -32,6 +32,9 @@ int cmd_key_wrap() {
}
file_t *ef = search_dynamic_file((KEY_PREFIX << 8) | key_id);
uint8_t kdom = get_key_domain(ef);
if (kdom == 0xff) {
return SW_REFERENCE_NOT_FOUND();
}
if (!ef) {
return SW_FILE_NOT_FOUND();
}