indygreg / cryptography-rs

A collection of Rust crates in the cryptography space
12 stars 16 forks source link

Break out the ASN1 primitives into their own crate or feature? #9

Open scouten-adobe opened 1 year ago

scouten-adobe commented 1 year ago

I'm wondering if it would be possible to break out the ASN1 primitives in the asn1 folder as their own independent crate or as a feature of the CMS crate that we could use independently? The rest of the crate brings in dependencies that we can't support (notably blocking calls on reqwest that can't compile on some of our targeted platforms).

indygreg commented 1 year ago

reqwest is an optional feature of the cryptography-message-syntax crate and is disabled by default. I thought Cargo was smart enough to elide crates from optional dependencies?

If there are solid reasons to split out the ASN.1 types into their own crate, we can do it. But I'd prefer they remain where they are.

scouten-adobe commented 1 year ago

I think it could be done in place by using crate features here. Would you welcome a PR if I spend the time on it?

indygreg commented 1 year ago

Yes, I would welcome PRs to add features to make dependency bloat optional.

latonis commented 4 months ago

I've gone ahead and created the PR (https://github.com/indygreg/cryptography-rs/pull/21) to break out reqwest into a feature. To prevent breaking changes, I added the http feature to include reqwest and included it in the default feature set.

To avoid bringing down reqwest and its dep list, one can do the following in Cargo.toml:

cryptographic-message-syntax = { version = "0.26.0", default-features = false }