-
Notifications
You must be signed in to change notification settings - Fork 6
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
WIP: Provide an optional auth value for a key #32
Conversation
This isn't working, but I'm posting it here so we can investigate why:
|
Obviously the soft errors are because it hasn't been implemented there yet, but the tpm errors concern me. |
Okay, there are two parts here. First, the error is the same as what occured with the machine keys. See https://github.com/kanidm/hsm-crypto/blob/main/src/tpm.rs#L523 What's happening is that when you have a TPM object with an authValue, when we unload it's context (to free memory on the TPM, because we can only store 3 objects at a time) to reload the context you needs it's authValue again. This means you need to duplicate what the MachineKey does where you have a storage key that has the authValue, then you have the actual key under that without the authValue. You can see this here https://github.com/kanidm/hsm-crypto/blob/main/src/lib.rs#L261 and it's why there is a private/public and an sk private/public. So this means you need to change https://github.com/kanidm/hsm-crypto/blob/main/src/lib.rs#L402 to have an sk_private/public and then the private/public and cek_private/public need to be subordinate to the authenticated sk. Second, is why are we adding auth values to all the other key types? I thought we only needed them on the MsOapxbcRsaKey for now to support the behaviours we needed? |
Actually, it's just a plain rsa 2048 key. The key enrollment requires a public rsa 2048 bcrypt blob. I was adding auth values for all of them because I modified the |
Also had to do with all of them calling |
Hrm, I see what you mean now. I was just adding the auth_value to every function signature that made sense to me in src/libs.rs, doh. |
Signed-off-by: David Mulder <[email protected]>
8731a08
to
1ec0303
Compare
Now I'm getting these errors:
Trying to track them down. |
TpmError::TpmIdentityKeyCreate | ||
})?; | ||
|
||
let storage_key_pub = Self::create_storage_key_public()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this storage_key_pub
is causing the error, but I don't know the correct parameters to build one of these. Reusing (or recreating) key_pub
from above causes the same error still.
) | ||
.map_err(|tpm_err| { | ||
error!(?tpm_err); | ||
TpmError::TpmIdentityKeyCreate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failure is happening right here.
I've fixed the TPM issue in a new PR. |
(Refers|Fixes) #
Checklist