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

add an opt-in less-safe-getrandom-custom feature #1754

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

japaric
Copy link
Contributor

@japaric japaric commented Oct 16, 2023

This Cargo feature treats a user-provided getrandom implementation as a secure random number generator (SecureRandom). The feature only has effect on targets not supported by getrandom.

closes #1734

Copy link
Owner

@briansmith briansmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this.

Cargo.toml Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/rand.rs Outdated Show resolved Hide resolved
This Cargo feature treats a user-provided `getrandom` implementation as
a secure random number generator (`SecureRandom`). The feature only has
effect on targets not supported by `getrandom`.

I agree to license my contributions to each file under the terms given
at the top of each file I changed.
and have it apply only when `target_os = "none"`
@japaric japaric force-pushed the less-safe-getrandom-custom branch from 604caec to 2756989 Compare November 3, 2023 13:05
@japaric
Copy link
Contributor Author

japaric commented Nov 3, 2023

thanks for the review. I have addressed your comments in a new commit. let me know if I should squash the commits.

@japaric
Copy link
Contributor Author

japaric commented Nov 10, 2023

is there anything else that should be done in this PR?

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8ed4860) 96.04% compared to head (2756989) 96.04%.
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1754      +/-   ##
==========================================
- Coverage   96.04%   96.04%   -0.01%     
==========================================
  Files         137      137              
  Lines       20812    20812              
  Branches      226      226              
==========================================
- Hits        19989    19988       -1     
  Misses        790      790              
- Partials       33       34       +1     

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

@briansmith briansmith merged commit 7fa58cc into briansmith:main Nov 14, 2023
126 of 127 checks passed
@dangeross dangeross mentioned this pull request Nov 15, 2023
3 tasks
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.

provide a mechanism to mark a custom getrandom implementation as being SecureRandom
2 participants