mirror of
https://github.com/Luzifer/envrun.git
synced 2024-11-14 00:52:42 +00:00
Fix: fmt.Errorf
behaves different than errors.Wrap
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
2609dc1859
commit
d3a200721a
1 changed files with 8 additions and 2 deletions
|
@ -56,12 +56,18 @@ func decryptGPGSymmetric(body []byte, passphrase string) ([]byte, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
data, err := io.ReadAll(md.UnverifiedBody)
|
data, err := io.ReadAll(md.UnverifiedBody)
|
||||||
return data, fmt.Errorf("reading GPG body: %w", err)
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("reading GPG body: %w", err)
|
||||||
|
}
|
||||||
|
return data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func decryptOpenSSL(kdf openssl.CredsGenerator) decryptMethod {
|
func decryptOpenSSL(kdf openssl.CredsGenerator) decryptMethod {
|
||||||
return func(body []byte, passphrase string) ([]byte, error) {
|
return func(body []byte, passphrase string) ([]byte, error) {
|
||||||
data, err := openssl.New().DecryptBytes(cfg.Password, body, kdf)
|
data, err := openssl.New().DecryptBytes(cfg.Password, body, kdf)
|
||||||
return data, fmt.Errorf("decrypting data: %w", err)
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("decrypting data: %w", err)
|
||||||
|
}
|
||||||
|
return data, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue