forked from wolfSSL/wolfssl
make sure enable-webserver (HAVE_WEBSERVER) can handle password callbacks as well as opensslextra unless NO_PWDBASED defined
This commit is contained in:
30
configure.ac
30
configure.ac
@@ -985,6 +985,19 @@ fi
|
|||||||
AM_CONDITIONAL([BUILD_MD4], [test "x$ENABLED_MD4" = "xyes"])
|
AM_CONDITIONAL([BUILD_MD4], [test "x$ENABLED_MD4" = "xyes"])
|
||||||
|
|
||||||
|
|
||||||
|
# Web Server Build
|
||||||
|
AC_ARG_ENABLE([webserver],
|
||||||
|
[ --enable-webserver Enable Web Server (default: disabled)],
|
||||||
|
[ ENABLED_WEBSERVER=$enableval ],
|
||||||
|
[ ENABLED_WEBSERVER=no ]
|
||||||
|
)
|
||||||
|
|
||||||
|
if test "$ENABLED_WEBSERVER" = "yes"
|
||||||
|
then
|
||||||
|
AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# PWDBASED
|
# PWDBASED
|
||||||
AC_ARG_ENABLE([pwdbased],
|
AC_ARG_ENABLE([pwdbased],
|
||||||
[ --enable-pwdbased Enable PWDBASED (default: disabled)],
|
[ --enable-pwdbased Enable PWDBASED (default: disabled)],
|
||||||
@@ -994,9 +1007,9 @@ AC_ARG_ENABLE([pwdbased],
|
|||||||
|
|
||||||
if test "$ENABLED_PWDBASED" = "no"
|
if test "$ENABLED_PWDBASED" = "no"
|
||||||
then
|
then
|
||||||
if test "$ENABLED_OPENSSLEXTRA" = "yes"
|
if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_WEBSERVER" = "yes"
|
||||||
then
|
then
|
||||||
# opensslextra needs pwdbased
|
# opensslextra and webserver needs pwdbased
|
||||||
ENABLED_PWDBASED=yes
|
ENABLED_PWDBASED=yes
|
||||||
else
|
else
|
||||||
AM_CFLAGS="$AM_CFLAGS -DNO_PWDBASED"
|
AM_CFLAGS="$AM_CFLAGS -DNO_PWDBASED"
|
||||||
@@ -1040,19 +1053,6 @@ fi
|
|||||||
AM_CONDITIONAL([BUILD_RABBIT], [test "x$ENABLED_RABBIT" = "xyes"])
|
AM_CONDITIONAL([BUILD_RABBIT], [test "x$ENABLED_RABBIT" = "xyes"])
|
||||||
|
|
||||||
|
|
||||||
# Web Server Build
|
|
||||||
AC_ARG_ENABLE([webserver],
|
|
||||||
[ --enable-webserver Enable Web Server (default: disabled)],
|
|
||||||
[ ENABLED_WEBSERVER=$enableval ],
|
|
||||||
[ ENABLED_WEBSERVER=no ]
|
|
||||||
)
|
|
||||||
|
|
||||||
if test "$ENABLED_WEBSERVER" = "yes"
|
|
||||||
then
|
|
||||||
AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Filesystem Build
|
# Filesystem Build
|
||||||
AC_ARG_ENABLE([filesystem],
|
AC_ARG_ENABLE([filesystem],
|
||||||
[ --enable-filesystem Enable Filesystem support (default: enabled)],
|
[ --enable-filesystem Enable Filesystem support (default: enabled)],
|
||||||
|
@@ -282,7 +282,7 @@ static INLINE int mygetopt(int argc, char** argv, const char* optstring)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef OPENSSL_EXTRA
|
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
||||||
|
|
||||||
static INLINE int PasswordCallBack(char* passwd, int sz, int rw, void* userdata)
|
static INLINE int PasswordCallBack(char* passwd, int sz, int rw, void* userdata)
|
||||||
{
|
{
|
||||||
|
@@ -490,7 +490,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args)
|
|||||||
useClientCert = 0;
|
useClientCert = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OPENSSL_EXTRA
|
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
||||||
CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -139,7 +139,7 @@ void echoclient_test(void* args)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OPENSSL_EXTRA
|
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
||||||
SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -125,7 +125,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args)
|
|||||||
ctx = CyaSSL_CTX_new(method);
|
ctx = CyaSSL_CTX_new(method);
|
||||||
/* CyaSSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF); */
|
/* CyaSSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF); */
|
||||||
|
|
||||||
#ifdef OPENSSL_EXTRA
|
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
||||||
CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -374,7 +374,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
if (fewerPackets)
|
if (fewerPackets)
|
||||||
CyaSSL_CTX_set_group_messages(ctx);
|
CyaSSL_CTX_set_group_messages(ctx);
|
||||||
|
|
||||||
#ifdef OPENSSL_EXTRA
|
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
||||||
SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -367,7 +367,7 @@ int InitSSL_Ctx(CYASSL_CTX* ctx, CYASSL_METHOD* method)
|
|||||||
ctx->eccTempKeySz = ECDHE_SIZE;
|
ctx->eccTempKeySz = ECDHE_SIZE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OPENSSL_EXTRA
|
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
||||||
ctx->passwd_cb = 0;
|
ctx->passwd_cb = 0;
|
||||||
ctx->userdata = 0;
|
ctx->userdata = 0;
|
||||||
#endif /* OPENSSL_EXTRA */
|
#endif /* OPENSSL_EXTRA */
|
||||||
|
@@ -1193,7 +1193,7 @@ int CyaSSL_KeyPemToDer(const unsigned char* pem, int pemSz, unsigned char* buff,
|
|||||||
info.consumed = 0;
|
info.consumed = 0;
|
||||||
der.buffer = NULL;
|
der.buffer = NULL;
|
||||||
|
|
||||||
#ifdef OPENSSL_EXTRA
|
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
||||||
if (pass) {
|
if (pass) {
|
||||||
info.ctx = CyaSSL_CTX_new(CyaSSLv23_client_method());
|
info.ctx = CyaSSL_CTX_new(CyaSSLv23_client_method());
|
||||||
if (info.ctx == NULL)
|
if (info.ctx == NULL)
|
||||||
@@ -1829,7 +1829,7 @@ int CyaSSL_Init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OPENSSL_EXTRA) && !defined(NO_PWDBASED)
|
#if (defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)) && !defined(NO_PWDBASED)
|
||||||
if (pkcs8Enc) {
|
if (pkcs8Enc) {
|
||||||
int passwordSz;
|
int passwordSz;
|
||||||
char password[80];
|
char password[80];
|
||||||
|
Reference in New Issue
Block a user