Skip to content

Add lint to check for NULL parameters in the AlgorithmIdentifier element of CRLs, when mandatory per RFC 4055#1040

Merged
christopher-henderson merged 5 commits into
zmap:masterfrom
defacto64:crl_sigalgo_missing_null_params
May 10, 2026
Merged

Add lint to check for NULL parameters in the AlgorithmIdentifier element of CRLs, when mandatory per RFC 4055#1040
christopher-henderson merged 5 commits into
zmap:masterfrom
defacto64:crl_sigalgo_missing_null_params

Conversation

@defacto64

Copy link
Copy Markdown
Contributor

Suspicious of a recent incident, I noticed that Zlint lacks a certain check on the signature algorithm identifier of CRLs. Specifically, it lacks verification that — when the signature algorithm is one of the four shaXXXWIthRSAEncryption algorithms (with XXX being one of 224, 256, 384, 512) — the mandatory parameters element is present and set to NULL, as required by RFC 4055 Section 6 (which is referenced by RFC 5280). A similar check already exists for certificates, but not for CRLs, so here's my proposal. In my lint, I perform this check on the outer AlgorithmIdentifier. I think examining the inner or the outer one is equivalent, since the two are supposed be identical (and if they aren't, it's a different problem that IMO should be addressed by a separate lint).

@christopher-henderson christopher-henderson left a comment

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.

Thank you for this lint!

It's not easy when cryptobyte has to be whipped so that you can manually walk through the structure. So your work is very much appreciated.

// Attempt to read the parameters element
var nullBytes cryptobyte.String
var nullFound bool
if !signatureAlgorithmBytes.ReadOptionalASN1(&nullBytes, &nullFound, asn1.NULL) {

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.

-- Pointless Commentary --

cryptobyte is both very useful and very clearly a C library pretending to be Go library 😆

I have to reckon that these are 1:1 translations, minus the fact these are methods on a *String rather than functions that take in a *String.

@christopher-henderson christopher-henderson merged commit 77ce217 into zmap:master May 10, 2026
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