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:
@@ -27,7 +27,7 @@ uint8_t get_key_domain(file_t *fkey) {
|
||||
if (meta_tag) {
|
||||
return *meta_tag;
|
||||
}
|
||||
return 0;
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
int cmd_key_domain() {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user