aboutsummaryrefslogtreecommitdiff
path: root/passgen.c
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2023-05-07 20:37:31 +1000
committerNicholas Tay <nick@windblume.net>2023-05-07 20:37:31 +1000
commita9cb98a3e83cc357cf15bff1327a86b99f869549 (patch)
tree7585ae24d77341ba6e31767e534d3da1a6151fc4 /passgen.c
parent1372cd7042a592e0b370106fd1cbfb6bdc56efe8 (diff)
downloadpassgen-a9cb98a3e83cc357cf15bff1327a86b99f869549.tar.gz
passgen-a9cb98a3e83cc357cf15bff1327a86b99f869549.tar.bz2
passgen-a9cb98a3e83cc357cf15bff1327a86b99f869549.zip
Use wincrypt on msys2
Not sure what I was using, this actually does work. Maybe I was just missing the package in the w32api headers in the past...
Diffstat (limited to 'passgen.c')
-rw-r--r--passgen.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/passgen.c b/passgen.c
index d8b2201..1961793 100644
--- a/passgen.c
+++ b/passgen.c
@@ -12,7 +12,8 @@
|| defined (__FreeBSD__) \
|| defined (__OpenBSD__)
# define USE_GETENTROPY
-#elif defined (_WIN32) && ! defined (__MINGW32__)
+#elif defined (_WIN32) \
+ || defined(__CYGWIN__)
# define USE_WINCRYPT
#endif
@@ -30,12 +31,7 @@
# include <wincrypt.h>
#else
# include <time.h>
-/* getpid() on Windows */
-# if defined (_WIN32) && ! defined (__MINGW32__)
-# include <io.h>
-# else
-# include <unistd.h>
-# endif
+# include <unistd.h>
#endif
@@ -71,6 +67,7 @@ bool init_rng(void)
))
return false;
#elif ! defined (USE_GETENTROPY) && ! defined (USE_WINCRYPT)
+#pragma message "Using fallback insecure RNG seeding!"
/*
* TODO: seed better RNG
* this isn't very good, but it's enough(?) for now