update yubikeystore keys cache when adding

Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
This commit is contained in:
David Lawrence 2015-11-07 08:29:38 -08:00
parent beca50909d
commit 705587b0b5
1 changed files with 8 additions and 1 deletions

View File

@ -514,7 +514,14 @@ func (s *YubiKeyStore) AddKey(keyID, role string, privKey data.PrivateKey) error
return err
}
logrus.Debugf("Using yubikey slot %v", slot)
return addECDSAKey(ctx, session, privKey, slot, s.passRetriever, role)
err = addECDSAKey(ctx, session, privKey, slot, s.passRetriever, role)
if err == nil {
s.keys[privKey.ID()] = yubiSlot{
role: role,
slotID: slot,
}
}
return err
}
func (s *YubiKeyStore) GetKey(keyID string) (data.PrivateKey, string, error) {