Skip to content

Commit

Permalink
Line lenght.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Daniel Dupas committed Jul 8, 2019
1 parent 4688f4f commit 23d5e24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
12 changes: 7 additions & 5 deletions src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,10 +1222,12 @@ def set_sigalgs_list(self, sigalgs_list):
if not isinstance(sigalgs_list, bytes):
raise TypeError("sigalgs_list must be a byte string.")

if _lib.Cryptography_HAS_SIGALGS:
_openssl_assert(
_lib.SSL_CTX_set1_sigalgs_list(self._context, sigalgs_list) == 1
)
if not _lib.Cryptography_HAS_SIGALGS:
return

_openssl_assert(
_lib.SSL_CTX_set1_sigalgs_list(self._context, sigalgs_list) == 1
)

def set_client_ca_list(self, certificate_authorities):
"""
Expand Down Expand Up @@ -2041,7 +2043,7 @@ def get_cipher_list(self):

def get_sigalgs(self):
"""
Retrieve the list of signature algorithms used by the Connection object.
Retrieve list of signature algorithms used by the Connection object.
Must be used after handshake only.
See :manpage:`SSL_get_sigalgs(3)`.
Expand Down
13 changes: 7 additions & 6 deletions tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ def test_set_sigalgs_list_invalid_name(self, context):

def test_set_sigalgs_list_not_supported(self):
"""
If no signature algorithms supported by the server are set, the handshake
fails with a `"no suitable signature algorithm"` reason string,
or 'no shared cipher' on older OpenSSL releases.
If no signature algorithms supported by the server are set,
the handshake fails with a `"no suitable signature algorithm"`
reason string, or 'no shared cipher' on older OpenSSL releases.
"""

def make_client(socket):
Expand All @@ -506,8 +506,8 @@ def make_client(socket):

def test_get_sigalgs(self):
"""
`Connection.get_sigalgs` returns the signature algorithms send by the client to the server.
This is supported only in TLS1_2 and later.
`Connection.get_sigalgs` returns the signature algorithms send by
the client to the server. This is supported only in TLS1_2 and later.
"""
def make_client(socket):
context = Context(TLSv1_2_METHOD)
Expand All @@ -517,7 +517,8 @@ def make_client(socket):
return c

srv, client = loopback(
server_factory=lambda s: loopback_server_factory(s, TLSv1_2_METHOD),
server_factory=lambda s: loopback_server_factory(s,
TLSv1_2_METHOD),
client_factory=make_client)

sigalgs = srv.get_sigalgs()
Expand Down

0 comments on commit 23d5e24

Please sign in to comment.