summaryrefslogtreecommitdiff
path: root/sql-common/client.c
diff options
context:
space:
mode:
authorGeorg Richter <georg@mariadb.com>2016-10-13 12:07:14 +0200
committerGeorg Richter <georg@mariadb.com>2016-10-13 12:07:14 +0200
commit351e6c8ede92ce2c22b9e7dfe07f992d09661478 (patch)
tree99f95ff39c350cc68bdc7406a26793f6e75fcf0c /sql-common/client.c
parent9a0fdab9ffab032aaf70ebf1ed255480b850a462 (diff)
downloadmariadb-git-10.2-good_bye_yassl.tar.gz
- Replaced yassl by gnutls10.2-good_bye_yassl
TLS functionality is now handled in ma_tls_vio.c - added new parameter ssl_passphrase for passphrase protected keys
Diffstat (limited to 'sql-common/client.c')
-rw-r--r--sql-common/client.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 858e9ec4b5b..cd9cd9ac09e 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1054,7 +1054,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
EXTENSION_SET_STRING_X(OPTS, X, STR, my_strdup)
-#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
+#if defined(HAVE_TLS) && !defined(EMBEDDED_LIBRARY)
#define SET_SSL_OPTION_X(OPTS, opt_var, arg, dup) \
my_free((OPTS)->opt_var); \
(OPTS)->opt_var= arg ? dup(arg, MYF(MY_WME)) : NULL;
@@ -1071,7 +1071,7 @@ static char *set_ssl_option_unpack_path(const char *arg, myf flags)
#else
#define SET_SSL_OPTION_X(OPTS, opt_var,arg, dup) do { } while(0)
#define EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, dup) do { } while(0)
-#endif /* defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) */
+#endif /* defined(HAVE_TLS) && !defined(EMBEDDED_LIBRARY) */
#define SET_SSL_OPTION(OPTS, opt_var,arg) SET_SSL_OPTION_X(OPTS, opt_var, arg, my_strdup)
#define EXTENSION_SET_SSL_STRING(OPTS, X, STR) EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, my_strdup)
@@ -1666,7 +1666,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
{
my_bool result= 0;
DBUG_ENTER("mysql_ssl_set");
-#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
+#if defined(HAVE_TLS) && !defined(EMBEDDED_LIBRARY)
result= (mysql_options(mysql, MYSQL_OPT_SSL_KEY, key) |
mysql_options(mysql, MYSQL_OPT_SSL_CERT, cert) |
mysql_options(mysql, MYSQL_OPT_SSL_CA, ca) |
@@ -1674,7 +1674,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
mysql_options(mysql, MYSQL_OPT_SSL_CIPHER, cipher) ?
1 : 0);
mysql->options.use_ssl= TRUE;
-#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
+#endif /* HAVE_TLS && !EMBEDDED_LIBRARY */
DBUG_RETURN(result);
}
@@ -1684,7 +1684,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
NB! Errors are not reported until you do mysql_real_connect.
*/
-#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
+#if defined(HAVE_TLS) && !defined(EMBEDDED_LIBRARY)
static void
mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
@@ -1702,8 +1702,10 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
my_free(mysql->options.extension->ssl_crl);
my_free(mysql->options.extension->ssl_crlpath);
}
+#if defined(HAVE_OPENSSL)
if (ssl_fd)
SSL_CTX_free(ssl_fd->ssl_context);
+#endif
my_free(mysql->connector_fd);
mysql->options.ssl_key = 0;
mysql->options.ssl_cert = 0;
@@ -2585,7 +2587,8 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
options->extension ?
options->extension->ssl_crl : NULL,
options->extension ?
- options->extension->ssl_crlpath : NULL)))
+ options->extension->ssl_crlpath : NULL,
+ 0)))
{
set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate,
ER(CR_SSL_CONNECTION_ERROR), sslGetErrString(ssl_init_error));