diff options
| -rw-r--r-- | instance_test.go | 4 | ||||
| -rw-r--r-- | trillian_test.go | 9 | 
2 files changed, 7 insertions, 6 deletions
| diff --git a/instance_test.go b/instance_test.go index 51f7a35..6ce31a9 100644 --- a/instance_test.go +++ b/instance_test.go @@ -10,6 +10,10 @@ import (  	"github.com/system-transparency/stfe/x509util"  ) +var ( +	testHashLen = 31 +) +  func makeTestLogParameters(t *testing.T, signer crypto.Signer) *LogParameters {  	anchorList, err := x509util.NewCertificateList(testdata.PemAnchors)  	if err != nil { diff --git a/trillian_test.go b/trillian_test.go index bbbfff3..c7bdcf1 100644 --- a/trillian_test.go +++ b/trillian_test.go @@ -173,7 +173,7 @@ func TestCheckGetInclusionProofByHash(t *testing.T) {  		},  		{  			description: "bad response: proof with invalid node hash", -			rsp:         makeTrillianGetInclusionProofByHashResponse(t, int64(testIndex), [][]byte{make([]byte, 31)}), +			rsp:         makeTrillianGetInclusionProofByHashResponse(t, int64(testIndex), [][]byte{make([]byte, testHashLen-1)}),  			wantErr:     true,  		},  		{ @@ -187,9 +187,6 @@ func TestCheckGetInclusionProofByHash(t *testing.T) {  	}  } -// TODO: fix hardcoded assumed test hash value len of 32? - -// TODO: TestGetConsistencyProof  func TestCheckGetConsistencyProof(t *testing.T) {  	lp := makeTestLogParameters(t, nil)  	for _, table := range []struct { @@ -214,7 +211,7 @@ func TestCheckGetConsistencyProof(t *testing.T) {  		},  		{  			description: "bad response: proof with invalid node hash", -			rsp:         makeTrillianGetConsistencyProofResponse(t, [][]byte{make([]byte, 31)}), +			rsp:         makeTrillianGetConsistencyProofResponse(t, [][]byte{make([]byte, testHashLen-1)}),  			wantErr:     true,  		},  		{ @@ -270,7 +267,7 @@ func TestCheckGetLatestSignedLogRoot(t *testing.T) {  		},  		{  			description: "bad trillian response: invalid root hash size", -			rsp:         makeLatestSignedLogRootResponse(t, 0, 0, make([]byte, 31)), +			rsp:         makeLatestSignedLogRootResponse(t, 0, 0, make([]byte, testHashLen-1)),  			wantErr:     true,  		},  		{ | 
