Skip to content

Commit

Permalink
make it black
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Jul 28, 2020
1 parent f54e6dc commit 5c22e93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,19 +1358,16 @@ def set_keylog_callback(self, callback):
debugging output.
:return: None
"""

@wraps(callback)
def wrapper(ssl, line):
line = _ffi.string(line)
callback(Connection._reverse_mapping[ssl], line)

self._keylog_callback = _ffi.callback(
"void (*)(const SSL *, const char *)",
wrapper
)
_lib.SSL_CTX_set_keylog_callback(
self._context,
self._keylog_callback
"void (*)(const SSL *, const char *)", wrapper
)
_lib.SSL_CTX_set_keylog_callback(self._context, self._keylog_callback)

def get_app_data(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ def info(conn, where, ret):

@pytest.mark.skipif(
not getattr(_lib, "Cryptography_HAS_KEYLOG", None),
reason="SSL_CTX_set_keylog_callback unavailable"
reason="SSL_CTX_set_keylog_callback unavailable",
)
def test_set_keylog_callback(self):
"""
Expand Down

0 comments on commit 5c22e93

Please sign in to comment.