diff options
author | Darren Tucker <dtucker@dtucker.net> | 2022-08-05 13:12:27 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2022-08-05 13:12:27 +1000 |
commit | 3d3a932a019aedfb891e0779bb4990cd5008a390 (patch) | |
tree | 403471b1c4239b4ba73cc8455c0fc59fd1d9a0b3 /openbsd-compat/openbsd-compat.h | |
parent | 9385d277b787403be9dfcb229cf372202496d2f3 (diff) | |
download | openssh-git-3d3a932a019aedfb891e0779bb4990cd5008a390.tar.gz |
Factor out getrnd() and rename to getentropy().
Factor out the arc4random seeding into its own file and change the
interface to match getentropy. Use native getentropy if available.
This will make it easier to resync OpenBSD changes to arc4random.
Prompted by bz#3467, ok djm@.
Diffstat (limited to 'openbsd-compat/openbsd-compat.h')
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 4316ab84..93efff2f 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -69,6 +69,10 @@ void closefrom(int); int ftruncate(int filedes, off_t length); #endif +#if defined(HAVE_DECL_GETENTROPY) && HAVE_DECL_GETENTROPY == 0 +int getentropy(void *, size_t); +#endif + #ifndef HAVE_GETLINE #include <stdio.h> ssize_t getline(char **, size_t *, FILE *); |