Skip to content

Commit

Permalink
Bind functions for dealing with sigalgs
Browse files Browse the repository at this point in the history
Fixes pyca#7336
  • Loading branch information
Jean-Daniel committed Jun 19, 2022
1 parent d4f1082 commit b257c45
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/_cffi_src/openssl/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
static const long Cryptography_HAS_SECURE_RENEGOTIATION;
static const long Cryptography_HAS_SSL_CTX_CLEAR_OPTIONS;
static const long Cryptography_HAS_DTLS;
static const long Cryptography_HAS_SIGALGS;
static const long Cryptography_HAS_PSK;
static const long Cryptography_HAS_PSK_TLSv1_3;
static const long Cryptography_HAS_VERIFIED_CHAIN;
Expand Down Expand Up @@ -299,6 +300,8 @@
void (*)(const SSL *, const char *));
void (*SSL_CTX_get_keylog_callback(SSL_CTX *))(const SSL *, const char *);
long SSL_CTX_set1_sigalgs_list(SSL_CTX *, const char *);
/* SSL_SESSION */
void SSL_SESSION_free(SSL_SESSION *);
Expand Down Expand Up @@ -677,6 +680,13 @@
return r;
}
#if CRYPTOGRAPHY_IS_LIBRESSL
static const long Cryptography_HAS_SIGALGS = 0;
const long (*SSL_CTX_set1_sigalgs_list)(SSL_CTX *, const char *) = NULL;
#else
static const long Cryptography_HAS_SIGALGS = 1;
#endif
#if CRYPTOGRAPHY_IS_LIBRESSL || defined(OPENSSL_NO_PSK)
static const long Cryptography_HAS_PSK = 0;
int (*SSL_CTX_use_psk_identity_hint)(SSL_CTX *, const char *) = NULL;
Expand Down
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 @@ -119,6 +119,12 @@ def cryptography_has_fips() -> typing.List[str]:
]


def cryptography_has_ssl_sigalgs() -> typing.List[str]:
return [
"SSL_CTX_set1_sigalgs_list",
]


def cryptography_has_psk() -> typing.List[str]:
return [
"SSL_CTX_use_psk_identity_hint",
Expand Down Expand Up @@ -345,6 +351,7 @@ def cryptography_has_ssl_op_ignore_unexpected_eof() -> typing.List[str]:
cryptography_has_evp_pkey_get_set_tls_encodedpoint
),
"Cryptography_HAS_FIPS": cryptography_has_fips,
"Cryptography_HAS_SIGALGS": cryptography_has_ssl_sigalgs,
"Cryptography_HAS_PSK": cryptography_has_psk,
"Cryptography_HAS_PSK_TLSv1_3": cryptography_has_psk_tlsv13,
"Cryptography_HAS_CUSTOM_EXT": cryptography_has_custom_ext,
Expand Down

0 comments on commit b257c45

Please sign in to comment.