From b09f60e9dbed43078f24848b46d41b31be617508 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 2 Mar 2025 09:23:41 +0100 Subject: [PATCH] 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 --- sops.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sops.go b/sops.go index 39615c20d..a32211f1a 100644 --- a/sops.go +++ b/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 }