summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2021-01-16 11:41:11 -0500
committerGitHub <noreply@github.com>2021-01-16 10:41:11 -0600
commit90f09650e289022e10570702eaf007f44d1cac05 (patch)
treeec1e5047288ab01ff03a443e8f433c6f388f4fc7
parent2f26202d0e8acc24e22bede20b1456d63c3ed107 (diff)
downloadpyopenssl-git-master.tar.gz
cleanup from_buffer now that we just use cffi natively (#989)master
-rw-r--r--src/OpenSSL/SSL.py7
-rw-r--r--src/OpenSSL/_util.py3
2 files changed, 3 insertions, 7 deletions
diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py
index e5fea1e..1900b8c 100644
--- a/src/OpenSSL/SSL.py
+++ b/src/OpenSSL/SSL.py
@@ -12,7 +12,6 @@ from OpenSSL._util import (
UNSPECIFIED as _UNSPECIFIED,
exception_from_error_queue as _exception_from_error_queue,
ffi as _ffi,
- from_buffer as _from_buffer,
lib as _lib,
make_assert as _make_assert,
native as _native,
@@ -1641,7 +1640,7 @@ class Connection(object):
# Backward compatibility
buf = _text_to_bytes_and_warn("buf", buf)
- with _from_buffer(buf) as data:
+ with _ffi.from_buffer(buf) as data:
# check len(buf) instead of len(data) for testability
if len(buf) > 2147483647:
raise ValueError(
@@ -1668,7 +1667,7 @@ class Connection(object):
"""
buf = _text_to_bytes_and_warn("buf", buf)
- with _from_buffer(buf) as data:
+ with _ffi.from_buffer(buf) as data:
left_to_send = len(buf)
total_sent = 0
@@ -1798,7 +1797,7 @@ class Connection(object):
if self._into_ssl is None:
raise TypeError("Connection sock was not None")
- with _from_buffer(buf) as data:
+ with _ffi.from_buffer(buf) as data:
result = _lib.BIO_write(self._into_ssl, data, len(data))
if result <= 0:
self._handle_bio_errors(self._into_ssl, result)
diff --git a/src/OpenSSL/_util.py b/src/OpenSSL/_util.py
index d04244c..53c0b9e 100644
--- a/src/OpenSSL/_util.py
+++ b/src/OpenSSL/_util.py
@@ -153,6 +153,3 @@ def text_to_bytes_and_warn(label, obj):
)
return obj.encode("utf-8")
return obj
-
-
-from_buffer = ffi.from_buffer