cmake-time detection for EVP_aes_128_ctr()

because old openssl versions (e.g. on labrador) don't have it
This commit is contained in:
Sergei Golubchik 2015-01-08 00:25:05 +01:00
parent faad7e0c18
commit f3da18f635
4 changed files with 8 additions and 3 deletions

View file

@ -55,6 +55,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
SET(SSL_INCLUDE_DIRS ${INC_DIRS})
SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED")
SET(HAVE_EncryptAes128Ctr OFF CACHE INTERNAL "yassl doesn't have EncryptAes128Ctr")
CHANGE_SSL_SETTINGS("bundled")
ADD_SUBDIRECTORY(extra/yassl)
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
@ -193,6 +194,10 @@ MACRO (MYSQL_CHECK_SSL)
SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
SET(SSL_INTERNAL_INCLUDE_DIRS "")
SET(SSL_DEFINES "-DHAVE_OPENSSL")
SET(CMAKE_REQUIRED_LIBRARIES ${SSL_LIBRARIES})
CHECK_SYMBOL_EXISTS(EVP_aes_128_ctr "openssl/evp.h"
HAVE_EncryptAes128Ctr)
ELSE()
IF(WITH_SSL STREQUAL "system")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")

View file

@ -589,6 +589,7 @@
#cmakedefine HAVE_CHARSET_utf32 1
#cmakedefine HAVE_UCA_COLLATIONS 1
#cmakedefine HAVE_COMPRESS 1
#cmakedefine HAVE_EncryptAes128Ctr 1
/*

View file

@ -7,8 +7,6 @@
#if !defined(HAVE_YASSL) && defined(HAVE_OPENSSL)
#define HAVE_EncryptAes128Ctr
C_MODE_START
Crypt_result my_aes_encrypt_ctr(const uchar* source, uint32 source_length,
uchar* dest, uint32* dest_length,

View file

@ -11,7 +11,6 @@
#include "mysql.h"
#include <openssl/evp.h>
#include <openssl/aes.h>
#include <openssl/rand.h>
static const int CRYPT_ENCRYPT = 1;
static const int CRYPT_DECRYPT = 0;
@ -350,6 +349,8 @@ C_MODE_END
#else /* OpenSSL */
#include <openssl/rand.h>
C_MODE_START
Crypt_result my_random_bytes(uchar* buf, int num)