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

Fixes and improved error output for tests #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sarcasticadmin
Copy link

@sarcasticadmin sarcasticadmin commented Mar 27, 2024

Description

Noticed some errors during the packages of this project in nixpkgs: NixOS/nixpkgs#299479

  1. Fixed the following error by setting nativeCrypto instead of openssl. Im unsure if this is a reasonable assumption or not:
--- FAIL: TestExtractSignerInfo (0.00s)
panic: interface conversion: interface {} is nil, not bool [recovered]
        panic: interface conversion: interface {} is nil, not bool

goroutine 10 [running]:
testing.tRunner.func1.2({0x629880, 0xc0000dbef0})
        /nix/store/bp39dh48cdqp89hk5mpdi1lxdf0mjl7x-go-1.22.1/share/go/src/testing/testing.go:1631 +0x24a
testing.tRunner.func1()
        /nix/store/bp39dh48cdqp89hk5mpdi1lxdf0mjl7x-go-1.22.1/share/go/src/testing/testing.go:1634 +0x377
panic({0x629880?, 0xc0000dbef0?})
        /nix/store/bp39dh48cdqp89hk5mpdi1lxdf0mjl7x-go-1.22.1/share/go/src/runtime/panic.go:770 +0x132
github.com/netsec-ethz/bootstrapper/fetcher.smimePk7out({0x6dcaa0, 0xc0000dbec0}, {0xc000020e80, 0x38}, {0xc000020ec0, 0x40})
        /build/source/fetcher/crypto_cmds.go:22 +0x10c
github.com/netsec-ethz/bootstrapper/fetcher.extractSignerInfo({0x6dcaa0, 0xc0000dbec0}, {0xc000020e80, 0x38}, {0xc000030c00, 0x29})
        /build/source/fetcher/scion_cppki_verify.go:170 +0xd7
github.com/netsec-ethz/bootstrapper/fetcher.TestExtractSignerInfo(0xc0000f7520)
        /build/source/fetcher/scion_cppki_verify_test.go:297 +0xa08
testing.tRunner(0xc0000f7520, 0x699150)
        /nix/store/bp39dh48cdqp89hk5mpdi1lxdf0mjl7x-go-1.22.1/share/go/src/testing/testing.go:1689 +0xfb
created by testing.(*T).Run in goroutine 1
        /nix/store/bp39dh48cdqp89hk5mpdi1lxdf0mjl7x-go-1.22.1/share/go/src/testing/testing.go:1742 +0x390
FAIL    github.com/netsec-ethz/bootstrapper/fetcher     0.026s
  1. An outstanding certificate verification error for TestVerify only output the return code which was not helpful to understand which part of the PKI verification failed. The new error output makes it much clear but does not fix the test failure (spun out an issue to figure out how to best address that TestVerify go test certificate expiration #19).

Old output:

$ go test -v ./fetcher
=== RUN   TestVerify
t=2024-03-27T19:18:45+0000 lvl=eror msg="Signature verification failed: verifyTopologySignature" err="unable to validate certificate chain: exit status 1"
--- FAIL: TestVerify (0.05s)
=== RUN   TestExtractSignerInfo
--- PASS: TestExtractSignerInfo (0.01s)
=== RUN   TestWipeInsecureSymlinks
--- PASS: TestWipeInsecureSymlinks (0.00s)
FAIL
FAIL    github.com/netsec-ethz/bootstrapper/fetcher     0.067s
FAIL

New output:

$ go test -v ./fetcher
=== RUN   TestVerify
t=2024-03-27T19:22:11+0000 lvl=eror msg="Signature verification failed: verifyTopologySignature" err="unable to validate certificate chain: Error: verification failed: chain did not verify against any selected TRC {errors=[verifying chain {trc_base=1; trc_serial=1}: x509: certificate has expired or is not yet valid: current time 2024-03-27T19:22:11Z is after 2024-02-15T14:44:03Z]}\n exit status 1"
--- FAIL: TestVerify (0.02s)
=== RUN   TestExtractSignerInfo
--- PASS: TestExtractSignerInfo (0.01s)
=== RUN   TestWipeInsecureSymlinks
--- PASS: TestWipeInsecureSymlinks (0.00s)
FAIL
FAIL    github.com/netsec-ethz/bootstrapper/fetcher     0.037s
FAIL

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.

1 participant