Uh oh!
There was an error while loading. Please reload this page.
x509-cert: add certificate builder - #764
Conversation
baloo
commented
Nov 19, 2022
This is very much a work in progress, but sharing early to get feedback. I think I want to attached the extensions to the I don't exactly know how much we want to force in that API. I'm inclined to force the inclusion of:
I'm not sure about:
Pretty convinced I can't force:
|
2c89de5 to
ad06b76Comparetarcieri
commented
Nov 19, 2022
@baloo there was a little bit of previous discussion on iqlusioninc/yubikey.rs#348 as linked from #418. One thing I'd recommend is running the generated certificates through a tool like |
tarcieri
commented
Nov 19, 2022
Also @str4d's I think if we make a good enough replacement he'll also give us the |
baloo
commented
Nov 19, 2022
I've started a What are your thoughts on https://docs.rs/ouroboros/latest/ouroboros/attr.self_referencing.html. Wondering whether I should keep both the |
tarcieri
commented
Nov 19, 2022
There's a binary here: https://github.com/zmap/zlint/releases/download/v3.4.0/zlint_3.4.0_Linux_x86_64.tar.gz You can look at this as an example for how to download it in a GitHub Actions workflow: https://github.com/RustCrypto/actions/blob/master/cargo-hack-install/action.yml It's fine to just put it in the
I played with trying to integrate See #734 where I proposed Alternatively we could eliminate the lifetimes on the various types and move to entirely owned types. I opened #765 to discuss that. |
a44db20 to
111c526Comparebaloo
commented
Nov 20, 2022
I think I like the yoke a bit better than going to owned types. |
The owned types are actually nice when decoding from PEM, since they avoid an intermediate PEM -> DER pass and allow the DER to be decoded from PEM on-the-fly as needed to parse document. |
a8c8cb6 to
cd1bf94CompareGot the root CA profile to work with zero lint error on zlint. |
c00659b to
240c0f9Comparebaloo
commented
Nov 23, 2022
(minimal-versions error is a regression in nightly: rust-lang/rust#104759) |
240c0f9 to
61fe940CompareUh oh!
There was an error while loading. Please reload this page.
aeb2cf8 to
1e4b92eComparebrandonweeks
commented
Feb 8, 2023
It feels like doing so would inhibit the usage of this API for use cases other than Web PKI. Which would be a shame because I suspect Web PKI will be one of the last environments where this crate will be adopted. Go's crypto/x509 offers one of the best APIs for parsing and generating X.509 certificate for arbitrary use cases. It'd be great if this crate could analogous functionality. |
1e4b92e to
74dcf8eCompareUh oh!
There was an error while loading. Please reload this page.
baloo
commented
Mar 30, 2023
@brandonweeks I implemented an |
f803168 to
37b45daCompareUh oh!
There was an error while loading. Please reload this page.
tarcieri
commented
Apr 9, 2023
Finished a readthrough pass. Looking good so far. It's a lot of code! |
| @@ -0,0 +1,195 @@ | |||
| use serde::{ | |||
There was a problem hiding this comment.
FYI, I snagged https://crates.io/crates/zlint
Might be interesting to extract this into a separate crate (after landing this PR perhaps)
ce7fe7c to
3086be6Compare497ad4f to
7a91c7bCompare7a91c7b to
794e080Compare
tarcieri
left a comment
There was a problem hiding this comment.
Going to go ahead and land this
top-level Cargo.toml patches crates.io to point to the in-tree versions of several crates. Revert some of the changes introduced by the commit 98957ae ("x509-cert: add certificate builder (RustCrypto#764)") which gets overriden again by the patch.crates.io config. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
top-level Cargo.toml patches crates.io to point to the in-tree versions of several crates. Revert some of the changes introduced by the commit 98957ae ("x509-cert: add certificate builder (RustCrypto#764)") which gets overriden again by the patch.crates.io config. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Added - Certificate builder ([RustCrypto#764]) - Support for `RandomizedSigner` in builder ([RustCrypto#1007]) - Provide parsing profiles ([RustCrypto#987]) - Support for `Time::INFINITY` ([RustCrypto#1024]) - Conversion from `std::net::IpAddr` ([RustCrypto#1035]) - `CertReq` builder ([RustCrypto#1034]) Changed - use `ErrorKind::Value` for overlength serial ([RustCrypto#988]) - Bump `hex-literal` to v0.4.1 ([RustCrypto#999]) - Builder updates ([RustCrypto#1001]) - better debug info when `zlint` isn't installed ([RustCrypto#1018]) - make SKI optional in leaf certificate ([RustCrypto#1028]) - bump rsa from 0.9.0-pre.2 to 0.9.0 ([RustCrypto#1033]) Fixed - fix `KeyUsage` bit tests ([RustCrypto#993]) - extraneous PhantomData in `TbsCertificate` ([RustCrypto#1019])
Added - Certificate builder ([RustCrypto#764]) - Support for `RandomizedSigner` in builder ([RustCrypto#1007]) - Provide parsing profiles ([RustCrypto#987]) - Support for `Time::INFINITY` ([RustCrypto#1024]) - Conversion from `std::net::IpAddr` ([RustCrypto#1035]) - `CertReq` builder ([RustCrypto#1034]) Changed - use `ErrorKind::Value` for overlength serial ([RustCrypto#988]) - Bump `hex-literal` to v0.4.1 ([RustCrypto#999]) - Builder updates ([RustCrypto#1001]) - better debug info when `zlint` isn't installed ([RustCrypto#1018]) - make SKI optional in leaf certificate ([RustCrypto#1028]) - bump rsa from 0.9.0-pre.2 to 0.9.0 ([RustCrypto#1033]) Fixed - fix `KeyUsage` bit tests ([RustCrypto#993]) - extraneous PhantomData in `TbsCertificate` ([RustCrypto#1017])
Added - Certificate builder (RustCrypto#764) - Support for `RandomizedSigner` in builder (RustCrypto#1007) - Provide parsing profiles (RustCrypto#987) - Support for `Time::INFINITY` (RustCrypto#1024) - Conversion from `std::net::IpAddr` (RustCrypto#1035) - `CertReq` builder (RustCrypto#1034) - missing extension implementations (RustCrypto#1050) - notes about `UTCTime` range being 1970-2049 (RustCrypto#1052) Changed - use `ErrorKind::Value` for overlength serial (RustCrypto#988) - Bump `hex-literal` to v0.4.1 (RustCrypto#999) - Builder updates (RustCrypto#1001) - better debug info when `zlint` isn't installed (RustCrypto#1018) - make SKI optional in leaf certificate (RustCrypto#1028) - bump rsa from 0.9.0-pre.2 to 0.9.0 (RustCrypto#1033) - bump rsa from 0.9.1 to 0.9.2 (RustCrypto#1056) Fixed - fix `KeyUsage` bit tests (RustCrypto#993) - extraneous PhantomData in `TbsCertificate` (RustCrypto#1017) - CI flakiness (RustCrypto#1042) - usage of ecdsa signer (RustCrypto#1043)
Added - Certificate builder (RustCrypto#764) - Support for `RandomizedSigner` in builder (RustCrypto#1007) - Provide parsing profiles (RustCrypto#987) - Support for `Time::INFINITY` (RustCrypto#1024) - Conversion from `std::net::IpAddr` (RustCrypto#1035) - `CertReq` builder (RustCrypto#1034) - missing extension implementations (RustCrypto#1050) - notes about `UTCTime` range being 1970-2049 (RustCrypto#1052) - consume the `SignatureBitStringEncoding` trait (RustCrypto#1048) Changed - use `ErrorKind::Value` for overlength serial (RustCrypto#988) - Bump `hex-literal` to v0.4.1 (RustCrypto#999) - Builder updates (RustCrypto#1001) - better debug info when `zlint` isn't installed (RustCrypto#1018) - make SKI optional in leaf certificate (RustCrypto#1028) - bump rsa from 0.9.0-pre.2 to 0.9.0 (RustCrypto#1033) - bump rsa from 0.9.1 to 0.9.2 (RustCrypto#1056) Fixed - fix `KeyUsage` bit tests (RustCrypto#993) - extraneous PhantomData in `TbsCertificate` (RustCrypto#1017) - CI flakiness (RustCrypto#1042) - usage of ecdsa signer (RustCrypto#1043)
Added - Certificate builder (#764) - Support for `RandomizedSigner` in builder (#1007) - Provide parsing profiles (#987) - Support for `Time::INFINITY` (#1024) - Conversion from `std::net::IpAddr` (#1035) - `CertReq` builder (#1034) - missing extension implementations (#1050) - notes about `UTCTime` range being 1970-2049 (#1052) - consume the `SignatureBitStringEncoding` trait (#1048) Changed - use `ErrorKind::Value` for overlength serial (#988) - Bump `hex-literal` to v0.4.1 (#999) - Builder updates (#1001) - better debug info when `zlint` isn't installed (#1018) - make SKI optional in leaf certificate (#1028) - bump rsa from 0.9.0-pre.2 to 0.9.0 (#1033) - bump rsa from 0.9.1 to 0.9.2 (#1056) Fixed - fix `KeyUsage` bit tests (#993) - extraneous PhantomData in `TbsCertificate` (#1017) - CI flakiness (#1042) - usage of ecdsa signer (#1043)
This is an attempt at a certificate builder.
See: #418