Suggested enhancement
Currently, it looks like getrandom() is only supported if you're using glibc or (minipix?).
Could this maybe be expanded to Bionic and or other C libraries?
I'm not really sure what the best way to handle this would be, or even if maybe I'm the only one who has or will experience this one issue.
Justification
I ran into a bug with an app I'm developing when run under Android wherein libcurl would hang during initialization.
As it turns out, my app gets stuck waiting on a call to read() from /dev/random and my embedded Android system doesn't seem to be very good at generating entropy on it's own.
After tracking down the path of libcurl->mbedtls->tf-psa-crypto, I noticed that tf-psa-crypto reads from /dev/random if getrandom() isn't available.
I did a quick hack to add __BIONIC__ to the "test for Linux getrandom() support" test and my app launched instantly.
Line in question:
|
#if ((defined(__linux__) && defined(__GLIBC__)) || defined(__midipix__)) |
Suggested enhancement
Currently, it looks like getrandom() is only supported if you're using glibc or (minipix?).
Could this maybe be expanded to Bionic and or other C libraries?
I'm not really sure what the best way to handle this would be, or even if maybe I'm the only one who has or will experience this one issue.
Justification
I ran into a bug with an app I'm developing when run under Android wherein libcurl would hang during initialization.
As it turns out, my app gets stuck waiting on a call to read() from /dev/random and my embedded Android system doesn't seem to be very good at generating entropy on it's own.
After tracking down the path of libcurl->mbedtls->tf-psa-crypto, I noticed that tf-psa-crypto reads from /dev/random if getrandom() isn't available.
I did a quick hack to add __BIONIC__ to the "test for Linux getrandom() support" test and my app launched instantly.
Line in question:
TF-PSA-Crypto/platform/platform_util.c
Line 297 in 1e3d9f1