mirror of
https://github.com/getsops/sops.git
synced 2026-02-05 12:45:21 +01:00
Fix caching of Metadata.DataKey.
At the end of the function, the key was stored in m.DataKey. Since m was a copy of the called object, this did not cache anything. Signed-off-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
2
sops.go
2
sops.go
@@ -824,7 +824,7 @@ func (m *Metadata) UpdateMasterKeys(dataKey []byte) (errs []error) {
|
||||
|
||||
// GetDataKeyWithKeyServices retrieves the data key, asking KeyServices to decrypt it with each
|
||||
// MasterKey in the Metadata's KeySources until one of them succeeds.
|
||||
func (m Metadata) GetDataKeyWithKeyServices(svcs []keyservice.KeyServiceClient, decryptionOrder []string) ([]byte, error) {
|
||||
func (m *Metadata) GetDataKeyWithKeyServices(svcs []keyservice.KeyServiceClient, decryptionOrder []string) ([]byte, error) {
|
||||
if m.DataKey != nil {
|
||||
return m.DataKey, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user