Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/_cffi_src/openssl/cryptography.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
#define CRYPTOGRAPHY_IS_AWSLC 0
#endif

#if OPENSSL_VERSION_NUMBER >= 0x30200000L
#define CRYPTOGRAPHY_OPENSSL_320_OR_GREATER 1
#else
#define CRYPTOGRAPHY_OPENSSL_320_OR_GREATER 0
#endif

#if OPENSSL_VERSION_NUMBER < 0x10101050
#error "pyca/cryptography MUST be linked with Openssl 1.1.1e or later"
Expand Down
10 changes: 10 additions & 0 deletions src/_cffi_src/openssl/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
static const long Cryptography_HAS_CUSTOM_EXT;
static const long Cryptography_HAS_SRTP;
static const long Cryptography_HAS_DTLS_GET_DATA_MTU;
static const long Cryptography_HAS_SSL_GET0_GROUP_NAME;

static const long SSL_FILETYPE_PEM;
static const long SSL_FILETYPE_ASN1;
Expand Down Expand Up @@ -344,6 +345,8 @@
const char *SSL_get_version(const SSL *);
int SSL_version(const SSL *);

const char *SSL_get0_group_name(SSL *);

void SSL_set_tlsext_host_name(SSL *, char *);
void SSL_CTX_set_tlsext_servername_callback(
SSL_CTX *,
Expand Down Expand Up @@ -675,4 +678,11 @@
return SSL_SESSION_new();
}
#endif

#if CRYPTOGRAPHY_OPENSSL_320_OR_GREATER
static const long Cryptography_HAS_SSL_GET0_GROUP_NAME = 1;
#else
static const long Cryptography_HAS_SSL_GET0_GROUP_NAME = 0;
const char *(*SSL_get0_group_name)(SSL *) = NULL;
#endif
"""
7 changes: 7 additions & 0 deletions src/cryptography/hazmat/bindings/openssl/_conditional.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ def cryptography_has_get_extms_support() -> list[str]:
return ["SSL_get_extms_support"]


def cryptography_has_ssl_get0_group_name() -> list[str]:
return ["SSL_get0_group_name"]


# This is a mapping of
# {condition: function-returning-names-dependent-on-that-condition} so we can
# loop over them and delete unsupported names at runtime. It will be removed
Expand Down Expand Up @@ -197,4 +201,7 @@ def cryptography_has_get_extms_support() -> list[str]:
cryptography_has_ssl_op_ignore_unexpected_eof
),
"Cryptography_HAS_GET_EXTMS_SUPPORT": cryptography_has_get_extms_support,
"Cryptography_HAS_SSL_GET0_GROUP_NAME": (
cryptography_has_ssl_get0_group_name
),
}
Loading