Skip to content

Commit bcb0676

Browse files
authored
fix: failed to open a persistent key, ERR: -140 (onomondo#99)
1 parent fd94265 commit bcb0676

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ss_crypto.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,11 @@ int ss_utils_setup_key_helper(size_t key_len, uint8_t key[static key_len], int k
266266
LOG_ERR("Failed to destroy a persistent key, ERR: %d", status);
267267
return -1;
268268
}
269-
} else if (status != PSA_SUCCESS) {
270-
LOG_ERR("Failed to open a persistent key, ERR: %d", status);
271-
return -1;
272269
} else if (status == PSA_ERROR_DOES_NOT_EXIST) {
273270
LOG_DBG("Key %d does not exist, proceeding to import", key_id);
271+
} else {
272+
LOG_ERR("Failed to open a persistent key, ERR: %d", status);
273+
return -1;
274274
}
275275

276276
psa_set_key_usage_flags(&key_attributes, usage_flags);

0 commit comments

Comments
 (0)