Skip to content

Add lint to check CRL Number range#964

Merged
christopher-henderson merged 5 commits intozmap:masterfrom
kowshikRoy:crl-number
Jun 19, 2025
Merged

Add lint to check CRL Number range#964
christopher-henderson merged 5 commits intozmap:masterfrom
kowshikRoy:crl-number

Conversation

@kowshikRoy
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Member

@christopher-henderson christopher-henderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small request on a big API usage.

Details: fmt.Sprintf("CRL number is negative: %v", c.Number),
}
}
crlNumberUpperBound := new(big.Int).Lsh(big.NewInt(1), 159)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
crlNumberUpperBound := new(big.Int).Lsh(big.NewInt(1), 159)
crlNumberUpperBound := new(big.Int).Exp(big.NewInt(2), big.NewInt(159), big.NewInt(0))

If you wouldn't mind, I find this a bit more readable due being a closer mapping to the literal language. Were it not for the extra modulus parameter then it would be a direct mapping.

This Go Playground indicates that this generates the same number.

@christopher-henderson christopher-henderson self-requested a review June 19, 2025 15:17
@christopher-henderson christopher-henderson merged commit 341615f into zmap:master Jun 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants