diff --git a/CTng/testData/fakeCA/fakeCA.go b/CTng/testData/fakeCA/fakeCA.go index 0336fa4..82efa85 100644 --- a/CTng/testData/fakeCA/fakeCA.go +++ b/CTng/testData/fakeCA/fakeCA.go @@ -38,7 +38,7 @@ var request_count int var currentPeriod int var caType int -func generateCRVs(CA CAConfig, day int) gossip.Gossip_object { +func generateCRVs(CA CAConfig, miss int) gossip.Gossip_object { // Generate delta CRV and then compress it first_arr := CA.CRVs[CA.Day-1] //this assumes we never have CRV of len 0 (fresh CA) sec_arr := CA.CRVs[CA.Day] @@ -65,7 +65,7 @@ func generateCRVs(CA CAConfig, day int) gossip.Gossip_object { } //Appends byte of day, hash of CRV and hash of deltaCRV (lovely looking line of code) - sign := append([]byte{byte(CA.Day - day)}, append(hash_CRV, hash_dCRV)) + sign := append([]byte{byte(CA.Day - miss)}, append(hash_CRV, hash_dCRV)) //Added (CA.Day-day) to produce incorrect SRHs when needed REV := Revocation{ @@ -93,9 +93,9 @@ func periodicTasks() { time.AfterFunc(time.Duration(config.MRD)*time.Second, periodicTasks) // Generate CRV and SRH fmt.Println("Running Tasks") - Rev1 := generateCRVs(config, caType-1) //If it's 1 then it should just be 0 which will produce correct SRH + Rev1 := generateCRVs(config, caType-request_count) //If it's 1 then it should just be 0 which will produce correct SRH request_count++ - fakeRev1 := generateCRVs(config, caType-1) //Should be incorrect SRH + fakeRev1 := generateCRVs(config, caType-request_count) //Should be incorrect SRH SRHs = append(SRHs, Rev1) fakeSRHs = append(fakeSRHs, fakeRev1) currentPeriod++