Skip to content

Commit

Permalink
remove the memleak tests (#10322)
Browse files Browse the repository at this point in the history
they are fragile, haven't caught regressions, and increasingly pointless
as we oxidize.
  • Loading branch information
reaperhulk committed Feb 2, 2024
1 parent b80629c commit c0c9ec8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 443 deletions.
45 changes: 0 additions & 45 deletions src/_cffi_src/openssl/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"""

TYPES = """
static const long Cryptography_HAS_MEM_FUNCTIONS;
static const int OPENSSL_VERSION;
static const int OPENSSL_CFLAGS;
static const int OPENSSL_BUILT_ON;
Expand All @@ -26,50 +24,7 @@
void *OPENSSL_malloc(size_t);
void OPENSSL_free(void *);
/* Signature is significantly different in LibreSSL, so expose via different
symbol name */
int Cryptography_CRYPTO_set_mem_functions(
void *(*)(size_t, const char *, int),
void *(*)(void *, size_t, const char *, int),
void (*)(void *, const char *, int));
void *Cryptography_malloc_wrapper(size_t, const char *, int);
void *Cryptography_realloc_wrapper(void *, size_t, const char *, int);
void Cryptography_free_wrapper(void *, const char *, int);
"""

CUSTOMIZATIONS = """
#if CRYPTOGRAPHY_IS_LIBRESSL || CRYPTOGRAPHY_IS_BORINGSSL
static const long Cryptography_HAS_MEM_FUNCTIONS = 0;
int (*Cryptography_CRYPTO_set_mem_functions)(
void *(*)(size_t, const char *, int),
void *(*)(void *, size_t, const char *, int),
void (*)(void *, const char *, int)) = NULL;
#else
static const long Cryptography_HAS_MEM_FUNCTIONS = 1;
int Cryptography_CRYPTO_set_mem_functions(
void *(*m)(size_t, const char *, int),
void *(*r)(void *, size_t, const char *, int),
void (*f)(void *, const char *, int)
) {
return CRYPTO_set_mem_functions(m, r, f);
}
#endif
void *Cryptography_malloc_wrapper(size_t size, const char *path, int line) {
return malloc(size);
}
void *Cryptography_realloc_wrapper(void *ptr, size_t size, const char *path,
int line) {
return realloc(ptr, size);
}
void Cryptography_free_wrapper(void *ptr, const char *path, int line) {
free(ptr);
}
"""
7 changes: 0 additions & 7 deletions src/cryptography/hazmat/bindings/openssl/_conditional.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ def cryptography_has_tls_st() -> list[str]:
]


def cryptography_has_mem_functions() -> list[str]:
return [
"Cryptography_CRYPTO_set_mem_functions",
]


def cryptography_has_ed448() -> list[str]:
return [
"EVP_PKEY_ED448",
Expand Down Expand Up @@ -202,7 +196,6 @@ def cryptography_has_get_extms_support() -> list[str]:
"Cryptography_HAS_SET_CERT_CB": cryptography_has_set_cert_cb,
"Cryptography_HAS_SSL_ST": cryptography_has_ssl_st,
"Cryptography_HAS_TLS_ST": cryptography_has_tls_st,
"Cryptography_HAS_MEM_FUNCTIONS": cryptography_has_mem_functions,
"Cryptography_HAS_ED448": cryptography_has_ed448,
"Cryptography_HAS_SIGALGS": cryptography_has_ssl_sigalgs,
"Cryptography_HAS_PSK": cryptography_has_psk,
Expand Down

0 comments on commit c0c9ec8

Please sign in to comment.