Conversation
(cherry picked from commit 8bd03341689c992d633f3988b3a7fbc15aec75e6)
0xmhha
left a comment
There was a problem hiding this comment.
Note: the fuzz harness in this file cannot be built, so the change is unverifiable
No impact on the normal build or make test — signify_fuzz.go carries
//go:build gofuzz, so it is excluded from both. go build ./crypto/signify/
passes. The fuzzer is also not registered in oss-fuzz.sh, so nothing in CI
builds it either.
The problem only surfaces when the harness is built with the tag:
$ go build -tags gofuzz ./crypto/signify/
# github.com/ethereum/go-ethereum/crypto/signify
crypto/signify/signify_fuzz.go:59:8: undefined: SignifySignFile
crypto/signify/signify_fuzz.go:71:9: no new variables on left side of :=
go vet reports the same, but stops at the first error — worth knowing, since it
makes the problem look like a single-line fix when it is not:
$ go vet -tags gofuzz ./crypto/signify/
# github.com/ethereum/go-ethereum/crypto/signify
# [github.com/ethereum/go-ethereum/crypto/signify]
vet: crypto/signify/signify_fuzz.go:59:8: undefined: SignifySignFile
Both errors are pre-existing and reproduce on dev:
- L59 —
SignifySignFilewas renamed toSignFilein f935b1d
(ethereum#21977); the call site was never updated. It is the only remaining
reference in the tree. - L71 —
_, err := exec.LookPath(signify);erris already declared at L37
and_is not a new variable, so:=has nothing new to declare.
Upstream fixed both in ethereum#33402 (a9eaf2ffd859, 2025-12-13). Applying that
patch locally makes go build -tags gofuzz ./crypto/signify/ pass.
The change in this PR is correct on its own: defer tmpKey.Close() is registered
after the three os.Remove defers, so LIFO order closes the handle before the
files are removed.
colinkim
left a comment
There was a problem hiding this comment.
LGTM.
Since the gofuzz-tagged harness build failure predates this PR, and CI does not exercise that tag, how about tracking it in a separate follow-up issue or PR?
Summary
Ports ethereum#29444.
createKeyPair()opened a temp file viaos.CreateTempbut never closed it. Other temp files in the same file (tmpFile,pubKeyFile) already havedefer Close(). Add the missingdefer tmpKey.Close().Upstream References
Changes
crypto/signify/signify_fuzz.go: adddefer tmpKey.Close()increateKeyPair()