MCPcopy Index your code
hub / github.com/getsops/sops / LoadEncryptedFileWithBugFixes

Function LoadEncryptedFileWithBugFixes

cmd/sops/common/common.go:253–271  ·  view source on GitHub ↗

LoadEncryptedFileWithBugFixes is a wrapper around LoadEncryptedFile which includes check for the issue described in https://github.com/mozilla/sops/pull/435

(opts GenericDecryptOpts)

Source from the content-addressed store, hash-verified

251// LoadEncryptedFileWithBugFixes is a wrapper around LoadEncryptedFile which includes
252// check for the issue described in https://github.com/mozilla/sops/pull/435
253func LoadEncryptedFileWithBugFixes(opts GenericDecryptOpts) (*sops.Tree, error) {
254 tree, err := LoadEncryptedFileEx(opts.InputStore, opts.InputPath, opts.ReadFromStdin)
255 if err != nil {
256 return nil, err
257 }
258
259 encCtxBug, err := DetectKMSEncryptionContextBug(tree)
260 if err != nil {
261 return nil, err
262 }
263 if encCtxBug {
264 tree, err = FixAWSKMSEncryptionContextBug(opts, tree)
265 if err != nil {
266 return nil, err
267 }
268 }
269
270 return tree, nil
271}
272
273// FixAWSKMSEncryptionContextBug is used to fix the issue described in https://github.com/mozilla/sops/pull/435
274func FixAWSKMSEncryptionContextBug(opts GenericDecryptOpts, tree *sops.Tree) (*sops.Tree, error) {

Callers 5

setFunction · 0.92
unsetFunction · 0.92
decryptTreeFunction · 0.92
editFunction · 0.92
rotateFunction · 0.92

Calls 3

LoadEncryptedFileExFunction · 0.85

Tested by

no test coverage detected