summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-05-10 01:28:01 +0200
committerSergei Golubchik <serg@mariadb.org>2017-05-10 01:33:03 +0200
commit2980b0c348b1964b6efcadeba1082e02c2f5b45b (patch)
tree86bba263640c3f20399c09a0538c8a22dd3c0a03
parentbde397b3eb05bb7628eb4bf5f515f8163269706e (diff)
downloadmariadb-git-2980b0c348b1964b6efcadeba1082e02c2f5b45b.tar.gz
fix crashes with openssl fips builds
Apparently openssl ignores CRYPTO_set_mem_functions() in fips mode, so we cannot detect structure sizes. Don't freak out when no mallocs were detected.
-rw-r--r--mysys_ssl/openssl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mysys_ssl/openssl.c b/mysys_ssl/openssl.c
index a3f1ca29ec1..2587c5ece1d 100644
--- a/mysys_ssl/openssl.c
+++ b/mysys_ssl/openssl.c
@@ -56,13 +56,13 @@ int check_openssl_compatibility()
allocated_size= allocated_count= 0;
evp_ctx= EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_free(evp_ctx);
- if (allocated_count != 1 || allocated_size > EVP_CIPHER_CTX_SIZE)
+ if (allocated_count > 1 || allocated_size > EVP_CIPHER_CTX_SIZE)
return 1;
allocated_size= allocated_count= 0;
md5_ctx= EVP_MD_CTX_create();
EVP_MD_CTX_destroy(md5_ctx);
- if (allocated_count != 1 || allocated_size > EVP_MD_CTX_SIZE)
+ if (allocated_count > 1 || allocated_size > EVP_MD_CTX_SIZE)
return 1;
CRYPTO_set_mem_functions(CRYPTO_malloc, CRYPTO_realloc, CRYPTO_free);