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

Builder feature on no-std and no getrandom supported targets #1697

Open
MihaelBercic opened this issue Mar 7, 2025 · 4 comments
Open

Builder feature on no-std and no getrandom supported targets #1697

MihaelBercic opened this issue Mar 7, 2025 · 4 comments

Comments

@MihaelBercic
Copy link

Would it be possible to have the "builder" feature be without the "std" feature and without the "getrandom" dependency?

For usage on no-std targets and no getrandom supported targets (esp32).

@tarcieri
Copy link
Member

tarcieri commented Mar 7, 2025

It looks like the one usage of std is for SystemTime to build the signing time attribute.

That can potentially be replaced by an explicit parameter, similar to how the ssh-key crate works.

Offhand I don't see where the builder is pulling in getrandom though.

@MihaelBercic
Copy link
Author

MihaelBercic commented Mar 7, 2025

That'd be awesome.

Regarding the getrandom, it seems to be:

cargo tree --edges all

│   │   │   ├── rsa feature "std"
│   │   │   │   ├── rsa v0.9.7 (*)
│   │   │   │   ├── rand_core feature "std"
│   │   │   │   │   ├── rand_core v0.6.4 (*)
│   │   │   │   │   ├── rand_core feature "alloc"
│   │   │   │   │   │   └── rand_core v0.6.4 (*)
│   │   │   │   │   ├── rand_core feature "getrandom"
│   │   │   │   │   │   └── rand_core v0.6.4 (*)
│   │   │   │   │   └── getrandom feature "std"
│   │   │   │   │       └── getrandom v0.2.15 (*)

and

── cms feature "builder"
│   ├── cms v0.2.3
│   │   ├── aes feature "default"
│   │   │   └── aes v0.8.4
│   │   │       ├── cfg-if feature "default"
│   │   │       │   └── cfg-if v1.0.0
│   │   │       └── cipher feature "default"
│   │   │           └── cipher v0.4.4
│   │   │               ├── crypto-common feature "default"
│   │   │               │   └── crypto-common v0.1.6
│   │   │               │       ├── generic-array feature "default"
│   │   │               │       │   └── generic-array v0.14.7
│   │   │               │       │       └── typenum feature "default"
│   │   │               │       │           └── typenum v1.18.0
│   │   │               │       │       [build-dependencies]
│   │   │               │       │       └── version_check feature "default"
│   │   │               │       │           └── version_check v0.9.5
│   │   │               │       ├── generic-array feature "more_lengths"
│   │   │               │       │   └── generic-array v0.14.7 (*)
│   │   │               │       ├── typenum feature "default" (*)
│   │   │               │       └── rand_core feature "default"
│   │   │               │           └── rand_core v0.6.4
│   │   │               │               └── getrandom feature "default"
│   │   │               │                   └── getrandom v0.2.15
│   │   │               │                       └── cfg-if feature "default" (*)

@tarcieri
Copy link
Member

tarcieri commented Mar 7, 2025

Might need to add default-features = false to rsa and possibly aes too

@MihaelBercic
Copy link
Author

Might need to add default-features = false to rsa and possibly aes too

Thank you

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

No branches or pull requests

2 participants