Skip to content

Instantly share code, notes, and snippets.

@scottmac
Created July 20, 2011 18:22
Show Gist options
  • Save scottmac/1095554 to your computer and use it in GitHub Desktop.
Save scottmac/1095554 to your computer and use it in GitHub Desktop.
OpenSSL Patch for Windows
diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c
index 5d134e1..d74fa43 100644
--- a/crypto/rand/rand_win.c
+++ b/crypto/rand/rand_win.c
@@ -383,6 +383,11 @@ int RAND_poll(void)
if (advapi)
FreeLibrary(advapi);
+ /* If good then the Windows Crypto API worked, this does
+ the same as below so skip duplicating work */
+ if (good)
+ return (1);
+
if ((osverinfo.dwPlatformId != VER_PLATFORM_WIN32_NT ||
!OPENSSL_isservice()) &&
(user = LoadLibrary(TEXT("USER32.DLL"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment