summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tonu@volk.internalnet>2001-11-01 16:59:00 +0200
committerunknown <tonu@volk.internalnet>2001-11-01 16:59:00 +0200
commit28340acf023071c6a62655342faf0b4dca041039 (patch)
treee17781a64cf7808e143fef1d2976fb159c558843
parentd9dcb15b25a854c3bc78912f2184c999595aa86a (diff)
downloadmariadb-git-28340acf023071c6a62655342faf0b4dca041039.tar.gz
SSL fixes.
client/mysql.cc: Some memory was unfreed :( include/sslopt-case.h: Oh no, this typo made capath functionality unusable vio/viossl.c: Want to debug timeout issues.
-rw-r--r--client/mysql.cc7
-rw-r--r--include/sslopt-case.h3
-rw-r--r--vio/viossl.c4
3 files changed, 10 insertions, 4 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 21a3b422b25..653f6bc9f44 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -379,6 +379,13 @@ int main(int argc,char *argv[])
sig_handler mysql_end(int sig)
{
mysql_close(&mysql);
+#ifdef HAVE_OPENSSL
+ my_free(opt_ssl_key,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(opt_ssl_cert,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(opt_ssl_ca,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(opt_ssl_capath,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(opt_ssl_cipher,MYF(MY_ALLOW_ZERO_PTR));
+#endif
#ifdef HAVE_READLINE
if (!status.batch && !quick && !opt_html && !opt_xml)
{
diff --git a/include/sslopt-case.h b/include/sslopt-case.h
index b5720286778..b801e5e73c7 100644
--- a/include/sslopt-case.h
+++ b/include/sslopt-case.h
@@ -37,12 +37,11 @@
case OPT_SSL_CAPATH:
opt_use_ssl = 1; /* true */
my_free(opt_ssl_ca, MYF(MY_ALLOW_ZERO_PTR));
- opt_ssl_ca = my_strdup(optarg, MYF(0));
+ opt_ssl_capath = my_strdup(optarg, MYF(0));
break;
case OPT_SSL_CIPHER:
opt_use_ssl = 1; /* true */
my_free(opt_ssl_cipher, MYF(MY_ALLOW_ZERO_PTR));
opt_ssl_cipher = my_strdup(optarg, MYF(0));
break;
-
#endif
diff --git a/vio/viossl.c b/vio/viossl.c
index 19fd6e0f0ab..c87836e56b6 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -292,7 +292,7 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout)
report_errors();
DBUG_VOID_RETURN;
}
- DBUG_PRINT("info", ("ssl_=%p",vio->ssl_));
+ DBUG_PRINT("info", ("ssl_=%p timeout=%ld",vio->ssl_, timeout));
SSL_clear(vio->ssl_);
vio_blocking(vio, FALSE);
SSL_SESSION_set_timeout(SSL_get_session(vio->ssl_), timeout);
@@ -348,7 +348,7 @@ void sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* vio, long timeout)
report_errors();
DBUG_VOID_RETURN;
}
- DBUG_PRINT("info",("ssl_=%p",vio->ssl_));
+ DBUG_PRINT("info", ("ssl_=%p timeout=%ld",vio->ssl_, timeout));
SSL_clear(vio->ssl_);
vio_blocking(vio, FALSE);
SSL_SESSION_set_timeout(SSL_get_session(vio->ssl_), timeout);