unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 49055@debbugs.gnu.org, dick.r.chiang@gmail.com
Subject: bug#49055: 28.0.50; [PATCH] De-obfuscate gnutls_handshake loop
Date: Sat, 19 Jun 2021 16:47:58 +0300	[thread overview]
Message-ID: <83h7huvucx.fsf@gnu.org> (raw)
In-Reply-To: <87o8c2vupo.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat,  19 Jun 2021 15:40:19 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: dick.r.chiang@gmail.com,  49055@debbugs.gnu.org
> Date: Sat, 19 Jun 2021 15:40:19 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> I think that makes sense, so I've now applied your patch to Emacs 28.
> >
> > The code wasn't really 100% equivalent, though.
> 
> No -- it looped in two different ways, but staring at the code, I
> convinced myself that it should be functionally equivalent.
> 
> I may be misreading the code, though.

What bothers me:

  . the gnutls_error_is_fatal call is missing from the new code
  . the negative values of 'ret' (if they are significant) aren't
    tested anymore
  . the condition of GNUTLS_E_INTERRUPTED is tested only once, and
    immediately causes the outer while-loop to be abandoned

I'd love to see some rationale for these differences.  For example,
the last difference seems to have a potential of causing failure of
handshaking if the user happens to type some input (in GUI sessions),
or C-g in text-mode sessions, at some opportune moment.





  reply	other threads:[~2021-06-19 13:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  1:11 bug#49055: 28.0.50; [PATCH] De-obfuscate gnutls_handshake loop dick.r.chiang
2021-06-19 13:19 ` Lars Ingebrigtsen
2021-06-19 13:37   ` Eli Zaretskii
2021-06-19 13:40     ` Lars Ingebrigtsen
2021-06-19 13:47       ` Eli Zaretskii [this message]
2021-06-19 17:34         ` dick.r.chiang
2021-06-19 17:51           ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83h7huvucx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=49055@debbugs.gnu.org \
    --cc=dick.r.chiang@gmail.com \
    --cc=larsi@gnus.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 public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).