mozilla-services / go-cose

go library for CBOR Object Signing and Encryption (COSE)
Mozilla Public License 2.0
40 stars 18 forks source link

Fix exact bit level checks leading to flakey tests #54

Closed g-k closed 5 years ago

g-k commented 5 years ago

i.e.

    --- FAIL: TestRustCoseCli/test_cose_sign_verify_P521_no_other_certs (0.10s)
        sign_verify_cose_rust_cli_test.go:56: 
                Error Trace:    sign_verify_cose_rust_cli_test.go:56
                                            sign_verify_cose_rust_cli_test.go:98
                Error:          Expected nil, but got: Byte lengths of integers r and s (9 and 8) do not match the key length 9
                Test:           TestRustCoseCli/test_cose_sign_verify_P521_no_other_certs
                Messages:       test_cose_sign_verify_P521_no_other_certs: signing failed with err Byte lengths of integers r and s (9 and 8) do not match the key length 9
        sign_verify_cose_rust_cli_test.go:91: 
                Error Trace:    sign_verify_cose_rust_cli_test.go:91
                                            sign_verify_cose_rust_cli_test.go:98
                Error:          Expected nil, but got: &exec.ExitError{ProcessState:(*os.ProcessState)(0xc00042e5c0), Stderr:[]uint8(nil)}
                Test:           TestRustCoseCli/test_cose_sign_verify_P521_no_other_certs
                Messages:       test_cose_sign_verify_P521_no_other_certs: error verifying signature with cose-rust exit status 2

from https://circleci.com/gh/mozilla-services/go-cose/23

g-k commented 5 years ago

We can backport https://github.com/mozilla-services/autograph/commit/dd80ef69bf7f228e619b09ffce0c58d99fc4c26c and https://github.com/mozilla-services/autograph/commit/e74f118cf5659c5f6390da43a35216b982f3266b