Commit 4f82f670 authored by Tristan Seligmann's avatar Tristan Seligmann

Import python-cryptography_1.5.2.orig.tar.gz

parent f92eaca2
Changelog
=========
1.5.2 - 2016-09-26
~~~~~~~~~~~~~~~~~~
* Updated Windows and OS X wheels to be compiled against OpenSSL 1.0.2j.
1.5.1 - 2016-09-22
~~~~~~~~~~~~~~~~~~
* Updated Windows and OS X wheels to be compiled against OpenSSL 1.0.2i.
* Resolved a ``UserWarning`` when used with cffi 1.8.3.
* Fixed a memory leak in name creation with X.509.
* Added a workaround for old versions of setuptools.
* Fixed an issue preventing ``cryptography`` from compiling against
OpenSSL 1.0.2i.
1.5 - 2016-08-26
~~~~~~~~~~~~~~~~
......
Metadata-Version: 1.1
Name: cryptography
Version: 1.5
Version: 1.5.2
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
Author: The cryptography developers
......
......@@ -32,6 +32,8 @@ INCLUDES = """
(OPENSSL_VERSION_NUMBER < 0x10002000)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_102BETA3 \
(OPENSSL_VERSION_NUMBER < 0x10002003)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_102I \
(OPENSSL_VERSION_NUMBER < 0x1000209fL)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 \
(OPENSSL_VERSION_NUMBER < 0x10100000)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE5 \
......@@ -51,6 +53,8 @@ static const int CRYPTOGRAPHY_OPENSSL_110_OR_GREATER;
static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_101;
static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_102I;
static const int CRYPTOGRAPHY_IS_LIBRESSL;
"""
......
......@@ -664,7 +664,10 @@ static const long Cryptography_HAS_SET_CERT_CB = 1;
#endif
#if defined(OPENSSL_NO_COMP) || defined(LIBRESSL_VERSION_NUMBER)
/* In OpenSSL 1.0.2i+ the handling of COMP_METHOD when OPENSSL_NO_COMP was
changed and we no longer need to typedef void */
#if (defined(OPENSSL_NO_COMP) && CRYPTOGRAPHY_OPENSSL_LESS_THAN_102I) || \
defined(LIBRESSL_VERSION_NUMBER)
static const long Cryptography_HAS_COMPRESSION = 0;
typedef void COMP_METHOD;
#else
......
Metadata-Version: 1.1
Name: cryptography
Version: 1.5
Version: 1.5.2
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
Author: The cryptography developers
......
......@@ -14,7 +14,7 @@ __summary__ = ("cryptography is a package which provides cryptographic recipes"
" and primitives to Python developers.")
__uri__ = "https://github.com/pyca/cryptography"
__version__ = "1.5"
__version__ = "1.5.2"
__author__ = "The cryptography developers"
__email__ = "cryptography-dev@python.org"
......
......@@ -17,7 +17,13 @@ def _available_backends():
if _available_backends_list is None:
_available_backends_list = [
ep.resolve()
# DeprecatedIn16
# setuptools 11.3 deprecated support for the require parameter to
# load(), and introduced the new resolve() method instead.
# We previously removed this fallback, but users are having issues
# where Python loads an older setuptools due to various syspath
# weirdness.
ep.resolve() if hasattr(ep, "resolve") else ep.load(require=False)
for ep in pkg_resources.iter_entry_points(
"cryptography.backends"
)
......
......@@ -133,7 +133,7 @@ class Backend(object):
def derive_pbkdf2_hmac(self, algorithm, length, salt, iterations,
key_material):
alg_enum = self._supported_pbkdf2_hmac_algorithms[algorithm.name]
buf = self._ffi.new("char[]", length)
buf = self._ffi.new("uint8_t[]", length)
res = self._lib.CCKeyDerivationPBKDF(
self._lib.kCCPBKDF2,
key_material,
......
......@@ -292,7 +292,7 @@ class Backend(object):
def derive_pbkdf2_hmac(self, algorithm, length, salt, iterations,
key_material):
buf = self._ffi.new("char[]", length)
buf = self._ffi.new("unsigned char[]", length)
evp_md = self._lib.EVP_get_digestbyname(
algorithm.name.encode("ascii"))
self.openssl_assert(evp_md != self._ffi.NULL)
......
......@@ -185,8 +185,8 @@ class _AESCTRCipherContext(object):
cipher.key, len(cipher.key) * 8, self._key
)
self._backend.openssl_assert(res == 0)
self._ecount = self._backend._ffi.new("char[]", 16)
self._nonce = self._backend._ffi.new("char[16]", mode.nonce)
self._ecount = self._backend._ffi.new("unsigned char[]", 16)
self._nonce = self._backend._ffi.new("unsigned char[16]", mode.nonce)
self._num = self._backend._ffi.new("unsigned int *", 0)
def update(self, data):
......
......@@ -102,7 +102,7 @@ class _ECDSASignatureContext(object):
max_size = self._backend._lib.ECDSA_size(ec_key)
self._backend.openssl_assert(max_size > 0)
sigbuf = self._backend._ffi.new("char[]", max_size)
sigbuf = self._backend._ffi.new("unsigned char[]", max_size)
siglen_ptr = self._backend._ffi.new("unsigned int[]", 1)
res = self._backend._lib.ECDSA_sign(
0,
......
......@@ -85,6 +85,10 @@ def _encode_name(backend, attributes):
subject = backend._lib.X509_NAME_new()
for attribute in attributes:
name_entry = _encode_name_entry(backend, attribute)
# X509_NAME_add_entry dups the object so we need to gc this copy
name_entry = backend._ffi.gc(
name_entry, backend._lib.X509_NAME_ENTRY_free
)
res = backend._lib.X509_NAME_add_entry(subject, name_entry, -1, 0)
backend.openssl_assert(res == 1)
return subject
......
......@@ -103,7 +103,7 @@ def _enc_dec_rsa_pkey_ctx(backend, key, data, padding_enum, padding):
backend.openssl_assert(res > 0)
outlen = backend._ffi.new("size_t *", buf_size)
buf = backend._ffi.new("char[]", buf_size)
buf = backend._ffi.new("unsigned char[]", buf_size)
res = crypt(pkey_ctx, buf, outlen, data, len(data))
if res <= 0:
_handle_rsa_enc_dec_error(backend, key)
......
......@@ -182,7 +182,7 @@ class TestOpenSSL(object):
assert size == length
return sample_data
monkeypatch.setattr(os, "urandom", notrandom)
buf = backend._ffi.new("char[]", length)
buf = backend._ffi.new("unsigned char[]", length)
backend._lib.RAND_bytes(buf, length)
assert backend._ffi.buffer(buf)[0:length] == sample_data
......@@ -247,7 +247,7 @@ class TestOpenSSLRandomEngine(object):
def test_osrandom_sanity_check(self):
# This test serves as a check against catastrophic failure.
buf = backend._ffi.new("char[]", 500)
buf = backend._ffi.new("unsigned char[]", 500)
res = backend._lib.RAND_bytes(buf, 500)
assert res == 1
assert backend._ffi.buffer(buf)[:] != "\x00" * 500
......@@ -729,7 +729,7 @@ class TestGOSTCertificate(object):
backend
)
if (
not backend._lib.CRYPTOGRAPHY_OPENSSL_110_OR_GREATER or
backend._lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102I or
backend._lib.CRYPTOGRAPHY_IS_LIBRESSL
):
with pytest.raises(ValueError) as exc:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment