all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Christopher Allan Webber <cwebber@dustycloud.org>
Cc: 22876-done@debbugs.gnu.org
Subject: bug#22876: Python can't use https with recent grafts
Date: Wed, 02 Mar 2016 02:27:52 -0500	[thread overview]
Message-ID: <87oaaxl4p3.fsf@netris.org> (raw)
In-Reply-To: <87oaaxspmy.fsf@dustycloud.org> (Christopher Allan Webber's message of "Tue, 01 Mar 2016 16:13:41 -0800")

In brief, I believe this is fixed by commit 03a0e682a8 on master.
See below for details.

Christopher Allan Webber <cwebber@dustycloud.org> writes:

> Christopher Allan Webber writes:
>
>> Most of Guix seems to be working just fine with the grafts support and
>> grafting of openssl.  However, unlike most grafts that will be done
>> probably, this one removes a feature, and that seems to be creating
>> problems in Python land.
>>
>>   >>> from urllib.request import HTTPSHandler
>>   Traceback (most recent call last):
>>     File "<stdin>", line 1, in <module>
>>   ImportError: cannot import name 'HTTPSHandler'
>
> As expected, this is for the same reasons offlineimap seemed to have
> problems:
>
>   cwebber@oolong:~/devel/mediagoblin$ python3
>   Python 3.4.3 (default, Jan  1 1970, 00:00:01) 
>   [GCC 4.9.3] on linux
>   Type "help", "copyright", "credits" or "license" for more information.
>   >>> import ssl
>   Traceback (most recent call last):
>     File "<stdin>", line 1, in <module>
>     File "/gnu/store/1spkp48cbbzg6ic5qkv3qpm3mvsgwkys-python-3.4.3/lib/python3.4/ssl.py", line 97, in <module>
>       import _ssl             # if we can't import it, let the error propagate
>   ImportError: /gnu/store/1spkp48cbbzg6ic5qkv3qpm3mvsgwkys-python-3.4.3/lib/python3.4/lib-dynload/_ssl.cpython-34m.so: undefined symbol: SSLv2_method
>
> This leads to my suspicion that it's not really grafting's fault here,
> it's the *removal* of a piece of code, thus making things
> abi-incompatible with the system we built.

That's exactly right, and it turns out that Guix is not the only one who
was bitten by this, e.g.:

  https://bugzilla.redhat.com/show_bug.cgi?id=1313509
  https://bodhi.fedoraproject.org/updates/openssl-1.0.2g-1.fc23#comment-395291
  https://forums.gentoo.org/viewtopic-p-7886940.html

I believe this issue is fixed by commit 03a0e682a8 on master.  In my
tests, I found that it fixes offlineimap, virtualenv, and importing
HTTPSHandler from urllib.request.

The fix is simply to add "enable-ssl2" to the arguments passed to the
OpenSSL ./config script.  I concluded that this is safe based on the
following excerpt from the CHANGES file:

  * Disable SSLv2 default build, default negotiation and weak ciphers.  SSLv2
    is by default disabled at build-time.  Builds that are not configured with
    "enable-ssl2" will not support SSLv2.  Even if "enable-ssl2" is used,
    users who want to negotiate SSLv2 via the version-flexible SSLv23_method()
    will need to explicitly call either of:

        SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv2);
    or
        SSL_clear_options(ssl, SSL_OP_NO_SSLv2);

    as appropriate.  Even if either of those is used, or the application
    explicitly uses the version-specific SSLv2_method() or its client and
    server variants, SSLv2 ciphers vulnerable to exhaustive search key
    recovery have been removed.  Specifically, the SSLv2 40-bit EXPORT
    ciphers, and SSLv2 56-bit DES are no longer available.
    (CVE-2016-0800)
    [Viktor Dukhovni]

Note that the "enable-ssl2" option is only needed when grafting, because
that's the only case where we need to preserve ABI compatibility.  I've
verified that 'offlineimap' works on the security-updates branch, where
openssl-1.0.2g has been updated in the normal way, without grafting and
without the "enable-ssl2" option.

> Hopefully most grafting situations won't require this.  I think that's
> right? :)

Yes.  When grafting, we must ensure ABI compatibility.  The mistake here
was that the ABI of the grafted OpenSSL was different than the one it
replaced.  Like Fedora and Gentoo, we expected upstream to ensure that
1.0.2g was ABI compatible with 1.0.2f.  I believe this was a reasonable
expectation.

> Is it possible to graft on top of a graft?

Good question, I don't know!  I guess we should test this, for the sake
of robustness, but on the other hand, I don't see a practical need for
this feature.  In general, we can simply update the replacement package,
which is what I've done in 03a0e682a8.

I'm closing this bug, but feel free to re-open it if you find that
problems remain.

    Thanks!
      Mark

      parent reply	other threads:[~2016-03-02  9:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 23:59 bug#22876: Python can't use https with recent grafts Christopher Allan Webber
2016-03-02  0:13 ` Leo Famulari
2016-03-02  0:13 ` Christopher Allan Webber
2016-03-02  0:23   ` Leo Famulari
2016-03-02  0:39   ` Jookia
2016-03-02  9:22     ` Ludovic Courtès
2016-03-02  7:27   ` Mark H Weaver [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oaaxl4p3.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=22876-done@debbugs.gnu.org \
    --cc=cwebber@dustycloud.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.