diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 10:47:50 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-15 10:47:50 -0300 |
commit | 649390ac814ce5ea1e77b833ab5fe92dfcfe86d5 (patch) | |
tree | ac8b15ac65b08a492c256369b73e372f6568c7a4 /vio | |
parent | 06b8897e8e9a27b6ffc562af90153ab63f30e63e (diff) | |
parent | 8df20918d6751dc1eeb47ab722269dbd9d2da297 (diff) | |
download | mariadb-git-649390ac814ce5ea1e77b833ab5fe92dfcfe86d5.tar.gz |
Merge of mysql-trunk-bugfixing into mysql-trunk-merge.
Diffstat (limited to 'vio')
-rw-r--r-- | vio/test-ssl.c | 26 | ||||
-rw-r--r-- | vio/test-sslclient.c | 6 | ||||
-rw-r--r-- | vio/test-sslserver.c | 4 | ||||
-rw-r--r-- | vio/vio.c | 6 | ||||
-rw-r--r-- | vio/viossl.c | 30 | ||||
-rw-r--r-- | vio/viosslfactories.c | 44 | ||||
-rw-r--r-- | vio/viotest-ssl.c | 24 |
7 files changed, 38 insertions, 102 deletions
diff --git a/vio/test-ssl.c b/vio/test-ssl.c index 855dc5fbb3e..1e846727d00 100644 --- a/vio/test-ssl.c +++ b/vio/test-ssl.c @@ -14,7 +14,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <my_global.h> -#if defined(HAVE_OPENSSL) && !defined(__NETWARE__) +#if defined(HAVE_OPENSSL) #include <my_sys.h> #include <m_string.h> #include <m_ctype.h> @@ -106,8 +106,8 @@ main(int argc, char** argv) child_pid = fork(); if (child_pid==-1) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("fork"); } if (child_pid==0) @@ -116,28 +116,28 @@ main(int argc, char** argv) char xbuf[100]; int r = vio_read(client_vio,xbuf, sizeof(xbuf)); if (r<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("client:SSL_read"); } xbuf[r] = 0; printf("client:got %s\n", xbuf); - my_free((uchar*)client_vio,MYF(0)); - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(client_vio); + my_free(ssl_acceptor); + my_free(ssl_connector); } else { const char* s = "Huhuhuh"; int r = vio_write(server_vio,(uchar*)s, strlen(s)); if (r<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("server:SSL_write"); } - my_free((uchar*)server_vio,MYF(0)); - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(server_vio); + my_free(ssl_acceptor); + my_free(ssl_connector); } return 0; } diff --git a/vio/test-sslclient.c b/vio/test-sslclient.c index e1b8461397b..643dcbf2c8e 100644 --- a/vio/test-sslclient.c +++ b/vio/test-sslclient.c @@ -84,13 +84,13 @@ main( int argc __attribute__((unused)), sslconnect(ssl_connector,client_vio,60L); err = vio_read(client_vio,xbuf, sizeof(xbuf)); if (err<=0) { - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_connector); fatal_error("client:SSL_read"); } xbuf[err] = 0; printf("client:got %s\n", xbuf); - my_free((uchar*)client_vio,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(client_vio); + my_free(ssl_connector); return 0; } #else /* HAVE_OPENSSL */ diff --git a/vio/test-sslserver.c b/vio/test-sslserver.c index f55b5bae53a..3123a4def2c 100644 --- a/vio/test-sslserver.c +++ b/vio/test-sslserver.c @@ -139,12 +139,12 @@ main(int argc __attribute__((unused)), char** argv) #if 0 if (err<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); + my_free(ssl_acceptor); fatal_error("server:SSL_write"); } #endif /* 0 */ - my_free((uchar*)ssl_acceptor,MYF(0)); + my_free(ssl_acceptor); return 0; } #else /* HAVE_OPENSSL */ diff --git a/vio/vio.c b/vio/vio.c index 73dd68b938f..67704a56b22 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -164,7 +164,7 @@ static void vio_init(Vio* vio, enum enum_vio_type type, void vio_reset(Vio* vio, enum enum_vio_type type, my_socket sd, HANDLE hPipe, uint flags) { - my_free(vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR)); + my_free(vio->read_buffer); vio_init(vio, type, sd, hPipe, flags); } @@ -263,8 +263,8 @@ void vio_delete(Vio* vio) if (vio->type != VIO_CLOSED) vio->vioclose(vio); - my_free((uchar*) vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) vio,MYF(0)); + my_free(vio->read_buffer); + my_free(vio); } diff --git a/vio/viossl.c b/vio/viossl.c index 0651fd8b7a3..79f358b047c 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -24,36 +24,6 @@ #ifdef HAVE_OPENSSL -#ifdef __NETWARE__ - -/* yaSSL already uses BSD sockets */ -#ifndef HAVE_YASSL - -/* - 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 /* HAVE_YASSL */ -#endif /* __NETWARE__ */ - - static void report_errors(SSL* ssl) { diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index d0a0a69f70b..4971dec37fb 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -143,36 +143,6 @@ vio_set_cert_stuff(SSL_CTX *ctx, const char *cert_file, const char *key_file, } -#ifdef __NETWARE__ - -/* NetWare SSL cleanup */ -void netware_ssl_cleanup() -{ - /* free memory from SSL_library_init() */ - EVP_cleanup(); - -/* OpenSSL NetWare port specific functions */ -#ifndef HAVE_YASSL - - /* free global X509 method */ - X509_STORE_method_cleanup(); - - /* free the thread_hash error table */ - ERR_free_state_table(); -#endif -} - - -/* NetWare SSL initialization */ -static void netware_ssl_init() -{ - /* cleanup OpenSSL library */ - NXVmRegisterExitHandler(netware_ssl_cleanup, NULL); -} - -#endif /* __NETWARE__ */ - - static void check_ssl_init() { if (!ssl_algorithms_added) @@ -183,10 +153,6 @@ static void check_ssl_init() } -#ifdef __NETWARE__ - netware_ssl_init(); -#endif - if (!ssl_error_strings_loaded) { ssl_error_strings_loaded= TRUE; @@ -224,7 +190,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, *error= SSL_INITERR_MEMFAIL; DBUG_PRINT("error", ("%s", sslGetErrString(*error))); report_errors(); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } @@ -240,7 +206,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_PRINT("error", ("%s", sslGetErrString(*error))); report_errors(); SSL_CTX_free(ssl_fd->ssl_context); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } @@ -254,7 +220,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_PRINT("error", ("%s", sslGetErrString(*error))); report_errors(); SSL_CTX_free(ssl_fd->ssl_context); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } } @@ -264,7 +230,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_PRINT("error", ("vio_set_cert_stuff failed")); report_errors(); SSL_CTX_free(ssl_fd->ssl_context); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } @@ -344,6 +310,6 @@ new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd) { SSL_CTX_free(fd->ssl_context); - my_free((uchar*) fd, MYF(0)); + my_free(fd); } #endif /* HAVE_OPENSSL */ diff --git a/vio/viotest-ssl.c b/vio/viotest-ssl.c index b8abbac4ed6..5c68e861d2a 100644 --- a/vio/viotest-ssl.c +++ b/vio/viotest-ssl.c @@ -106,8 +106,8 @@ int main(int argc, char **argv) child_pid = fork(); if (child_pid==-1) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("fork"); } if (child_pid==0) @@ -116,15 +116,15 @@ int main(int argc, char **argv) char xbuf[100]; int r = vio_ssl_read(client_vio,xbuf, sizeof(xbuf)); if (r<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("client:SSL_read"); } xbuf[r] = 0; printf("client:got %s\n", xbuf); - my_free((uchar*)client_vio,MYF(0)); - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(client_vio); + my_free(ssl_acceptor); + my_free(ssl_connector); sleep(1); } else @@ -132,13 +132,13 @@ int main(int argc, char **argv) const char* s = "Huhuhuh"; int r = vio_ssl_write(server_vio,(uchar*)s, strlen(s)); if (r<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("server:SSL_write"); } - my_free((uchar*)server_vio,MYF(0)); - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(server_vio); + my_free(ssl_acceptor); + my_free(ssl_connector); sleep(1); } return 0; |