Skip to content

Commit

Permalink
small oversight fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ist17002 committed Apr 25, 2022
1 parent 3094489 commit e6785fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CTng/testData/fakeCA/fakeCA.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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{
Expand Down Expand Up @@ -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++
Expand Down

0 comments on commit e6785fa

Please sign in to comment.