Calculate chain length, certificate length and signature length, only open file once in benchmark
This commit is contained in:
@@ -118,10 +118,10 @@ func (context *SignContext) fetchRevocationData() error {
|
||||
|
||||
// Calculate space needed for signature.
|
||||
for _, crl := range context.SignData.RevocationData.CRL {
|
||||
context.SignatureMaxLength += uint32(len(crl.FullBytes) * 2)
|
||||
context.SignatureMaxLength += uint32(hex.EncodedLen(len(crl.FullBytes)))
|
||||
}
|
||||
for _, ocsp := range context.SignData.RevocationData.OCSP {
|
||||
context.SignatureMaxLength += uint32(len(ocsp.FullBytes) * 2)
|
||||
context.SignatureMaxLength += uint32(hex.EncodedLen(len(ocsp.FullBytes)))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user