Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #47 - Add stash support #48

Merged
merged 1 commit into from
Mar 13, 2020
Merged

Fix #47 - Add stash support #48

merged 1 commit into from
Mar 13, 2020

Conversation

jcjones
Copy link
Contributor

@jcjones jcjones commented Mar 5, 2020

This by default generates an mlbf file named filter.stash, which contains
all the additions to the filter, collated by issuer and status change.

The file is made of per-issuer blocks, where each block's bytes are:

  bytes 0-3: N, number of revoked serials as an unsigned long
  bytes 4-7: M, number of nonrevoked serials as an unsigned long
  bytes 8-9: L, length of the issuer field as a unsigned short
  bytes 10+: hash of issuer subject public key info of length L
  ... then N serials_structs
  ... followed by M serials_structs

The serials_struct blocks are defined:

  bytes 0-1: S, length of serial field as an unsigned short
  bytes 2+: ASN.1 DER-encoded serial number of length S

When reaching EOF, there are no more issuer blocks.

Consumers can collect these filter.stash files, load them in chronological
order, and apply them before querying the originating MLBF filter.

This by default generates an `mlbf` file named `filter.stash`, which contains
all the additions to the filter, collated by issuer and status change.

The file is made of per-issuer blocks, where each block's bytes are:

  bytes 0-3: N, number of revoked serials as an unsigned long
  bytes 4-7: M, number of nonrevoked serials as an unsigned long
  bytes 8-9: L, length of the issuer field as a unsigned short
  bytes 10+: hash of issuer subject public key info of length L
  ... then N serials_structs
  ... followed by M serials_structs

The serials_struct blocks are defined:
  bytes 0-1: S, length of serial field as an unsigned short
  bytes 2+: ASN.1 DER-encoded serial number of length S

When reaching EOF, there are no more issuer blocks.

Consumers can collect these `filter.stash` files, load them in chronological
order, and apply them before querying the originating MLBF filter.
@jcjones jcjones requested a review from mozkeeler March 5, 2020 23:59
Copy link
Collaborator

@mozkeeler mozkeeler left a comment

Choose a reason for hiding this comment

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

I haven't finished a full review, but one comment I have is that calling the serials ASN.1 or DER confuses me since we use the value but not the outer tag or length (is it really ASN.1 if it's just a sequence of otherwise unstructured bytes?)

@jcjones
Copy link
Contributor Author

jcjones commented Mar 6, 2020

Good catch, I'll adjust the documentation and the commit message.

Copy link
Collaborator

@mozkeeler mozkeeler left a comment

Choose a reason for hiding this comment

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

Looks good in general. Just the one comment from before about ASN.1 and the additional one, below (or above? I don't know where it's going to go...)

create_filter_cascade/certs_to_crlite.py Show resolved Hide resolved
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