internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pyca/cryptography

Issue:
Replace sk_DIST_POINT_pop_free with CRL_DIST_POINTS_free
https://github.com/pyca/cryptography/blob/master/src/cryptography/hazmat/backends/openssl/decode_asn1.py#L500-L505

This would be a nice cleanup. 


Discussion:

Resolving patch:
diff --git a/src/_cffi_src/openssl/x509v3.py b/src/_cffi_src/openssl/x509v3.py
--- a/src/_cffi_src/openssl/x509v3.py
+++ b/src/_cffi_src/openssl/x509v3.py
@@ -248,6 +248,7 @@
 int sk_DIST_POINT_push(Cryptography_STACK_OF_DIST_POINT *, DIST_POINT *);
 void sk_DIST_POINT_pop_free(Cryptography_STACK_OF_DIST_POINT *,
                             sk_DIST_POINT_freefunc);
+void CRL_DIST_POINTS_free(Cryptography_STACK_OF_DIST_POINT *);
 
 void sk_POLICYINFO_free(Cryptography_STACK_OF_POLICYINFO *);
 int sk_POLICYINFO_num(Cryptography_STACK_OF_POLICYINFO *);
diff --git a/src/cryptography/hazmat/backends/openssl/decode_asn1.py b/src/cryptography/hazmat/backends/openssl/decode_asn1.py
--- a/src/cryptography/hazmat/backends/openssl/decode_asn1.py
+++ b/src/cryptography/hazmat/backends/openssl/decode_asn1.py
@@ -496,13 +496,7 @@ def _decode_extended_key_usage(backend, sk):
 
 def _decode_crl_distribution_points(backend, cdps):
     cdps = backend._ffi.cast("Cryptography_STACK_OF_DIST_POINT *", cdps)
-
-    dp_freefunc = backend._ffi.addressof(
-        backend._lib._original_lib, "DIST_POINT_free"
-    )
-    cdps = backend._ffi.gc(
-        cdps, lambda c: backend._lib.sk_DIST_POINT_pop_free(c, dp_freefunc)
-    )
+    cdps = backend._ffi.gc(cdps, backend._lib.CRL_DIST_POINTS_free)
 
     num = backend._lib.sk_DIST_POINT_num(cdps)
     dist_points = []


Test patch:
Repository: pyca/cryptography

Issue:
Remove `return True` in OpenSSL ecdsa verify implementation
https://github.com/pyca/cryptography/blob/master/src/cryptography/hazmat/backends/openssl/ec.py#L89

This isn't part of our documented API


Discussion:

Resolving patch:
diff --git a/src/cryptography/hazmat/backends/openssl/ec.py b/src/cryptography/hazmat/backends/openssl/ec.py
--- a/src/cryptography/hazmat/backends/openssl/ec.py
+++ b/src/cryptography/hazmat/backends/openssl/ec.py
@@ -86,7 +86,6 @@ def _ecdsa_sig_verify(backend, public_key, signature, data):
     if res != 1:
         backend._consume_errors()
         raise InvalidSignature
-    return True
 
 
 @utils.register_interface(AsymmetricSignatureContext)
@@ -118,7 +117,7 @@ def update(self, data):
 
     def verify(self):
         digest = self._digest.finalize()
-        return _ecdsa_sig_verify(
+        _ecdsa_sig_verify(
             self._backend, self._public_key, self._signature, digest
         )
 
@@ -283,4 +282,4 @@ def verify(self, signature, data, signature_algorithm):
         data, algorithm = _calculate_digest_and_algorithm(
             self._backend, data, signature_algorithm._algorithm
         )
-        return _ecdsa_sig_verify(self._backend, self, signature, data)
+        _ecdsa_sig_verify(self._backend, self, signature, data)


Test patch:
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py
--- a/tests/hazmat/primitives/test_ec.py
+++ b/tests/hazmat/primitives/test_ec.py
@@ -508,7 +508,7 @@ def test_signatures(self, backend, vector):
             ec.ECDSA(hash_type())
         )
         verifier.update(vector['message'])
