Skip to content

Commit

Permalink
let's just do mass revocation for one period
Browse files Browse the repository at this point in the history
  • Loading branch information
jie committed Oct 7, 2023
1 parent 1ca64be commit aff2fe9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 9 additions & 8 deletions CA/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,16 @@ func PeriodicTask(ctx *CAContext) {
prelen := len(compressed_binary)

// Perform mass revocation
ctx.CRV.MassRevoke(ctx.RevocationRatio)
if ctx.Fresh {
ctx.CRV.MassRevoke(ctx.RevocationRatio)

// Serialize the CRV_current after mass revocation
postbinary, _ = ctx.CRV.CRV_current.MarshalBinary()
compressed_binary2, _ := util.CompressData(postbinary)
postlen := len(compressed_binary2)

fmt.Println("CRV size before and after mass revocation: ", prelen, postlen)
//}
// Serialize the CRV_current after mass revocation
postbinary, _ = ctx.CRV.CRV_current.MarshalBinary()
compressed_binary2, _ := util.CompressData(postbinary)
postlen := len(compressed_binary2)
ctx.Fresh = false
fmt.Println("CRV size before and after mass revocation: ", prelen, postlen)
}

//fmt.Println(certlist)
// get current period
Expand Down
2 changes: 2 additions & 0 deletions CA/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type CAContext struct {
RevocationRatio float64
STH_storage_lock *sync.Mutex
Certpool_lock *sync.Mutex
Fresh bool
}

type CA_public_config struct {
Expand Down Expand Up @@ -325,6 +326,7 @@ func InitializeCAContext(public_config_path string, private_config_file_path str
Request_Count_lock: &sync.Mutex{},
STH_storage_lock: &sync.Mutex{},
Certpool_lock: &sync.Mutex{},
Fresh: true,
}
// Initialize http client
tr := &http.Transport{}
Expand Down

0 comments on commit aff2fe9

Please sign in to comment.