mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
openssl: RAND_status always exists in OpenSSL >= 0.9.7
and remove RAND_screen from configure since nothing is using that function
This commit is contained in:
parent
cbec00d914
commit
f9de7c405f
@ -1637,9 +1637,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
|||||||
dnl SSL_get_shutdown (but this check won't actually detect it there
|
dnl SSL_get_shutdown (but this check won't actually detect it there
|
||||||
dnl as it's a macro that needs the header files be included)
|
dnl as it's a macro that needs the header files be included)
|
||||||
|
|
||||||
AC_CHECK_FUNCS( RAND_status \
|
AC_CHECK_FUNCS( RAND_egd \
|
||||||
RAND_screen \
|
|
||||||
RAND_egd \
|
|
||||||
ENGINE_cleanup \
|
ENGINE_cleanup \
|
||||||
SSL_get_shutdown \
|
SSL_get_shutdown \
|
||||||
SSLv2_client_method )
|
SSLv2_client_method )
|
||||||
|
@ -176,26 +176,12 @@ static int passwd_callback(char *buf, int num, int encrypting,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rand_enough() is a function that returns TRUE if we have seeded the random
|
* rand_enough() returns TRUE if we have seeded the random engine properly.
|
||||||
* engine properly. We use some preprocessor magic to provide a seed_enough()
|
|
||||||
* macro to use, just to prevent a compiler warning on this function if we
|
|
||||||
* pass in an argument that is never used.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_RAND_STATUS
|
|
||||||
#define seed_enough(x) rand_enough()
|
|
||||||
static bool rand_enough(void)
|
static bool rand_enough(void)
|
||||||
{
|
{
|
||||||
return (0 != RAND_status()) ? TRUE : FALSE;
|
return (0 != RAND_status()) ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define seed_enough(x) rand_enough(x)
|
|
||||||
static bool rand_enough(int nread)
|
|
||||||
{
|
|
||||||
/* this is a very silly decision to make */
|
|
||||||
return (nread > 500) ? TRUE : FALSE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int ossl_seed(struct Curl_easy *data)
|
static int ossl_seed(struct Curl_easy *data)
|
||||||
{
|
{
|
||||||
@ -217,7 +203,7 @@ static int ossl_seed(struct Curl_easy *data)
|
|||||||
data->set.str[STRING_SSL_RANDOM_FILE]:
|
data->set.str[STRING_SSL_RANDOM_FILE]:
|
||||||
RANDOM_FILE),
|
RANDOM_FILE),
|
||||||
RAND_LOAD_LENGTH);
|
RAND_LOAD_LENGTH);
|
||||||
if(seed_enough(nread))
|
if(rand_enough())
|
||||||
return nread;
|
return nread;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +223,7 @@ static int ossl_seed(struct Curl_easy *data)
|
|||||||
data->set.str[STRING_SSL_EGDSOCKET]:EGD_SOCKET);
|
data->set.str[STRING_SSL_EGDSOCKET]:EGD_SOCKET);
|
||||||
if(-1 != ret) {
|
if(-1 != ret) {
|
||||||
nread += ret;
|
nread += ret;
|
||||||
if(seed_enough(nread))
|
if(rand_enough())
|
||||||
return nread;
|
return nread;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -258,7 +244,7 @@ static int ossl_seed(struct Curl_easy *data)
|
|||||||
if(buf[0]) {
|
if(buf[0]) {
|
||||||
/* we got a file name to try */
|
/* we got a file name to try */
|
||||||
nread += RAND_load_file(buf, RAND_LOAD_LENGTH);
|
nread += RAND_load_file(buf, RAND_LOAD_LENGTH);
|
||||||
if(seed_enough(nread))
|
if(rand_enough())
|
||||||
return nread;
|
return nread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user