Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ssl version constants #5662

Merged
merged 7 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from 5 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
19 changes: 19 additions & 0 deletions src/_cffi_src/openssl/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@
static const long TLS_ST_BEFORE;
static const long TLS_ST_OK;

static const long SSL3_VERSION;
static const long TLS1_VERSION;
static const long TLS1_1_VERSION;
static const long TLS1_2_VERSION;
static const long TLS1_3_VERSION;
static const long DTLS1_VERSION;
static const long DTLS1_2_VERSION;

typedef ... SSL_METHOD;
typedef ... SSL_CTX;

Expand Down Expand Up @@ -582,6 +590,12 @@
#if CRYPTOGRAPHY_IS_LIBRESSL
static const long SSL_OP_NO_DTLSv1 = 0;
static const long SSL_OP_NO_DTLSv1_2 = 0;
/* it's not really clear why DTLS1_VERSION is defined, but it is. */
mhils marked this conversation as resolved.
Show resolved Hide resolved
/*
don't set this to 0,
SSL_CTX_set_min_proto_version(TLS1_3_VERSION) would silently allow all version
*/
static const long DTLS1_2_VERSION = -1;
mhils marked this conversation as resolved.
Show resolved Hide resolved
long (*DTLS_set_link_mtu)(SSL *, long) = NULL;
long (*DTLS_get_link_min_mtu)(SSL *) = NULL;
#endif
Expand Down Expand Up @@ -677,6 +691,11 @@

#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_111
static const long Cryptography_HAS_TLSv1_3 = 0;
/*
don't set this to 0,
SSL_CTX_set_min_proto_version(TLS1_3_VERSION) would silently allow all version
*/
mhils marked this conversation as resolved.
Show resolved Hide resolved
static const long TLS1_3_VERSION = -1;
static const long SSL_OP_NO_TLSv1_3 = 0;
static const long SSL_VERIFY_POST_HANDSHAKE = 0;
int (*SSL_CTX_set_ciphersuites)(SSL_CTX *, const char *) = NULL;
Expand Down
1 change: 1 addition & 0 deletions src/cryptography/hazmat/bindings/openssl/_conditional.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def cryptography_has_openssl_cleanup():

def cryptography_has_tlsv13():
return [
"TLS1_3_VERSION",
"SSL_OP_NO_TLSv1_3",
"SSL_VERIFY_POST_HANDSHAKE",
"SSL_CTX_set_ciphersuites",
Expand Down