浏览代码

cert: fix dropped errors (#961)

Lars Lehtonen 1 年之前
父节点
当前提交
dbdb48f182
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3 0
      cert/cert.go
  2. 3 0
      cert/crypto.go

+ 3 - 0
cert/cert.go

@@ -272,6 +272,9 @@ func EncryptAndMarshalSigningPrivateKey(curve Curve, b []byte, passphrase []byte
 		},
 		},
 		Ciphertext: ciphertext,
 		Ciphertext: ciphertext,
 	})
 	})
+	if err != nil {
+		return nil, err
+	}
 
 
 	switch curve {
 	switch curve {
 	case Curve_CURVE25519:
 	case Curve_CURVE25519:

+ 3 - 0
cert/crypto.go

@@ -77,6 +77,9 @@ func aes256Decrypt(passphrase []byte, kdfParams *Argon2Parameters, data []byte)
 	}
 	}
 
 
 	gcm, err := cipher.NewGCM(block)
 	gcm, err := cipher.NewGCM(block)
+	if err != nil {
+		return nil, err
+	}
 
 
 	nonce, ciphertext, err := splitNonceCiphertext(data, gcm.NonceSize())
 	nonce, ciphertext, err := splitNonceCiphertext(data, gcm.NonceSize())
 	if err != nil {
 	if err != nil {