Merge pull request #784 from mtrmac/crypto-errors

Add context to --encryption-key / --decryption-key processing failures
This commit is contained in:
Daniel J Walsh 2019-12-11 10:43:50 -05:00 committed by GitHub
commit e955849f0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,7 +186,7 @@ func (opts *copyOptions) run(args []string, stdout io.Writer) error {
encryptionKeys := opts.encryptionKeys.Value()
ecc, err := enchelpers.CreateCryptoConfig(encryptionKeys, []string{})
if err != nil {
return err
return fmt.Errorf("Invalid encryption keys: %v", err)
}
cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{ecc})
encConfig = cc.EncryptConfig
@ -197,7 +197,7 @@ func (opts *copyOptions) run(args []string, stdout io.Writer) error {
decryptionKeys := opts.decryptionKeys.Value()
dcc, err := enchelpers.CreateCryptoConfig([]string{}, decryptionKeys)
if err != nil {
return err
return fmt.Errorf("Invalid decryption keys: %v", err)
}
cc := encconfig.CombineCryptoConfigs([]encconfig.CryptoConfig{dcc})
decConfig = cc.DecryptConfig