mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-12-18 08:58:30 +00:00
Re-use instead of reloading pre-warmed key
Signed-off-by: Mustafa Gezen <mustafa@ctrliq.com>
This commit is contained in:
parent
c691153e11
commit
8ef874b5ae
@ -110,16 +110,7 @@ func (s *Server) WarmGPGKey(key string, armoredKey string, gpgKey *crypto.Key, d
|
|||||||
// This means that the key is already loaded
|
// This means that the key is already loaded
|
||||||
// We need to delete and replace it
|
// We need to delete and replace it
|
||||||
if cachedKey != nil {
|
if cachedKey != nil {
|
||||||
cachedKey.Lock()
|
return cachedKey, nil
|
||||||
defer cachedKey.Unlock()
|
|
||||||
|
|
||||||
keyId := gpgKey.GetHexKeyID()
|
|
||||||
err := s.deleteGpgKey(keyId)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
cachedKey.gpgId = keyId
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err := s.importGpgKey(armoredKey)
|
err := s.importGpgKey(armoredKey)
|
||||||
|
Loading…
Reference in New Issue
Block a user