Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzing: add more fuzzers #1215

Merged
merged 1 commit into from Nov 30, 2022
Merged

Fuzzing: add more fuzzers #1215

merged 1 commit into from Nov 30, 2022

Conversation

AdamKorcz
Copy link
Contributor

Signed-off-by: AdamKorcz adam@adalogics.com

Summary

Adds three more fuzzers.

Release Note

Documentation

@AdamKorcz AdamKorcz requested review from bobcallaway and a team as code owners November 23, 2022 00:11
@codecov-commenter
Copy link

Codecov Report

Merging #1215 (7982dea) into main (bd1452b) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1215      +/-   ##
==========================================
- Coverage   64.22%   64.19%   -0.03%     
==========================================
  Files          82       82              
  Lines        7628     7628              
==========================================
- Hits         4899     4897       -2     
- Misses       2100     2102       +2     
  Partials      629      629              
Flag Coverage Δ
e2etests 48.85% <ø> (ø)
unittests 41.97% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/types/rekord/v0.0.1/entry.go 67.76% <0.00%> (-0.66%) ⬇️
pkg/types/alpine/v0.0.1/entry.go 72.35% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

pkg/signer/fuzz_test.go Outdated Show resolved Hide resolved
pkg/signer/fuzz_test.go Outdated Show resolved Hide resolved
Signed-off-by: AdamKorcz <adam@adalogics.com>
@bobcallaway bobcallaway merged commit 69597b8 into sigstore:main Nov 30, 2022
@github-actions github-actions bot added this to the v1.1.0 milestone Nov 30, 2022
}
defer func() {
keyPath.Close()
os.Remove(keyPath.Name())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to call os.Remove as the directory (and it's contents) created by t.TempDir() is removed automatically when the test is finished.


func FuzzNewFile(f *testing.F) {
f.Fuzz(func(t *testing.T, keyData []byte, keyPass string) {
keyPath, err := os.CreateTemp(t.TempDir(), "keyfile")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename keyPath to keyFile as CreateTemp returns a *File, not a path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants