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

std/sysrand for Windows XP #19538

Closed
wants to merge 1 commit into from
Closed

Conversation

rockcavera
Copy link
Contributor

BCryptGenRandom is not present in Windows XP, but has CryptGenRandom.

I believe this can be discussed.

`BCryptGenRandom` is not present in Windows XP, but has `CryptGenRandom`.
@rockcavera
Copy link
Contributor Author

The error you reported in "nim-lang.Nim (Windows_amd64_batch1_3 packages)" has to do with this problem here: #19537

As for the problem in "nim-lang.Nim (OSX_amd64_cpp packages)" I have no idea, but I guarantee it has nothing to do with this PR.

@Araq
Copy link
Member

Araq commented Feb 18, 2022

That's quite a lot of code in order to support Windows XP. I don't mind supporting XP if it doesn't take much effort but this seems excessive for an OS that Microsoft ended all support for on April 8th, 2014.

@wqweto
Copy link

wqweto commented Feb 18, 2022

IMO easiest way to support XP is to use RtlGenRandom in first place (that is SystemFunction036 export of advapi32.dll).

It does not need a handle being opened/closed like both current BCryptGenRandom and CryptGenRandom so an XP supporting implementation using RtlGenRandom might actually reduce boilerplate code.

@rockcavera
Copy link
Contributor Author

IMO easiest way to support XP is to use RtlGenRandom in first place (that is SystemFunction036 export of advapi32.dll).

It does not need a handle being opened/closed like both current BCryptGenRandom and CryptGenRandom so an XP supporting implementation using RtlGenRandom might actually reduce boilerplate code.

It appears to be the best solution. I researched and it seems to be used quite a lot by other languages and libraries.

golang/go#33542

@rockcavera
Copy link
Contributor Author

@xflywind I wanted to hear from you who added sysrand if there was any discussion about the Windows API and any objections to RtlGenRandom...

@Varriount
Copy link
Contributor

Looking at a related PR elsewhere, I agree with @wqweto. RtlGenRandom is the way to go here.

@stale
Copy link

stale bot commented Mar 14, 2023

This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions.

@stale stale bot added the stale Staled PR/issues; remove the label after fixing them label Mar 14, 2023
@stale stale bot closed this Apr 25, 2023
@Araq Araq removed the stale Staled PR/issues; remove the label after fixing them label Apr 26, 2023
@Araq Araq reopened this Apr 26, 2023
Copy link
Contributor

github-actions bot commented May 2, 2024

This pull request is stale because it has been open for 1 year with no activity. Contribute more commits on the pull request and rebase it on the latest devel, or it will be closed in 30 days. Thank you for your contributions.

@github-actions github-actions bot added the stale Staled PR/issues; remove the label after fixing them label May 2, 2024
Copy link
Contributor

github-actions bot commented Jun 8, 2024

This pull request has been marked as stale and closed due to inactivity after 395 days.

@github-actions github-actions bot closed this Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Staled PR/issues; remove the label after fixing them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants