Skip to content

Commit

Permalink
Fix broken build with Windows OpenSSL.
Browse files Browse the repository at this point in the history
  • Loading branch information
vaintroub committed Sep 8, 2018
1 parent b948553 commit 17d0e53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions libmariadb/secure/openssl.c
Expand Up @@ -443,7 +443,7 @@ int ma_tls_get_password(char *buf, int size,
memset(buf, 0, size);
if (userdata)
strncpy(buf, (char *)userdata, size);
return strlen(buf);
return (int)strlen(buf);
}


Expand Down Expand Up @@ -623,7 +623,7 @@ my_bool ma_tls_connect(MARIADB_TLS *ctls)
SSL_set_bio(ssl, bio, bio);
BIO_set_fd(bio, mysql_get_socket(mysql), BIO_NOCLOSE);
#else
SSL_set_fd(ssl, mysql_get_socket(mysql));
SSL_set_fd(ssl, (int)mysql_get_socket(mysql));
#endif

while (try_connect && (rc= SSL_connect(ssl)) == -1)
Expand Down Expand Up @@ -700,7 +700,7 @@ ssize_t ma_tls_read_async(MARIADB_PVIO *pvio,

for (;;)
{
res= SSL_read((SSL *)ctls->ssl, (void *)buffer, length);
res= SSL_read((SSL *)ctls->ssl, (void *)buffer, (int)length);
if (ma_tls_async_check_result(res, b, (SSL *)ctls->ssl))
return res;
}
Expand All @@ -716,7 +716,7 @@ ssize_t ma_tls_write_async(MARIADB_PVIO *pvio,

for (;;)
{
res= SSL_write((SSL *)ctls->ssl, (void *)buffer, length);
res= SSL_write((SSL *)ctls->ssl, (void *)buffer, (int)length);
if (ma_tls_async_check_result(res, b, (SSL *)ctls->ssl))
return res;
}
Expand All @@ -725,7 +725,7 @@ ssize_t ma_tls_write_async(MARIADB_PVIO *pvio,

ssize_t ma_tls_read(MARIADB_TLS *ctls, const uchar* buffer, size_t length)
{
ssize_t rc;
int rc;
MARIADB_PVIO *pvio= ctls->pvio;

while ((rc= SSL_read((SSL *)ctls->ssl, (void *)buffer, (int)length)) < 0)
Expand All @@ -741,7 +741,7 @@ ssize_t ma_tls_read(MARIADB_TLS *ctls, const uchar* buffer, size_t length)

ssize_t ma_tls_write(MARIADB_TLS *ctls, const uchar* buffer, size_t length)
{
ssize_t rc;
int rc;
MARIADB_PVIO *pvio= ctls->pvio;

while ((rc= SSL_write((SSL *)ctls->ssl, (void *)buffer, (int)length)) <= 0)
Expand Down
2 changes: 1 addition & 1 deletion plugins/auth/CMakeLists.txt
Expand Up @@ -39,7 +39,7 @@ IF(GSSAPI_SOURCES)
ENDIF()

IF(${WITH_SSL} STREQUAL "OPENSSL" OR ${WITH_SSL} STREQUAL "SCHANNEL")
IF(WIN32)
IF(WITH_SSL STREQUAL "SCHANNEL")
SET(SHA256_LIBS crypt32)
ELSE()
SET(SHA256_LIBS ${SSL_LIBRARIES})
Expand Down

0 comments on commit 17d0e53

Please sign in to comment.