sys/suit: add suit_get_public_key()#21560
Conversation
crasbe
left a comment
There was a problem hiding this comment.
I'm not sure about that function.
Is it a good idea to give an application the address of the key storage? Without memory protection, you could just iterate through the memory and possibly get to the private key storage.
However I'm not sure if that's really a concern, since you could just do that anyways.
Also writing the address to a void pointer-pointer feels somewhat sketchy.
I get your feeling but the honest answer is that RIOTs security model does not account for this, sadly. There would be tricks to use the MPU/PMP/etc but without access rights management (maschine-/usermode) thats always a bit pointless. What concerncs me more is that this API would be in conflict with any move towards such memory protection in the future. (I would still ack it)
Yes. I would love to see a bit of Cs "typesafety" here (lol). Isn't the keytype/struct known in advance? |
eaa0643 to
9f45339
Compare
|
You are right, we can just directly use |
9f45339 to
8bbe166
Compare
|
Are there remaining concerns about this PR? I think the changes look fine. The public_key array exists anyway and could be used by anyone. |
Contribution description
It can be handy to know which public keys are accepted by SUIT.
This adds a simple helper function
suit_get_public_key()that gives access to the internalpublic_keyarray.Testing procedure
Issues/PRs references