lua-bcrypt icon indicating copy to clipboard operation
lua-bcrypt copied to clipboard

ggentropy: add "portable" path using /dev/urandom

Open alarixnia opened this issue 2 years ago • 4 comments

Needed on Solaris and so on.

alarixnia avatar Jan 16 '22 13:01 alarixnia

seems like it would be better to use arc4random on solaris

Also I'm hesitant to add a catch all. ggentropy already has code paths for platforms that I never have and never will actually test it on and Solaris is another like that. I'd prefer to at least restrict it to platforms I've skimmed the manpages for

mikejsavage avatar Jan 20 '22 18:01 mikejsavage

we still support solaris 10 in pkgsrc which lacks such a function, among other less commom unix-likes, so i'd like to keep patching this in.

alarixnia avatar Jan 20 '22 22:01 alarixnia

On Thu, Jan 20, 2022 at 02:12:33PM -0800, nia wrote:

we still support solaris 10 in pkgsrc which lacks such a function, among other less commom unix-likes, so i'd like to keep patching this in.

-- Reply to this email directly or view it on GitHub: https://github.com/mikejsavage/lua-bcrypt/pull/18#issuecomment-1017972350 You are receiving this because you commented.

Message ID: @.***>

Do you know if there's some way to detect solaris 10 at compile time?

Would be nice to use their entropy syscall when available

https://gist.github.com/basman/587684 makes it look like there isn't

mikejsavage avatar Jan 29 '22 11:01 mikejsavage

Add Debian 8 to the list of platforms lacking SYS_getrandom:

gcc -I/tmp/work/openssl-1.1.1m/include -std=gnu99 -fPIC -I/tmp/build/usr/local/openresty/luajit/include/luajit-2.1 -c src/ggentropy.c -o src/ggentropy.o
src/ggentropy.c: In function 'ggentropy':
src/ggentropy.c:59:20: error: 'SYS_getrandom' undeclared (first use in this function)
  int ok = syscall( SYS_getrandom, buf, n, 0 );
                    ^
src/ggentropy.c:59:20: note: each undeclared identifier is reported only once for each function it appears in

Error: Failed installing dependency: https://luarocks.org/bcrypt-2.2-1.src.rock - Build error: Failed compiling object src/ggentropy.o

curiositycasualty avatar Jan 31 '22 17:01 curiositycasualty

Sorry, but I have no interest in supporting Solaris from 2005 even if it is still under LTS.

Likewise Debian 8 is on a second level of LTS with the underlying kernel EOL'd.

mikejsavage avatar Dec 11 '23 12:12 mikejsavage