LoadEncryptedFileWithBugFixes is a wrapper around LoadEncryptedFile which includes check for the issue described in https://github.com/mozilla/sops/pull/435
(opts GenericDecryptOpts)
| 251 | // LoadEncryptedFileWithBugFixes is a wrapper around LoadEncryptedFile which includes |
| 252 | // check for the issue described in https://github.com/mozilla/sops/pull/435 |
| 253 | func 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 |
| 274 | func FixAWSKMSEncryptionContextBug(opts GenericDecryptOpts, tree *sops.Tree) (*sops.Tree, error) { |
no test coverage detected