aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS.rst1
-rw-r--r--cryptography/hazmat/bindings/openssl/ssl.py6
-rw-r--r--setup.py24
3 files changed, 30 insertions, 1 deletions
diff --git a/AUTHORS.rst b/AUTHORS.rst
index e9c2f85f..c06faf1a 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -15,3 +15,4 @@ PGP key fingerprints are enclosed in parentheses.
* Konstantinos Koukopoulos <koukopoulos@gmail.com> (D6BD 52B6 8C99 A91C E2C8 934D 3300 566B 3A46 726E)
* Stephen Holsapple <sholsapp@gmail.com>
* Terry Chia <terrycwk1994@gmail.com>
+* Matthew Iversen <matt@notevencode.com> (2F04 3DCC D6E6 D5AC D262 2E0B C046 E8A8 7452 2973)
diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py
index ca3e96c8..25e49672 100644
--- a/cryptography/hazmat/bindings/openssl/ssl.py
+++ b/cryptography/hazmat/bindings/openssl/ssl.py
@@ -136,6 +136,7 @@ typedef struct {
typedef struct {
SSL3_STATE *s3;
SSL_SESSION *session;
+ int type;
...;
} SSL;
@@ -219,6 +220,9 @@ void SSL_SESSION_free(SSL_SESSION *);
const char *SSL_CIPHER_get_name(const SSL_CIPHER *);
int SSL_CIPHER_get_bits(const SSL_CIPHER *, int *);
char *SSL_CIPHER_get_version(const SSL_CIPHER *);
+
+size_t SSL_get_finished(const SSL *, void *, size_t);
+size_t SSL_get_peer_finished(const SSL *, void *, size_t);
"""
MACROS = """
@@ -298,6 +302,8 @@ void SSL_set_tlsext_host_name(SSL *, char *);
void SSL_CTX_set_tlsext_servername_callback(
SSL_CTX *,
int (*)(const SSL *, int *, void *));
+
+long SSL_session_reused(SSL *);
"""
CUSTOMIZATIONS = """
diff --git a/setup.py b/setup.py
index a2a75504..681b9031 100644
--- a/setup.py
+++ b/setup.py
@@ -11,10 +11,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
+import sys
from distutils.command.build import build
from setuptools import setup, find_packages
-
+from setuptools.command.test import test as TestCommand
base_dir = os.path.dirname(__file__)
@@ -31,6 +32,12 @@ requirements = [
SIX_DEPENDENCY
]
+test_requirements = [
+ "pytest",
+ "pretend",
+ "iso8601"
+]
+
class CFFIBuild(build):
"""
@@ -64,6 +71,19 @@ class CFFIBuild(build):
build.finalize_options(self)
+class PyTest(TestCommand):
+ def finalize_options(self):
+ TestCommand.finalize_options(self)
+ self.test_args = []
+ self.test_suite = True
+
+ def run_tests(self):
+ # Import here because in module scope the eggs are not loaded.
+ import pytest
+ errno = pytest.main(self.test_args)
+ sys.exit(errno)
+
+
with open(os.path.join(base_dir, "README.rst")) as f:
long_description = f.read()
@@ -105,11 +125,13 @@ setup(
install_requires=requirements,
setup_requires=requirements,
+ tests_require=test_requirements,
# for cffi
zip_safe=False,
ext_package="cryptography",
cmdclass={
"build": CFFIBuild,
+ "test": PyTest,
}
)