-        assert verifier.verify()
+        verifier.verify()
 
     @pytest.mark.parametrize(
         "vector",
Repository: pyca/cryptography

Issue:
Deprecate Whirlpool and RIPEMD



Discussion:

Resolving patch:
diff --git a/src/cryptography/hazmat/primitives/hashes.py b/src/cryptography/hazmat/primitives/hashes.py
--- a/src/cryptography/hazmat/primitives/hashes.py
+++ b/src/cryptography/hazmat/primitives/hashes.py
@@ -149,6 +149,14 @@ class RIPEMD160(object):
     block_size = 64
 
 
+RIPEMD160 = utils.deprecated(
+    RIPEMD160,
+    __name__,
+    "The RIPEMD160 hash was deprecated in version 1.9.",
+    utils.DeprecatedIn19
+)
+
+
 @utils.register_interface(HashAlgorithm)
 class Whirlpool(object):
     name = "whirlpool"
@@ -156,6 +164,14 @@ class Whirlpool(object):
     block_size = 64
 
 
+Whirlpool = utils.deprecated(
+    Whirlpool,
+    __name__,
+    "The Whirlpool hash was deprecated in version 1.9.",
+    utils.DeprecatedIn19
+)
+
+
 @utils.register_interface(HashAlgorithm)
 class MD5(object):
     name = "md5"


Test patch:
Repository: pyca/cryptography

Issue:
Support for globally suppressing library linking flags on non-Windows platforms
In our tooling, we use a custom library name (`ssl-static` and `crypto-static`) to differentiate static builds of OpenSSL and simplify linking with other libraries. We'd like the ability to suppress the `-lssl -lcrypto` globally (not just on macOS) so that we can use `LDFLAGS` et al when building through `requirements.txt` file. Here's a [patch](https://gist.github.com/maxbelanger/cc7762a70c8a6bf73beb9b065a3e6a12) demonstrating what we currently do (not a PR as I suspect this isn't correct beyond our use). What would be the best way to achieve this? 


Discussion:
@reaperhulk do you have an opinion here? 
I talked a bit with @irinarenteria about this a few weeks ago. I believe she's planning to send a PR with a more generic set of env vars. I'm fine with it becoming more generic.

Resolving patch:
diff --git a/src/_cffi_src/build_openssl.py b/src/_cffi_src/build_openssl.py
--- a/src/_cffi_src/build_openssl.py
+++ b/src/_cffi_src/build_openssl.py
@@ -13,27 +13,22 @@
 
 
 def _get_openssl_libraries(platform):
+    if os.environ.get("CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS", None):
+        return []
     # OpenSSL goes by a different library name on different operating systems.
-    if platform == "darwin":
-        return _osx_libraries(
-            os.environ.get("CRYPTOGRAPHY_OSX_NO_LINK_FLAGS")
-        )
-    elif platform == "win32":
-        windows_link_openssl110 = os.environ.get(
-            "CRYPTOGRAPHY_WINDOWS_LINK_OPENSSL110", None
+    if platform == "win32" and compiler_type() == "msvc":
+        windows_link_legacy_openssl = os.environ.get(
+            "CRYPTOGRAPHY_WINDOWS_LINK_LEGACY_OPENSSL", None
         )
-        if compiler_type() == "msvc":
-            if windows_link_openssl110 is not None:
-                # Link against the 1.1.0 names
-                libs = ["libssl", "libcrypto"]
-            else:
-                # Link against the 1.0.2 and lower names
-                libs = ["libeay32", "ssleay32"]
+        if windows_link_legacy_openssl is None:
+            # Link against the 1.1.0 names
+            libs = ["libssl", "libcrypto"]
         else:
-            # Support mingw, which behaves unix-like and prefixes "lib"
-            libs = ["ssl", "crypto"]
+            # Link against the 1.0.2 and lower names
+            libs = ["libeay32", "ssleay32"]
         return libs + ["advapi32", "crypt32", "gdi32", "user32", "ws2_32"]
     else:
+        # darwin, linux, mingw all use this path
         # In some circumstances, the order in which these libs are
         # specified on the linker command-line is significant;
         # libssl must come before libcrypto
@@ -41,14 +36,6 @@ def _get_openssl_libraries(platform):
         return ["ssl", "crypto"]
 
 
-def _osx_libraries(build_static):
-    # For building statically we don't want to pass the -lssl or -lcrypto flags
-    if build_static == "1":
-        return []
-    else:
-        return ["ssl", "crypto"]
-
-
 ffi = build_ffi_for_binding(
     module_name="_openssl",
     module_prefix="_cffi_src.openssl.",


Test patch:
Repository: pyca/cryptography

Issue:
Upload docs artifact in new jenkins



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -315,7 +315,7 @@ def run_tests(self):
             "doc8",
             "pyenchant",
             "readme_renderer >= 16.0",
-            "sphinx",
+            "sphinx != 1.6.1",
             "sphinx_rtd_theme",
             "sphinxcontrib-spelling",
         ],
diff --git a/src/_cffi_src/openssl/asn1.py b/src/_cffi_src/openssl/asn1.py
--- a/src/_cffi_src/openssl/asn1.py
+++ b/src/_cffi_src/openssl/asn1.py
@@ -77,8 +77,6 @@
 /*  ASN1 TIME */
 ASN1_TIME *ASN1_TIME_new(void);
 void ASN1_TIME_free(ASN1_TIME *);
-ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *,
-                                                   ASN1_GENERALIZEDTIME **);
 ASN1_TIME *ASN1_TIME_set(ASN1_TIME *, time_t);
 
 /*  ASN1 UTCTIME */
@@ -112,6 +110,10 @@
 long ASN1_ENUMERATED_get(ASN1_ENUMERATED *);
 int i2a_ASN1_INTEGER(BIO *, ASN1_INTEGER *);
 
+/* This became const ASN1_TIME in 1.1.0f */
+ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *,
+                                                   ASN1_GENERALIZEDTIME **);
+
 ASN1_UTF8STRING *ASN1_UTF8STRING_new(void);
 void ASN1_UTF8STRING_free(ASN1_UTF8STRING *);
 


Test patch:
Repository: pyca/cryptography

Issue:
Update release automation for new wheel builder
Once #3636 is merged we need to update the release automation to trigger the new wheel builder and download the artifacts.


Discussion:

Resolving patch:
diff --git a/release.py b/release.py
--- a/release.py
+++ b/release.py
@@ -17,7 +17,10 @@
 import requests
 
 
-JENKINS_URL = "https://jenkins.cryptography.io/job/cryptography-wheel-builder"
+JENKINS_URL = (
+    "https://ci.cryptography.io/job/cryptography-support-jobs/"
+    "job/wheel-builder"
+)
 
 
 def run(*args, **kwargs):
@@ -128,14 +131,11 @@ def release(version):
     )
     response.raise_for_status()
 
