From d667ee2d1063faad0b4347db498bda00f34a1ba6 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Wed, 6 Jan 2021 12:06:44 +0100 Subject: [PATCH] crypto: fix ineffectual assignments (#22124) * crypto/bls12381: fixed ineffectual assignment * crypto/signify: fix ineffectual assignment --- crypto/bls12381/arithmetic_fallback.go | 2 +- crypto/signify/signify_fuzz.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/bls12381/arithmetic_fallback.go b/crypto/bls12381/arithmetic_fallback.go index 19fb58910..91cabf4f3 100644 --- a/crypto/bls12381/arithmetic_fallback.go +++ b/crypto/bls12381/arithmetic_fallback.go @@ -207,7 +207,7 @@ func lsubAssign(z, x *fe) { z[2], b = bits.Sub64(z[2], x[2], b) z[3], b = bits.Sub64(z[3], x[3], b) z[4], b = bits.Sub64(z[4], x[4], b) - z[5], b = bits.Sub64(z[5], x[5], b) + z[5], _ = bits.Sub64(z[5], x[5], b) } func neg(z *fe, x *fe) { diff --git a/crypto/signify/signify_fuzz.go b/crypto/signify/signify_fuzz.go index d1bcf356a..f9167900a 100644 --- a/crypto/signify/signify_fuzz.go +++ b/crypto/signify/signify_fuzz.go @@ -25,7 +25,6 @@ import ( "log" "os" "os/exec" - "runtime" fuzz "github.com/google/gofuzz" "github.com/jedisct1/go-minisign" @@ -129,6 +128,9 @@ func getKey(fileS string) (string, error) { func createKeyPair() (string, string) { // Create key and put it in correct format tmpKey, err := ioutil.TempFile("", "") + if err != nil { + panic(err) + } defer os.Remove(tmpKey.Name()) defer os.Remove(tmpKey.Name() + ".pub") defer os.Remove(tmpKey.Name() + ".sec")