-
Notifications
You must be signed in to change notification settings - Fork 0
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
wip: refactoring extension handling #1
Commits on Sep 29, 2023
-
Configuration menu - View commit details
-
Copy full SHA for ce2d261 - Browse repository at this point
Copy the full SHA ce2d261View commit details -
ext: introduce module for X.509 extension handling
This commit creates a new crate-internal module, `ext`, for managing X.509 extensions. In this commit we wire up emitting extensions managed by this module, but do not yet convert any existing extensions to the new arrangement. This will begin in subsequent commits. Notably the new representation for a collection of extensions uses a `BTreeMap` keyed by OID. We use this to reject additions of extensions that are already present in the map, since RFC 5280 forbids duplicate extensions. Using a `BTreeMap` instead of another map type allows preserving order.
Configuration menu - View commit details
-
Copy full SHA for 09af96f - Browse repository at this point
Copy the full SHA 09af96fView commit details -
ext: implement authority key identifier.
This commit lifts the authority key identifier extension into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for 205dc82 - Browse repository at this point
Copy the full SHA 205dc82View commit details -
ext: implement subject alternative name.
This commit lifts the subject alternative name extension into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for 247b9cf - Browse repository at this point
Copy the full SHA 247b9cfView commit details -
This commit lifts the key usage extension into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for b252bf4 - Browse repository at this point
Copy the full SHA b252bf4View commit details -
ext: implement extended key usage
This commit lifts the extended key usage extension into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for 5c2ce4e - Browse repository at this point
Copy the full SHA 5c2ce4eView commit details -
ext: implement name constraints
This commit lifts the name constraints extension into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for 55f9c76 - Browse repository at this point
Copy the full SHA 55f9c76View commit details -
ext: implement CRL distribution points
This commit lifts the CRL distribution points extension into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for 4803c80 - Browse repository at this point
Copy the full SHA 4803c80View commit details -
ext: implement subject key ID, specifying SKI
This commit lifts the subject key identifier extension into the `ext` module. It additionally adds support for specifying a custom SKI value in `CertificateParams`, and reading it from a CSR's SKI ext. Diverging from the existing code we now adhere to the RFC 5280 advice and always emit the SKI extension when generating a certificate. Previously this was only done if the basic constraints specified `IsCa::Ca` or `IsCa::ExplicitNoCa`, but not when using `IsCa::NoCa`.
Configuration menu - View commit details
-
Copy full SHA for b544af4 - Browse repository at this point
Copy the full SHA b544af4View commit details -
ext: implement basic constraints
This commit lifts the basic constraints extension into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for b206a7a - Browse repository at this point
Copy the full SHA b206a7aView commit details -
ext: implement custom extensions
This commit lifts the custom extension handling into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for 13bc40a - Browse repository at this point
Copy the full SHA 13bc40aView commit details -
ext: have
Extensions
write outer SEQUENCENow that all extensions in certs and CSRs are managed through `Extensions` we can have that type manage writing the outer `SEQUENCE` and each `Extension`.
Configuration menu - View commit details
-
Copy full SHA for 151bc18 - Browse repository at this point
Copy the full SHA 151bc18View commit details -
lib: use
Extensions
to decide when to emit extsPreviously the params were interrogated for parameters that would indicate needing an extension to be emitted. Keeping this logic up to date was error prone. This commit reworks the code to emit extensions whenever the `Extensions` generated from the params isn't empty. This has the advantage of not needing to be updated when new parameter -> extension instances are added.
Configuration menu - View commit details
-
Copy full SHA for 1e3fbdc - Browse repository at this point
Copy the full SHA 1e3fbdcView commit details -
ext: implement crl number extension
This commit lifts the CRL number extension handling into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for 7df23e4 - Browse repository at this point
Copy the full SHA 7df23e4View commit details -
ext: implement issuing distribution point extension
This commit lifts the CRL issuing distribution point extension handling into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for b4d8ead - Browse repository at this point
Copy the full SHA b4d8eadView commit details -
crl: unconditionally emit AKI ext
We always have an issuer `Certificate` when invoking `extensions` on a `CertificateRevocationListParams`, and RFC 5280 says issuers are REQUIRED to include the AKI ext.
Configuration menu - View commit details
-
Copy full SHA for cf96c6c - Browse repository at this point
Copy the full SHA cf96c6cView commit details -
crl: use
Extensions
to write DER encodingNow that all of the base CRL extensions are handled by `Extensions` we can use that type to emit the `SEQUENCE` directly. Similarly, since the only call-site always provides an issuer, simplify some logic.
Configuration menu - View commit details
-
Copy full SHA for 6f02b3a - Browse repository at this point
Copy the full SHA 6f02b3aView commit details -
ext: implement reason code extension
This commit lifts the CRL entry reason code extension handling into the `ext` module.
Configuration menu - View commit details
-
Copy full SHA for 124c49d - Browse repository at this point
Copy the full SHA 124c49dView commit details -
ext: implement invalidity date extension
This commit lifts the CRL entry invalidity date extension into the `ext` module. There are no longer any references to the lib.rs `write_x509_extension` helper, so it is also removed.
Configuration menu - View commit details
-
Copy full SHA for 202b895 - Browse repository at this point
Copy the full SHA 202b895View commit details -
crl: use
Extensions
to write DERNow that all of the CRL entry extensions have been migrated to `Extensions` we can let that type write the `SEQUENCE` and extension values. There are no longer any callers to `Extensions.iter()` so we remove that fn.
Configuration menu - View commit details
-
Copy full SHA for 7e9a7c7 - Browse repository at this point
Copy the full SHA 7e9a7c7View commit details -
lib: relax unsupported CSR exts
In preparation for broader CSR extension support this commit updates the logic for detecting unsupported CSR exts to only forbid serial number.
Configuration menu - View commit details
-
Copy full SHA for cf368ce - Browse repository at this point
Copy the full SHA cf368ceView commit details -
tests: add test for CSR extensions
This commit adds a unit test that ensures when an `rcgen::CertificateParams` specifies parameters that result in X.509 extensions, we find each expected extension in a generated certificate *and* certificate signing request when parsing both with `x509-parser`.
Configuration menu - View commit details
-
Copy full SHA for b32736b - Browse repository at this point
Copy the full SHA b32736bView commit details -
csr: support populating custom extensions from CSR.
This commit updates the CSR parsing to populate unknown requested extensions as custom extensions in the built CSR `CertificateParams.custom_extensions`.
Configuration menu - View commit details
-
Copy full SHA for e8348ab - Browse repository at this point
Copy the full SHA e8348abView commit details