Open athoelke opened 2 years ago
I'm a little worried about the possibility of having too much detail about why an image fails (invalid signature vs some of the other data) and that being able to be used for an oracle attack. In other words, I like the idea of simplifying the error messages, and to collapse most down to invalid signature). We would want to make sure there isn't any advantage given to an attacker from being able to distinguish INVALID_SIGNATURE from INVALID_ARGUMENT.
I have the same concern - the historical precedent being providing a distinction between invalid padding and invalid content. I am not sure that this extends to INVALID_SIGNATURE vs INVALID_ARGUMENT. We could tighten up the use of these. For example:
This way, until an image passes the integrity check the call will only return INVALID_SIGNATURE. We assume that the signature/integrity check is cryptographically hard enough.
If the Update Service is a secure implementation (inside a Root of Trust), then reducing the information in the failure code reduces the benefit to an attacker - but makes diagnostic of a problem much harder. I would expect this kind of implementation to have some kind of secure audit log that might record the update attempt and failure?
If the implementation is purely a HAL, then it is unlikely to diagnose different failure conditions - it expects that the Client is responsible for most of that.
The v0.7 API defines a set of API-specific error codes that are documented to be used with the
psa_fwu_install()
function, andpsa_fwu_set_manifest()
, that report specific verification failure conditions. The separately reported errors are as follows (seepsa_fwu_install()
andpsa_fwu_set_manifest()
):PSA_ERROR_NOT_PERMITTED
PSA_ERROR_WRONG_DEVICE
PSA_ERROR_INVALID_SIGNATURE
PSA_ERROR_DATA_CORRUPT
PSA_ERROR_INSUFFICIENT_DATA
PSA_ERROR_DECRYPTION_FAILURE
PSA_ERROR_ALREADY_INSTALLED
PSA_ERROR_DEPENDENCY_NEEDED
PSA_SUCCESS_DEPENDENCY_NEEDED
psa_fwu_install()
could return either. Although the latter assumes that installation is successful - it depends on the caller actually installing the dependency. What happens if the caller does not do this? - what state is the firmware in?Proposal