-    username = getpass.getpass("Input the GitHub/Jenkins username: ")
     token = getpass.getpass("Input the Jenkins token: ")
-    response = session.post(
+    response = session.get(
         "{0}/build".format(JENKINS_URL),
-        auth=requests.auth.HTTPBasicAuth(
-            username, token
-        ),
         params={
+            "token": token,
             "cause": "Building wheels for {0}".format(version)
         }
     )


Test patch:
Repository: pyca/cryptography

Issue:
DHParametersWithSerialization, DHPublicKeyWithSerialization
For RSAPublicKey, DSAPublicKey, and EllipticCurvePublicKey we decided that there was no scenario under which they could not be serializable. The same is true for these two classes, so we should go ahead and merge the interfaces and then make the WithSerialization versions aliases (this is the approach we took for the other 3 to maintain backwards compatibility)
DHParametersWithSerialization, DHPublicKeyWithSerialization
For RSAPublicKey, DSAPublicKey, and EllipticCurvePublicKey we decided that there was no scenario under which they could not be serializable. The same is true for these two classes, so we should go ahead and merge the interfaces and then make the WithSerialization versions aliases (this is the approach we took for the other 3 to maintain backwards compatibility)


Discussion:

Resolving patch:
diff --git a/src/cryptography/hazmat/primitives/asymmetric/dh.py b/src/cryptography/hazmat/primitives/asymmetric/dh.py
--- a/src/cryptography/hazmat/primitives/asymmetric/dh.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/dh.py
@@ -129,9 +129,6 @@ def parameter_bytes(self, encoding, format):
         Returns the parameters serialized as bytes.
         """
 
-
-@six.add_metaclass(abc.ABCMeta)
-class DHParametersWithSerialization(DHParameters):
     @abc.abstractmethod
     def parameter_numbers(self):
         """
@@ -139,6 +136,9 @@ def parameter_numbers(self):
         """
 
 
+DHParametersWithSerialization = DHParameters
+
+
 @six.add_metaclass(abc.ABCMeta)
 class DHPrivateKey(object):
     @abc.abstractproperty
@@ -196,9 +196,6 @@ def parameters(self):
         The DHParameters object associated with this public key.
         """
 
-
-@six.add_metaclass(abc.ABCMeta)
-class DHPublicKeyWithSerialization(DHPublicKey):
     @abc.abstractmethod
     def public_numbers(self):
         """
@@ -210,3 +207,6 @@ def public_bytes(self, encoding, format):
         """
         Returns the key serialized as bytes.
         """
+
+
+DHPublicKeyWithSerialization = DHPublicKey


Test patch:
Repository: pyca/cryptography

Issue:
wishlist: DTLS 1.2 methods
Please consider adding the ``DTLSv1_2_*method`` symbols to the openssl bindings (``DTLSv1_*method`` are present at least in the latest release, but the newer ``DTLS_*method`` and the ``DTLSv1_2_*method`` are missing). It seems to me that adding those is sufficient to utilize DTLS 1.2 in the Python OpenSSL bindings.

DTLS version 1.2 is mandated for the transport layer security suite of the CoAP protocol that is increasingly being rolled out in IoT devices.


Discussion:
@chrysn we're happy to merge a PR for this, but we're unlikely to get to it on our own. Cheers.

Resolving patch:
diff --git a/src/_cffi_src/openssl/ssl.py b/src/_cffi_src/openssl/ssl.py
--- a/src/_cffi_src/openssl/ssl.py
+++ b/src/_cffi_src/openssl/ssl.py
@@ -26,6 +26,7 @@
 static const long Cryptography_HAS_SSL_CTX_SET_CLIENT_CERT_ENGINE;
 static const long Cryptography_HAS_SSL_CTX_CLEAR_OPTIONS;
 static const long Cryptography_HAS_DTLS;
+static const long Cryptography_HAS_GENERIC_DTLS_METHOD;
 
 /* Internally invented symbol to tell us if SNI is supported */
 static const long Cryptography_HAS_TLSEXT_HOSTNAME;
@@ -331,6 +332,11 @@
 const SSL_METHOD *DTLSv1_server_method(void);
 const SSL_METHOD *DTLSv1_client_method(void);
 
+/* Added in 1.0.2 */
+const SSL_METHOD *DTLS_method(void);
+const SSL_METHOD *DTLS_server_method(void);
+const SSL_METHOD *DTLS_client_method(void);
+
 const SSL_METHOD *SSLv23_method(void);
 const SSL_METHOD *SSLv23_server_method(void);
 const SSL_METHOD *SSLv23_client_method(void);
@@ -590,6 +596,15 @@
 static const long TLS_ST_OK = 0;
 #endif
 
+#if defined(OPENSSL_NO_DTLS) || CRYPTOGRAPHY_OPENSSL_LESS_THAN_102
+static const long Cryptography_HAS_GENERIC_DTLS_METHOD = 0;
+const SSL_METHOD *(*DTLS_method)(void) = NULL;
+const SSL_METHOD *(*DTLS_server_method)(void) = NULL;
+const SSL_METHOD *(*DTLS_client_method)(void) = NULL;
+#else
+static const long Cryptography_HAS_GENERIC_DTLS_METHOD = 1;
+#endif
+
 #ifndef OPENSSL_NO_DTLS
 static const long Cryptography_HAS_DTLS = 1;
 /* Wrap DTLSv1_get_timeout to avoid cffi to handle a 'struct timeval'. */
diff --git a/src/cryptography/hazmat/bindings/openssl/_conditional.py b/src/cryptography/hazmat/bindings/openssl/_conditional.py
--- a/src/cryptography/hazmat/bindings/openssl/_conditional.py
+++ b/src/cryptography/hazmat/bindings/openssl/_conditional.py
@@ -150,6 +150,11 @@
         "Cryptography_DTLSv1_get_timeout",
         "DTLSv1_handle_timeout",
     ],
+    "Cryptography_HAS_GENERIC_DTLS_METHOD": [
+        "DTLS_method",
+        "DTLS_server_method",
+        "DTLS_client_method",
+    ],
     "Cryptography_HAS_EVP_PKEY_DHX": [
         "EVP_PKEY_DHX",
         "Cryptography_d2i_DHxparams_bio",


Test patch:
Repository: pyca/cryptography

Issue:
release infrastrucutre doesn't handle "out of order" releases
Specifically if we issue an `0.X` release, then an `0.X+1` release, and then we go to do an `0.X.1` release, the wheel automation won't work, since it builds a wheel for the latest release.



Discussion:
We have thus far never done a release in this form. To fix this the only real thing we need to do is parametrize the wheel builder to take the version we want it to download from pypi though.

Resolving patch:
diff --git a/release.py b/release.py
--- a/release.py
+++ b/release.py
@@ -126,6 +126,7 @@ def release(version):
         "{0}/build".format(JENKINS_URL),
         params={
             "token": token,
+            "BUILD_VERSION": version,
             "cause": "Building wheels for {0}".format(version)
         }
     )


Test patch:
Repository: pyca/cryptography

Issue:
Add the ANY extended key usage OID to the ExtendedKeyUsageOID class
`2.5.29.37.0`


Discussion:

Resolving patch:
diff --git a/src/cryptography/x509/oid.py b/src/cryptography/x509/oid.py
--- a/src/cryptography/x509/oid.py
+++ b/src/cryptography/x509/oid.py
@@ -171,6 +171,7 @@ class ExtendedKeyUsageOID(object):
     EMAIL_PROTECTION = ObjectIdentifier("1.3.6.1.5.5.7.3.4")
     TIME_STAMPING = ObjectIdentifier("1.3.6.1.5.5.7.3.8")
     OCSP_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.9")
+    ANY_EXTENDED_KEY_USAGE = ObjectIdentifier("2.5.29.37.0")
 
 
 class AuthorityInformationAccessOID(object):


Test patch:
Repository: pyca/cryptography

Issue:
Signer/Verifier deprecation warning has wrong stacklevel
Seeing this with Cryptography 2.0:

```
.../python3.5/site-packages/cryptography/hazmat/backends/openssl/rsa.py:477: DeprecationWarning: signer and verifier have been deprecated. Please use sign and verify instead.
  _warn_sign_verify_deprecated()
.../python3.5/site-packages/cryptography/hazmat/backends/openssl/rsa.py:382: DeprecationWarning: signer and verifier have been deprecated. Please use sign and verify instead.
  _warn_sign_verify_deprecated()
```

I see a few open issues related to deprecations (e.g. #3794), but I'm not sure if any of them cover this particular message.


Discussion:
These are intentional, cryptography is emitting them! Though it looks like we got the `stacklevel` argument wrong. Whatever package is using cryptography should port itself to use the `sign` and `verify` methods.

I'm going to retitle this bug to be about updating the `stacklevel` we use.
Ah, I thought Cryptography was using some deprecated methods within itself (which, on reflection, would be weird). I'll check downstream (I'm guessing Paramiko?) and open issues on the appropriate project if necessary.
@nchammas https://github.com/paramiko/paramiko/pull/979
Hopefully fixing `stacklevel` will make this more obvious for folks.

Resolving patch:
diff --git a/src/cryptography/hazmat/backends/openssl/utils.py b/src/cryptography/hazmat/backends/openssl/utils.py
--- a/src/cryptography/hazmat/backends/openssl/utils.py
+++ b/src/cryptography/hazmat/backends/openssl/utils.py
@@ -41,5 +41,5 @@ def _warn_sign_verify_deprecated():
         "signer and verifier have been deprecated. Please use sign "
         "and verify instead.",
         utils.PersistentlyDeprecated,
-        stacklevel=2
+        stacklevel=3
     )


Test patch:
Repository: pyca/cryptography

Issue:
Release Automation
twine no longer shows upload progress in our release automation (are we capturing all stdout from `run()` calls?). It'd be nice to get that output back + possibly add some `print()` to see what steps we're at.


Discussion:

Resolving patch:
diff --git a/release.py b/release.py
--- a/release.py
+++ b/release.py
@@ -25,13 +25,8 @@
 
 
 def run(*args, **kwargs):
-    kwargs.setdefault("stderr", subprocess.STDOUT)
-    try:
-        subprocess.check_output(list(args), **kwargs)
-    except subprocess.CalledProcessError as e:
-        # Reraise this with a different type so that str(e) is something with
-        # stdout in it.
-        raise Exception(e.cmd, e.returncode, e.output)
+    print("[running] {0}".format(list(args)))
+    subprocess.check_call(list(args), **kwargs)
 
 
 def wait_for_build_completed(session):


Test patch:
Repository: pyca/cryptography

Issue:
Remove docutils.conf - enable smart quotes for builders
Blocked on:

- [x] https://github.com/sphinx-doc/sphinx/pull/4110
  - [x] Sphinx release
- [x] https://github.com/sphinx-contrib/spelling/pull/2
  - [x] sphinxcontrib-spelling release


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -288,9 +288,9 @@ def run_tests(self):
             "doc8",
             "pyenchant >= 1.6.11",
             "readme_renderer >= 16.0",
-            "sphinx",
+            "sphinx >= 1.6.5",
             "sphinx_rtd_theme",
-            "sphinxcontrib-spelling",
+            "sphinxcontrib-spelling >= 4.0.1",
         ],
         "pep8test": [
             "flake8",


Test patch:
Repository: pyca/cryptography

Issue:
Stop using ERR_error_string with a static buffer
This is thread unsafe and bad and stuff:

* https://github.com/pyca/cryptography/blob/master/src/cryptography/hazmat/bindings/openssl/binding.py#L58-L60
* https://github.com/pyca/cryptography/blob/master/tests/hazmat/backends/test_openssl.py#L128-L129


Discussion:

Resolving patch:
diff --git a/src/_cffi_src/openssl/err.py b/src/_cffi_src/openssl/err.py
--- a/src/_cffi_src/openssl/err.py
+++ b/src/_cffi_src/openssl/err.py
@@ -231,7 +231,6 @@
 """
 
 FUNCTIONS = """
-char *ERR_error_string(unsigned long, char *);
 void ERR_error_string_n(unsigned long, char *, size_t);
 const char *ERR_lib_error_string(unsigned long);
 const char *ERR_func_error_string(unsigned long);
diff --git a/src/cryptography/hazmat/bindings/openssl/binding.py b/src/cryptography/hazmat/bindings/openssl/binding.py
--- a/src/cryptography/hazmat/bindings/openssl/binding.py
+++ b/src/cryptography/hazmat/bindings/openssl/binding.py
@@ -55,9 +55,10 @@ def _openssl_assert(lib, ok):
         errors = _consume_errors(lib)
         errors_with_text = []
         for err in errors:
-            err_text_reason = ffi.string(
-                lib.ERR_error_string(err.code, ffi.NULL)
-            )
+            buf = ffi.new("char[]", 256)
+            lib.ERR_error_string_n(err.code, buf, len(buf))
+            err_text_reason = ffi.string(buf)
+
             errors_with_text.append(
                 _OpenSSLErrorWithText(
                     err.code, err.lib, err.func, err.reason, err_text_reason


Test patch:
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -125,9 +125,9 @@ def test_evp_ciphers_registered(self):
         assert cipher != backend._ffi.NULL
 
     def test_error_strings_loaded(self):
-        # returns a value in a static buffer
-        err = backend._lib.ERR_error_string(101183626, backend._ffi.NULL)
-        assert b"data not multiple of block length" in backend._ffi.string(err)
+        buf = backend._ffi.new("char[]", 256)
+        backend._lib.ERR_error_string_n(101183626, buf, len(buf))
+        assert b"data not multiple of block length" in backend._ffi.string(buf)
 
     def test_unknown_error_in_cipher_finalize(self):
         cipher = Cipher(AES(b"\0" * 16), CBC(b"\0" * 16), backend=backend)
Repository: pyca/cryptography

Issue:
Add a python_requires to our setup.py
cc: @dstufft 


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -283,6 +283,8 @@ def run_tests(self):
     packages=find_packages(where="src", exclude=["_cffi_src", "_cffi_src.*"]),
     include_package_data=True,
 
+    python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
+
     install_requires=[
         "idna >= 2.1",
         "asn1crypto >= 0.21.0",


Test patch: