Modification for BoringSSL

This commit is contained in:
Gerhard Rieger 2016-12-12 20:53:08 +01:00
parent 008229cb9f
commit d5b87cea87
2 changed files with 13 additions and 2 deletions

View file

@ -55,6 +55,9 @@ porting:
providing the base patch. providing the base patch.
Debian Bug#828550 Debian Bug#828550
Make Socat compatible with BoringSSL.
Thanks to Matt Braithwaite for providing a patch.
testing: testing:
socks4echo.sh and socks4a-echo.sh hung with new bash with read -n socks4echo.sh and socks4a-echo.sh hung with new bash with read -n

View file

@ -1119,13 +1119,21 @@ static int openssl_SSL_ERROR_SSL(int level, const char *funcname) {
while (e = ERR_get_error()) { while (e = ERR_get_error()) {
Debug1("ERR_get_error(): %lx", e); Debug1("ERR_get_error(): %lx", e);
if (e == ((ERR_LIB_RAND<<24)| if
(
#if defined(OPENSSL_IS_BORINGSSL)
0 /* BoringSSL's RNG always succeeds. */
#else
e == ((ERR_LIB_RAND<<24)|
#if defined(RAND_F_RAND_BYTES) #if defined(RAND_F_RAND_BYTES)
(RAND_F_RAND_BYTES<<12)| (RAND_F_RAND_BYTES<<12)|
#else #else
(RAND_F_SSLEAY_RAND_BYTES<<12)| (RAND_F_SSLEAY_RAND_BYTES<<12)|
#endif #endif
(RAND_R_PRNG_NOT_SEEDED)) /*0x24064064*/) { (RAND_R_PRNG_NOT_SEEDED)) /*0x24064064*/
#endif
)
{
Error("too few entropy; use options \"egd\" or \"pseudo\""); Error("too few entropy; use options \"egd\" or \"pseudo\"");
stat = STAT_NORETRY; stat = STAT_NORETRY;
} else { } else {