Added patches from Novell

This commit is contained in:
monty@mysql.com 2004-05-25 22:00:14 +03:00
commit f2e1e3ce4c
45 changed files with 778 additions and 124 deletions

View file

@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#ifdef HAVE_OPENSSL
#if defined(HAVE_OPENSSL) && !defined(__NETWARE__)
#include <my_sys.h>
#include <m_string.h>
#include <m_ctype.h>

View file

@ -25,6 +25,31 @@
#ifdef HAVE_OPENSSL
#ifdef __NETWARE__
/*
The default OpenSSL implementation on NetWare uses WinSock.
This code allows us to use the BSD sockets.
*/
static int SSL_set_fd_bsd(SSL *s, int fd)
{
int result= -1;
BIO_METHOD *BIO_s_bsdsocket();
BIO *bio;
if ((bio= BIO_new(BIO_s_bsdsocket())))
{
result= BIO_set_fd(bio, fd, BIO_NOCLOSE);
SSL_set_bio(s, bio, bio);
}
return result;
}
#define SSL_set_fd(A, B) SSL_set_fd_bsd((A), (B))
#endif /* __NETWARE__ */
static void
report_errors()
{

View file

@ -172,6 +172,35 @@ vio_verify_callback(int ok, X509_STORE_CTX *ctx)
}
#ifdef __NETWARE__
/* NetWare SSL cleanup */
void netware_ssl_cleanup()
{
/* free memory from SSL_library_init() */
EVP_cleanup();
/* free global X509 method */
X509_STORE_method_cleanup();
/* free the thread_hash error table */
ERR_free_state_table();
}
/* NetWare SSL initialization */
static void netware_ssl_init()
{
/* initialize OpenSSL library */
SSL_library_init();
/* cleanup OpenSSL library */
NXVmRegisterExitHandler(netware_ssl_cleanup, NULL);
}
#endif /* __NETWARE__ */
/************************ VioSSLConnectorFd **********************************/
/*
TODO:
@ -188,7 +217,7 @@ new_VioSSLConnectorFd(const char* key_file,
int verify = SSL_VERIFY_NONE;
struct st_VioSSLConnectorFd* ptr;
int result;
DH *dh=NULL;
DH *dh;
DBUG_ENTER("new_VioSSLConnectorFd");
DBUG_PRINT("enter",
("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s",
@ -202,6 +231,10 @@ new_VioSSLConnectorFd(const char* key_file,
ptr->ssl_method= 0;
/* FIXME: constants! */
#ifdef __NETWARE__
netware_ssl_init();
#endif
if (!ssl_algorithms_added)
{
DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()"));
@ -279,7 +312,7 @@ new_VioSSLAcceptorFd(const char *key_file,
SSL_VERIFY_CLIENT_ONCE);
struct st_VioSSLAcceptorFd* ptr;
int result;
DH *dh=NULL;
DH *dh;
DBUG_ENTER("new_VioSSLAcceptorFd");
DBUG_PRINT("enter",
("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s",
@ -292,6 +325,10 @@ new_VioSSLAcceptorFd(const char *key_file,
/* FIXME: constants! */
ptr->session_id_context= ptr;
#ifdef __NETWARE__
netware_ssl_init();
#endif
if (!ssl_algorithms_added)
{
DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()"));