From dbdb48f1824694270a9ad732a10f7f4bea36c28d Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Thu, 7 Sep 2023 10:54:01 -0700 Subject: [PATCH] cert: fix dropped errors (#961) --- cert/cert.go | 3 +++ cert/crypto.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cert/cert.go b/cert/cert.go index 24a75e3..4f1b776 100644 --- a/cert/cert.go +++ b/cert/cert.go @@ -272,6 +272,9 @@ func EncryptAndMarshalSigningPrivateKey(curve Curve, b []byte, passphrase []byte }, Ciphertext: ciphertext, }) + if err != nil { + return nil, err + } switch curve { case Curve_CURVE25519: diff --git a/cert/crypto.go b/cert/crypto.go index 94f4c48..3558e1a 100644 --- a/cert/crypto.go +++ b/cert/crypto.go @@ -77,6 +77,9 @@ func aes256Decrypt(passphrase []byte, kdfParams *Argon2Parameters, data []byte) } gcm, err := cipher.NewGCM(block) + if err != nil { + return nil, err + } nonce, ciphertext, err := splitNonceCiphertext(data, gcm.NonceSize()) if err != nil {