mirror of
https://github.com/MariaDB/server.git
synced 2025-04-18 21:44:20 +03:00
MDEV-35838 libressl support differences in CRYPTO_set_mem_functions
Based on FreeBSD patch. The FreeBSD inclusion of check_openssl_compatibility prevented any use of the crypto callbacks and as such the later differences where ignored. The later differences in coc_malloc didn't propegate to the other callback functions of CRYPTO_set_mem_functions where a reduced argument list also applied. Looking where[2] libressl added the functions it was of the same prototype 10 years ago so omitting any version check. [1]a34cf9c2db/databases/mariadb106-server/files/patch-mysys__ssl_openssl.c
[2]5ebad8acea (diff-7f393e5489e6c5780773408f11ca27d9b3bb8f55b174631a1e9467a1dd3010b9R22)
This commit is contained in:
parent
d8c841d0d4
commit
4b0ac5a12b
@ -36,8 +36,12 @@ int check_openssl_compatibility()
|
||||
static uint testing;
|
||||
static size_t alloc_size, alloc_count;
|
||||
|
||||
static void *coc_malloc(size_t size, const char *f __attribute__((unused)),
|
||||
int l __attribute__((unused)))
|
||||
static void *coc_malloc(size_t size
|
||||
#ifndef LIBRESSL_VERSION_NUMBER
|
||||
, const char *f __attribute__((unused)),
|
||||
int l __attribute__((unused))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (unlikely(testing))
|
||||
{
|
||||
@ -47,15 +51,22 @@ static void *coc_malloc(size_t size, const char *f __attribute__((unused)),
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
static void *coc_realloc(void *addr, size_t num,
|
||||
const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused)))
|
||||
static void *coc_realloc(void *addr, size_t num
|
||||
#ifndef LIBRESSL_VERSION_NUMBER
|
||||
, const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
return realloc(addr, num);
|
||||
}
|
||||
|
||||
static void coc_free(void *addr, const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused)))
|
||||
static void coc_free(void *addr
|
||||
#ifndef LIBRESSL_VERSION_NUMBER
|
||||
, const char *file __attribute__((unused)),
|
||||
int line __attribute__((unused))
|
||||
#endif
|
||||
)
|
||||
{
|
||||
free(addr);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user