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

[crypto-rustcrypto]: remove unused custom feature #161

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

mgeisler
Copy link
Contributor

Description of changes:

We don’t actually use the “custom” feature of the getrandom crate. We don't have the feature enabled in all the places where I'm trying to use mls-rs, so it would be nice if this crate doesn't require it.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.

@mgeisler mgeisler requested a review from a team as a code owner June 14, 2024 19:34
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.63%. Comparing base (9b55525) to head (68eaa11).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #161      +/-   ##
==========================================
- Coverage   89.65%   89.63%   -0.02%     
==========================================
  Files         175      175              
  Lines       31578    31578              
==========================================
- Hits        28310    28305       -5     
- Misses       3268     3273       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mulmarta
Copy link
Contributor

Seems to be used by embedded build @mgeisler. Maybe you could add this?

[target.'cfg(not(feature = "std"))'.dependencies]
getrandom = { version = "0.2", default-features = false, features = ["custom"] }

The `custom` feature from `getrandom` is not actually used in normal
builds — infact, `getrandom` itself is never used directly.

However, the feature can be used by a binary on an embedded platform
to register a custom random number generator. The final binary should
enable the `custom` feature to do this, see the
`register_custem_genrandom!` macro for more details:

  https://docs.rs/getrandom/latest/getrandom/macro.register_custom_getrandom.html

We emulate this in the CI build by enabling the feature on the command
line.
@mgeisler mgeisler force-pushed the remove-getrandom-custom branch from 68eaa11 to a80c868 Compare August 21, 2024 15:21
@mgeisler
Copy link
Contributor Author

Thanks @mulmarta for the debugging! I finally came back to this and I think I understand what the problem is. Based on reading register_custom_getrandom!, I now believe it was wrong for the mls-rs-crypto-rustcrypto library to enable this feature.

It should instead be enabled by the final binary. I've updated the CI script to do this and I hope it'll work now.

@mulmarta mulmarta merged commit cb5b9e9 into awslabs:main Sep 19, 2024
17 checks passed
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

Successfully merging this pull request may close these issues.

None yet

4 participants