Skip to content

FR: Opting out of algorithms #110

Description

@lorenzleutgeb

Hey!

Just looking at the dependency tree of a project I am working on, I realized that ssh-agent-lib pulls in quite a few crates that I believe I will never want to use. The reason is that in my project I am using Ed25519 only, no other ECDSAs and no RSA.

So, I would like to opt out of depending on:

  • p256
  • p384
  • p512
  • rsa
  • bcrypt-pbkdf (?, which pulls in blowfish)
  • ssh-cipher (?, which pulls in lots of encryption stuff like aes, chacha20, cbc, ...)

I realize that most of these come via ssh-key, but that crate does offer a list of features:

  • p256
  • p384
  • p512
  • rsa
  • encryption

Of course I understand that you would want ssh-agent-lib to be compatible with all kinds of signing and encryption mechanisms by default. I would like to ask you to add features to this crate, which you can immediately also add to its default features. Users like me could disable default features and then pick what they need.

There likely are some corner cases here: For example, what should happen when I have built ssh-agent-key without support for p256, but then the SSH agent lists identities of such kind? I would prefer these to be silently skipped or to produce a sentinel value of "unsupported algorithm" in the listing. I would be happy to discuss further.

Thanks!

Output of cargo tree
.
├── ssh-agent-lib v0.6.0
│   ├── byteorder v1.5.0
│   ├── log v0.4.29
│   ├── secrecy v0.10.3
│   │   └── zeroize v1.9.0
│   ├── signature v2.2.0 (*)
│   ├── ssh-encoding v0.2.0
│   │   ├── base64ct v1.8.3
│   │   ├── pem-rfc7468 v0.7.0
│   │   │   └── base64ct v1.8.3
│   │   └── sha2 v0.10.9 (*)
│   ├── ssh-key v0.6.7
│   │   ├── bcrypt-pbkdf v0.10.0
│   │   │   ├── blowfish v0.9.1
│   │   │   │   ├── byteorder v1.5.0
│   │   │   │   └── cipher v0.4.4
│   │   │   │       ├── crypto-common v0.1.7 (*)
│   │   │   │       └── inout v0.1.4
│   │   │   │           ├── block-padding v0.3.3
│   │   │   │           │   └── generic-array v0.14.7 (*)
│   │   │   │           └── generic-array v0.14.7 (*)
│   │   │   ├── pbkdf2 v0.12.2
│   │   │   │   └── digest v0.10.7 (*)
│   │   │   └── sha2 v0.10.9 (*)
│   │   ├── ed25519-dalek v2.2.0 (*)
│   │   ├── num-bigint-dig v0.8.6
│   │   │   ├── lazy_static v1.5.0
│   │   │   │   └── spin v0.9.8
│   │   │   ├── libm v0.2.16
│   │   │   ├── num-integer v0.1.46
│   │   │   │   └── num-traits v0.2.19
│   │   │   │       └── libm v0.2.16
│   │   │   │       [build-dependencies]
│   │   │   │       └── autocfg v1.5.0
│   │   │   ├── num-iter v0.1.45
│   │   │   │   ├── num-integer v0.1.46 (*)
│   │   │   │   └── num-traits v0.2.19 (*)
│   │   │   │   [build-dependencies]
│   │   │   │   └── autocfg v1.5.0
│   │   │   ├── num-traits v0.2.19 (*)
│   │   │   ├── rand v0.8.5
│   │   │   │   ├── rand_chacha v0.3.1
│   │   │   │   │   ├── ppv-lite86 v0.2.21
│   │   │   │   │   │   └── zerocopy v0.8.42
│   │   │   │   │   └── rand_core v0.6.4 (*)
│   │   │   │   └── rand_core v0.6.4 (*)
│   │   │   ├── smallvec v1.15.1
│   │   │   └── zeroize v1.9.0
│   │   ├── p256 v0.13.2
│   │   │   ├── ecdsa v0.16.9
│   │   │   │   ├── der v0.7.10
│   │   │   │   │   ├── const-oid v0.9.6
│   │   │   │   │   └── zeroize v1.9.0
│   │   │   │   ├── digest v0.10.7 (*)
│   │   │   │   ├── elliptic-curve v0.13.8
│   │   │   │   │   ├── base16ct v0.2.0
│   │   │   │   │   ├── crypto-bigint v0.5.5
│   │   │   │   │   │   ├── generic-array v0.14.7 (*)
│   │   │   │   │   │   ├── rand_core v0.6.4 (*)
│   │   │   │   │   │   ├── subtle v2.6.1
│   │   │   │   │   │   └── zeroize v1.9.0
│   │   │   │   │   ├── digest v0.10.7 (*)
│   │   │   │   │   ├── ff v0.13.1
│   │   │   │   │   │   ├── rand_core v0.6.4 (*)
│   │   │   │   │   │   └── subtle v2.6.1
│   │   │   │   │   ├── generic-array v0.14.7 (*)
│   │   │   │   │   ├── group v0.13.0
│   │   │   │   │   │   ├── ff v0.13.1 (*)
│   │   │   │   │   │   ├── rand_core v0.6.4 (*)
│   │   │   │   │   │   └── subtle v2.6.1
│   │   │   │   │   ├── rand_core v0.6.4 (*)
│   │   │   │   │   ├── sec1 v0.7.3
│   │   │   │   │   │   ├── base16ct v0.2.0
│   │   │   │   │   │   ├── der v0.7.10 (*)
│   │   │   │   │   │   ├── generic-array v0.14.7 (*)
│   │   │   │   │   │   ├── subtle v2.6.1
│   │   │   │   │   │   └── zeroize v1.9.0
│   │   │   │   │   ├── subtle v2.6.1
│   │   │   │   │   └── zeroize v1.9.0
│   │   │   │   ├── rfc6979 v0.4.0
│   │   │   │   │   ├── hmac v0.12.1
│   │   │   │   │   │   └── digest v0.10.7 (*)
│   │   │   │   │   └── subtle v2.6.1
│   │   │   │   ├── signature v2.2.0 (*)
│   │   │   │   └── spki v0.7.3
│   │   │   │       └── der v0.7.10 (*)
│   │   │   ├── elliptic-curve v0.13.8 (*)
│   │   │   ├── primeorder v0.13.6
│   │   │   │   └── elliptic-curve v0.13.8 (*)
│   │   │   └── sha2 v0.10.9 (*)
│   │   ├── p384 v0.13.1
│   │   │   ├── ecdsa v0.16.9 (*)
│   │   │   ├── elliptic-curve v0.13.8 (*)
│   │   │   ├── primeorder v0.13.6 (*)
│   │   │   └── sha2 v0.10.9 (*)
│   │   ├── p521 v0.13.3
│   │   │   ├── base16ct v0.2.0
│   │   │   ├── ecdsa v0.16.9 (*)
│   │   │   ├── elliptic-curve v0.13.8 (*)
│   │   │   ├── primeorder v0.13.6 (*)
│   │   │   ├── rand_core v0.6.4 (*)
│   │   │   └── sha2 v0.10.9 (*)
│   │   ├── rand_core v0.6.4 (*)
│   │   ├── rsa v0.9.10
│   │   │   ├── const-oid v0.9.6
│   │   │   ├── digest v0.10.7 (*)
│   │   │   ├── num-bigint-dig v0.8.6 (*)
│   │   │   ├── num-integer v0.1.46 (*)
│   │   │   ├── num-traits v0.2.19 (*)
│   │   │   ├── pkcs1 v0.7.5
│   │   │   │   ├── der v0.7.10 (*)
│   │   │   │   ├── pkcs8 v0.10.2
│   │   │   │   │   ├── der v0.7.10 (*)
│   │   │   │   │   └── spki v0.7.3 (*)
│   │   │   │   └── spki v0.7.3 (*)
│   │   │   ├── pkcs8 v0.10.2 (*)
│   │   │   ├── rand_core v0.6.4 (*)
│   │   │   ├── sha2 v0.10.9 (*)
│   │   │   ├── signature v2.2.0 (*)
│   │   │   ├── spki v0.7.3 (*)
│   │   │   ├── subtle v2.6.1
│   │   │   └── zeroize v1.9.0
│   │   ├── sec1 v0.7.3 (*)
│   │   ├── sha2 v0.10.9 (*)
│   │   ├── signature v2.2.0 (*)
│   │   ├── ssh-cipher v0.2.0
│   │   │   ├── aes v0.8.4
│   │   │   │   ├── cfg-if v1.0.4
│   │   │   │   ├── cipher v0.4.4 (*)
│   │   │   │   └── cpufeatures v0.2.17
│   │   │   ├── aes-gcm v0.10.3
│   │   │   │   ├── aead v0.5.2
│   │   │   │   │   ├── crypto-common v0.1.7 (*)
│   │   │   │   │   └── generic-array v0.14.7 (*)
│   │   │   │   ├── aes v0.8.4 (*)
│   │   │   │   ├── cipher v0.4.4 (*)
│   │   │   │   ├── ctr v0.9.2
│   │   │   │   │   └── cipher v0.4.4 (*)
│   │   │   │   ├── ghash v0.5.1
│   │   │   │   │   ├── opaque-debug v0.3.1
│   │   │   │   │   └── polyval v0.6.2
│   │   │   │   │       ├── cfg-if v1.0.4
│   │   │   │   │       ├── cpufeatures v0.2.17
│   │   │   │   │       ├── opaque-debug v0.3.1
│   │   │   │   │       └── universal-hash v0.5.1
│   │   │   │   │           ├── crypto-common v0.1.7 (*)
│   │   │   │   │           └── subtle v2.6.1
│   │   │   │   └── subtle v2.6.1
│   │   │   ├── cbc v0.1.2
│   │   │   │   └── cipher v0.4.4 (*)
│   │   │   ├── chacha20 v0.9.1
│   │   │   │   ├── cfg-if v1.0.4
│   │   │   │   ├── cipher v0.4.4 (*)
│   │   │   │   └── cpufeatures v0.2.17
│   │   │   ├── cipher v0.4.4 (*)
│   │   │   ├── ctr v0.9.2 (*)
│   │   │   ├── poly1305 v0.8.0
│   │   │   │   ├── cpufeatures v0.2.17
│   │   │   │   ├── opaque-debug v0.3.1
│   │   │   │   └── universal-hash v0.5.1 (*)
│   │   │   ├── ssh-encoding v0.2.0 (*)
│   │   │   └── subtle v2.6.1
│   │   ├── ssh-encoding v0.2.0 (*)
│   │   ├── subtle v2.6.1
│   │   └── zeroize v1.9.0
│   ├── subtle v2.6.1
│   └── thiserror v2.0.18
│       └── thiserror-impl v2.0.18 (proc-macro)
│           ├── proc-macro2 v1.0.106 (*)
│           ├── quote v1.0.45 (*)
│           └── syn v2.0.117 (*)
[... other dependencies ...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    pr welcomePR fixing this issue would be merged

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions