Skip to content

Commit

Permalink
pyopenssl: 16.2.0 -> 17.0.0 and fix tests
Browse files Browse the repository at this point in the history
Upstream changes:

 * Added OpenSSL.X509Store.set_time() to set a custom verification time
   when verifying certificate chains. pyca/pyopenssl#567
 * Added a collection of functions for working with OCSP stapling. None
   of these functions make it possible to validate OCSP assertions, only
   to staple them into the handshake and to retrieve the stapled
   assertion if provided. Users will need to write their own code to
   handle OCSP assertions. We specifically added:
   Context.set_ocsp_server_callback, Context.set_ocsp_client_callback,
   and Connection.request_ocsp. pyca/pyopenssl#580
 * Changed the SSL module's memory allocation policy to avoid zeroing
   memory it allocates when unnecessary. This reduces CPU usage and
   memory allocation time by an amount proportional to the size of the
   allocation. For applications that process a lot of TLS data or that
   use very lage allocations this can provide considerable performance
   improvements. pyca/pyopenssl#578
 * Automatically set SSL_CTX_set_ecdh_auto() on OpenSSL.SSL.Context.
   pyca/pyopenssl#575
 * Fix empty exceptions from OpenSSL.crypto.load_privatekey().
   pyca/pyopenssl#581

The full upstream changelog can be found at:

https://pyopenssl.readthedocs.io/en/17.0.0/changelog.html

I've also added a patch from pyca/pyopenssl#637 in order to fix the
tests, which was the main reason for the version bump because that patch
won't apply for 16.2.0.

According to the upstream changelog there should be no
backwards-incompatible changes, but I've tested building against some of
the packages depending on pyopenssl anyway. Regardless of this, the
build for pyopenssl fails right now anyway, so the worst that could
happen via this commit would be that we break something that's already
broken.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
  • Loading branch information
aszlig committed Jun 21, 2017
1 parent 5cbc6ca commit 7c0f6f4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -20318,11 +20318,17 @@ in {

pyopenssl = buildPythonPackage rec {
name = "pyopenssl-${version}";
version = "16.2.0";
version = "17.0.0";

src = pkgs.fetchurl {
url = "mirror://pypi/p/pyOpenSSL/pyOpenSSL-${version}.tar.gz";
sha256 = "0vji4yrfshs15xpczbhzhasnjrwcarsqg87n98ixnyafnyxs6ybp";
sha256 = "1pdg1gpmkzj8yasg6cmkhcivxcdp4c12nif88y4qvsxq5ffzxas8";
};

patches = pkgs.fetchpatch {
url = "https://github.com/pyca/pyopenssl/commit/"
+ "a40898b5f1d472f9449a344f703fa7f90cddc21d.patch";
sha256 = "0bdfrhfvdfxhfknn46s4db23i3hww6ami2r1l5rfrri0pn8b8mh7";
};

preCheck = ''
Expand Down

6 comments on commit 7c0f6f4

@lsix
Copy link
Member

@lsix lsix commented on 7c0f6f4 Jun 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this be backported to release-17.03? pyopenssl is broken because of tests fail.

Usual approach would be to stay with 16.x version, but since the patch does not apply and there should not be backward incompatibilities, maybe this is the way we should go to fix the stable branch.

cc @FRidh

@FRidh
Copy link
Member

@FRidh FRidh commented on 7c0f6f4 Jun 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lsix If the build still fails I see no point in backporting it.

@lsix
Copy link
Member

@lsix lsix commented on 7c0f6f4 Jun 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not tested (yet) with this patch backported, but at the moment release-17.03 fails to build pyopenssl (and anything depending on it).

@kamilchm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot build mitmproxy with it as it requires pyOpenSSL>=16.0, <17.0 https://github.com/mitmproxy/mitmproxy/blob/v2.0.2/setup.py#L76

@fpletz
Copy link
Member

@fpletz fpletz commented on 7c0f6f4 Jul 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an upstream patch to bump the dependency: e4dd637

@kamilchm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works now, thx

Please sign in to comment.