Conversation
f4eef27 to
e53e243
Compare
* Replace CustomHardwareKeyPrompt in ParsePrivateKeyOpts with HardwareKeyService * Export CLIPrompt
…rdware key prompt in favor in favor of hardware key service with prompt field.
…ions noted below: * Replace global *YubiKeyPrivateKey cache with a global *YubiKey cache, which supports proper cross-cluster connection caching for Connect * Replace HardwareSigner interface with HardwarePrivateKey, since the service within the key is now the interface * Add context to signatures through the context passed to the hardware key service * Only attest the key when needed (login) to avoid its performance cost
…ateKey; Add tests for marshaling/parsing hardware private keys and hardware key methods.
4aacc7a to
e3a0d9c
Compare
e3a0d9c to
6bb5317
Compare
6bb5317 to
596bac7
Compare
596bac7 to
0552e33
Compare
|
|
||
| attestationv1 "github.com/gravitational/teleport/api/gen/proto/go/attestation/v1" | ||
| ) | ||
|
|
There was a problem hiding this comment.
This file was moved from hardwaresigner.go, no changes.
| return privateKeyPolicyErrRegex.MatchString(err.Error()) | ||
| } | ||
|
|
||
| // AttestationData is attested information about the hardware private key matching the public key. |
There was a problem hiding this comment.
Moved from hardwaresigner.go. Due to PrivateKeyPolicy dependency, it can't go in hardwarekey/attestation.go. We could consider moving PrivateKeyPolicy to the hardwarekey package in a follow up, 👍 if you'd like me to do that.
5c23246 to
7fe86f4
Compare
|
@Tener @timothyb89 Friendly ping to review, tests should be passing now. |
ef7b2ff to
d14db39
Compare
d14db39 to
cfcb9fb
Compare
|
@Joerger sorry, I was travelling now is the first time I can take a look at this PR. Just looking at the description I feel it would make sense to split this PR to a bunch of smaller PRs to make the review easier and more focused. Let me know if this is makes sense; if not I can try to review this PR as is, but I feel it will actually make the overall review longer. |
Fair enough. A lot of the changes are interconnected, but I'll give a shot at splitting the change out further. |
Part of RFD 199
Structural changes:
hardwarekeypackage with a new hardware keyServiceinterfacepivpackage, which provides the PIV implementation of ^yubikey.godirect implementation to fit into the service interface without any major changes, outside of those noted below.hardwarekey.PrivateKeyimplementation ofcrypto.Signer. This is essentially a generalized version of the previousYubiKeyPrivateKeystruct.Functional changes:
ctxtohardwarekey.Serviceto be used as the default context during signatures, since the crypto.Signer interface does not support ctx directly.YubiKeyPrivateKeycache with a globalYubiKeycache, which supports proper cross-cluster connection caching for ConnectMinor changes:
keys.HardwareSignerinterface in favor ofhardware.PrivateKeyPIVSlotKeyandPIVSlotKeyStringtypesFollow ups (TODO comments):
tsh,tctl, andtshd, so that PIV connectionsand prompts can be shared (and without global caches/mutexes). Note that sharing the PIN caching will take place within the prompt, so sharing the prompt across the process will be necessary.Note that the last couple commits were reverting the follow ups ^ in order to reduce the size of this PR.