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

Avoiding allocating a handle in the Windows RNG. #1046

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

teo-tsirpanis
Copy link
Contributor

Issue #, if available:

Description of changes:

This PR uses the BCRYPT_USE_SYSTEM_PREFERRED_RNG option in the call to BCryptGenRandom to avoid allocating an algorithm handle, and simplifying the code a bit.

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

This PR uses the `BCRYPT_USE_SYSTEM_PREFERRED_RNG` option in the call to `BCryptGenRandom` to avoid allocating an algorithm handle, and simplifying the code a bit.
@jmklix
Copy link
Member

jmklix commented Feb 6, 2024

Can you please explain why you would want to avoid allocating an algorithm handle?

@jmklix jmklix added the response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 2 days. label Feb 6, 2024
Copy link

Greetings! It looks like this PR hasn’t been active in longer than a week, add a comment or an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 5 days unless further comments are made. label Feb 16, 2024
@teo-tsirpanis
Copy link
Contributor Author

Can you please explain why you would want to avoid allocating an algorithm handle?

It reduces global state and slightly simplifies the code. This approach is being used by OpenSSL and .NET among others.

@github-actions github-actions bot removed closing-soon This issue will automatically close in 5 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 2 days. labels Feb 17, 2024
@graebm graebm enabled auto-merge (squash) July 29, 2024 22:13
@graebm
Copy link
Contributor

graebm commented Jul 29, 2024

Thanks!

@graebm graebm merged commit c9ead75 into awslabs:main Jul 29, 2024
53 checks passed
@teo-tsirpanis teo-tsirpanis deleted the patch-1 branch July 29, 2024 22:30
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.

3 participants