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

Replace deprecated Win API calls in Win32_EntropySource #365

Merged
merged 1 commit into from
Jan 13, 2016

Conversation

neusdan
Copy link
Collaborator

@neusdan neusdan commented Dec 16, 2015

@randombit
Copy link
Owner

Hm, the advantage here is fairly minimal since this is just for entropy gathering, but I do see that the old MemoryStatus call is documented as failing (returning -1 in the fields) if the machine has over 4G of memory, which these days is most of them, so using Ex would be more likely to generate good results. Looks like support for TickCount was added in XP/2003 and MemoryStatusEx in Vista/2008. So this would break support for very old systems (XP/2003) but as both are EOLed by MS anyway I'm inclined to see that side effect as a feature :) and anyway support for XP is AFAIK completely untested and so hypothetical in any case

@neusdan
Copy link
Collaborator Author

neusdan commented Dec 18, 2015

I'm fine with dropping support for Windows XP :-)

@randombit randombit merged commit d94d86c into randombit:master Jan 13, 2016
randombit added a commit that referenced this pull request Jan 13, 2016
…urce

By adopting MemoryStatusEx, this drops support for XP and Server 2003
which do not implement this API. This is considered a feature as these
versions are already EOLed by Microsoft.
randombit added a commit that referenced this pull request Feb 6, 2016
Thinking it over I've realized this was not a good move; XP may be EOLed but is
still widely used and even VS 2015 still supports targeting XP. It's not really
the same situation as going to extra efforts for supporting SunOS 5.1 or VAX/VMS,
instead it actively broke support for something which is still widely deployed.

And for those building for XP the options are patch out the call (GH #416) or
disable win32_stats altogether in their build. I'd like to prevent downstream
distributors from having to patch, because that can get messy. And while the
design of CryptGenRandom is not disclosed it apparently has changed over time
and at one point (IIRC) used RC4 to generate outputs, so if there is any OS that
could use some extra help generating seed material it is XP.

There may be future code that really makes use of APIs added after XP - CryptoNG,
TPM support, etc and then people targetting XP will have to compile out those
modules. But it doesn't make sense to break it here for this small gain.
@neusdan neusdan mentioned this pull request Feb 8, 2016
0xa5a5 pushed a commit to 0xa5a5/botan that referenced this pull request Nov 8, 2019
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.

2 participants