Gnus development mailing list
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Cc: emacs-devel@gnu.org
Subject: Re: gnutls status
Date: Fri, 26 Nov 2010 06:13:00 -0600	[thread overview]
Message-ID: <87ipzkmgfn.fsf@lifelogs.com> (raw)
In-Reply-To: <m3eia9nd1d.fsf@quimbies.gnus.org>

On Fri, 26 Nov 2010 01:28:46 +0100 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Julien Danjou <julien@danjou.info> writes:
>> gnutls support has been added to Emacs 24. What's the status of it?

LMI> It seems to work.

It's missing some features.  See
http://thread.gmane.org/gmane.emacs.devel/131441/focus=131551 and the
rest of that thread for the details.  The biggest one is callbacks.

We need callbacks to implement host name verification and certificate
chain checking, which are both IMO essential to making the Emacs GnuTLS
support "official."  In GnuTLS 2.8.x you can't set a callback function,
so the C code would need (from doc/examples/ex-rfc2818.c):

  if (gnutls_x509_crt_get_expiration_time (cert) < time (0))
    {
      printf ("The certificate has expired\n");
      return;
    }

  if (gnutls_x509_crt_get_activation_time (cert) > time (0))
    {
      printf ("The certificate is not yet activated\n");
      return;
    }

  if (!gnutls_x509_crt_check_hostname (cert, hostname))
    {
      printf ("The certificate's owner does not match hostname '%s'\n",
              hostname);
      return;
    }

which is very inflexible compared to a callback function.  We'd need to
add custom API options for each of the three checks above plus another
for the certificate chain verification; in addition it would be harder
to interact with the user and store trusted certificates from C.

2.10.x and above let us set a callback function, which would make all of
the above easier and more convenient from ELisp-land.  The problem is
that 2.10.x hasn't been widely adopted in Debian and thus won't work by
default.

So we'd need to either 1) require 2.10.x, or 2) complicate the C code
and API using just 2.8.x features and maybe figure out how to set up our
own callback mechanism, or 3) use the 2.10.x features only when it's
available, using autoconf detection, which is twice as complicated as
(2).

(2) and (3) will require a lot of new code that is completely
unnecessary under 2.10.x.

This is essentially why I haven't worked on the GnuTLS support in a bit:
I don't know the best way forward.  If anyone can suggest a good way to
do it, I'm all ears.  I also don't know about 2.10.x's status in the
major distros and whether Emacs can require that version or higher
specifically.

>> Could we use it in Gnus? Or is this still an Emacs side problem to
>> resolve?

LMI> nnimap has support for using it, but it's probably the wrong place to
LMI> put the support.  It should be put into tls.el, probably, so that all
LMI> the users don't have to know about the stuff...

I think every package should explicitly choose to support gnutls.el, it
shouldn't be an Emacs-wide choice.  There's too many configuration
options that depend on the purpose.  For instance IMAP and HTTPS have
really different security needs.  Also, GnuTLS is much more configurable
than the older command-line interfaces so normalizing the API is not so
easy.  This is why I removed the old tls.el compatibility code from
gnutls.el and it only has gnutls-* functions now (`open-gnutls-stream'
and `gnutls-negotiate' being the main entry points from the ELisp side,
while `gnutls-boot' is the main entry point from the C side).

IMO tls.el and friends should be made deprecated as soon as gnutls.el is
capable to verify a certificate chain, the expiration date, and the
hostname.  They are insecure and the cause of many bug reports over the
years, especially on the W32 platform.

As with the C issues above, if you have opinions or suggestions on how
to do all this better, including Gnus but also for Emacs in general,
tell me.  I'm CC-ing to emacs-devel as well.

Ted




  reply	other threads:[~2010-11-26 12:13 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 17:29 Julien Danjou
2010-11-26  0:28 ` Lars Magne Ingebrigtsen
2010-11-26 12:13   ` Ted Zlatanov [this message]
2010-11-26 12:51     ` Julien Danjou
2010-11-26 15:02       ` Stefan Monnier
2010-11-26 15:56         ` Julien Danjou
2010-11-26 18:42           ` Stefan Monnier
2010-11-27  9:36             ` Julien Danjou
2010-11-27 14:28               ` Stefan Monnier
2010-11-28  9:55               ` Lars Magne Ingebrigtsen
2010-11-26 14:10     ` Lars Magne Ingebrigtsen
2010-11-27 14:18       ` Lars Magne Ingebrigtsen
2010-11-27 14:40         ` Lars Magne Ingebrigtsen
2010-11-27 15:31           ` Lars Magne Ingebrigtsen
2010-11-27 16:04             ` Lars Magne Ingebrigtsen
2010-11-27 16:37               ` Steinar Bang
2010-11-27 16:41                 ` Lars Magne Ingebrigtsen
2010-11-27 16:59                   ` Lars Magne Ingebrigtsen
2010-11-27 17:33                     ` Dan Christensen
2010-11-27 17:36                       ` Lars Magne Ingebrigtsen
2010-11-27 17:42                         ` Lars Magne Ingebrigtsen
2010-11-28  2:36             ` Automatic STARTTLS upgrades (was: gnutls status) Lars Magne Ingebrigtsen
2010-11-28 12:28               ` Automatic STARTTLS upgrades Lars Magne Ingebrigtsen
2010-11-28 13:34                 ` Lars Magne Ingebrigtsen
2010-12-14 22:59       ` gnutls status Ted Zlatanov
2011-03-01 21:52         ` Ted Zlatanov
2011-03-05 11:01           ` Lars Magne Ingebrigtsen
2011-03-05 14:46             ` Ted Zlatanov

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=87ipzkmgfn.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).