summaryrefslogtreecommitdiff
path: root/include/my_crypt.h
diff options
context:
space:
mode:
authorGeorg Richter <georg@mariadb.com>2017-03-08 17:39:47 +0100
committerSergei Golubchik <serg@mariadb.org>2017-05-09 18:53:10 +0200
commitf8866f8f665ac26beb31842fef48ecee5feb346e (patch)
tree6e6cfdf273a416f8c5190d21cc18d9ee445c7ef2 /include/my_crypt.h
parenteb2b7ff6230286cc3e1d73410cdedda12cee3747 (diff)
downloadmariadb-git-f8866f8f665ac26beb31842fef48ecee5feb346e.tar.gz
MDEV-10332 support for OpenSSL 1.1 and LibreSSL
Initial support tested against OpenSSL 1.0.1, 1.0.2, 1.1.0, Yassl and LibreSSL not working on Windows with native SChannel support, due to wrong cipher mapping: Latter one requires push of CONC-241 fixes. Please note that OpenSSL 0.9.8 and OpenSSL 1.1.0 will not work: Even if the build succeeds, test cases will fail with various errors, especially when using different tls libraries or versions for client and server.
Diffstat (limited to 'include/my_crypt.h')
-rw-r--r--include/my_crypt.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/my_crypt.h b/include/my_crypt.h
index 719e349bfb9..e7dd9d80100 100644
--- a/include/my_crypt.h
+++ b/include/my_crypt.h
@@ -21,4 +21,19 @@
#include <my_config.h> /* HAVE_EncryptAes128{Ctr,Gcm} */
#include <mysql/service_my_crypt.h>
+/* OpenSSL version specific definitions */
+#if !defined(HAVE_YASSL) && defined(OPENSSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+#define ERR_remove_state(X)
+#else
+#define EVP_CIPHER_CTX_reset(X) EVP_CIPHER_CTX_cleanup(X)
+#define RAND_OpenSSL() RAND_SSLeay();
+#if defined(HAVE_ERR_remove_thread_state)
+#define ERR_remove_state(X) ERR_remove_thread_state(NULL)
+#endif
+#endif
+#elif defined(HAVE_YASSL)
+#define EVP_CIPHER_CTX_reset(X) EVP_CIPHER_CTX_cleanup(X)
+#endif /* !defined(HAVE_YASSL) */
+
#endif /* MY_CRYPT_INCLUDED */