-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify how Aes128KeyHandle works #30718
Comments
I agree with Boris' comment that the common code should not assume the key handle always holds a raw key. We expect that in the future there's going to be push towards better isolation of applications from security material, so it's worth designing interfaces allowing for that. I think that you could probably write this code in a way that copying is not necessary. Perhaps, we could just make |
So right now ICD code assumes that We need to figure out how to make those bits work without that, or to make it OK to do that, right? In particular, unlike session keys the symmetric keys used for ICD need to be persistable somehow... |
Also,
which assume that the raw key bytes are available, right? |
Hmm, right, this HMAC usage also looks incorrect. I think that we have the following options: b) hard, secure: If we have limited manpower, it may also be a good idea to go with a) for the time being and plan for b) in the future. |
Sooo For the HMAC part, seems like we are missing an API that takes the KeyHandle directly and do the conversion between KeyID for Hard Secure and Raw key depending on the Implementation specified for Crypto. For all other Crypto APIs using the keyhandle directly prevent this kind of issue. Moreover as discussed on Slack, we need a way to copy/store/retrieve KeyHandle for Symmetric KeyStore. As of now there is nothing perfect for all parts of code that uses symmetric KeyStore with this implementation being the "Least worst" E.G. For Groups Symmetric Keys are stored in Plain Text no matter way kind of Crypto Implementation you're using. At boot they are loaded from Persistent Storage and then a KeyHandle is created from the plain text and stored in RAM for the rest of the life of the program. For Checkin Message, we are creating a new key from a PlainText data only once. Afterwards we are storing the content of the KeyHandle in Persistent storage and hacking our way at each load/save by copy pasting the content of one KeyHandle t another one. This works because we don't actually care if the content that we are copying is a KeyId or a Plain Text key. However looks like some API absolutely needs a plain text key which is absurd and we definitively need to fix those api to make usage of a KeyHandle |
For the server side implementation for the ICD management of keys, these are the two issues i see
Based on this, i don't think we need to implemente a "new" key back end. We would just need to update the available APIs in the SessionKeystore. |
And in particular, doesn't whether a keyhandle is in fact a Aes128KeyByteArray depend on the crypto implementation involved?
Or do I completely misunderstand how
Aes128KeyHandle
works?@Damian-Nordic how can this be set up to work?
Followup is fine to sort this out.
Originally posted by @bzbarsky-apple in #29783 (comment)
The text was updated successfully, but these errors were encountered: