<div dir="ltr"><div dir="ltr">Dear Kurt</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 8, 2020 at 1:10 PM Kurt Roeckx <<a href="mailto:kurt@roeckx.be" target="_blank">kurt@roeckx.be</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, May 07, 2020 at 02:31:24PM +0200, Tomas Mraz wrote:<br>
> On Thu, 2020-05-07 at 12:47 +0100, Matt Caswell wrote:<br>
> > <br>
> > On 07/05/2020 12:22, Kurt Roeckx wrote:<br>
> > > So I think we need at least to agree on:<br>
> > > - Do we want an option that makes the unexpected EOF either a fatal<br>
> > >   error or a non-fatal error?<br>
> > > - Which error should we return?<br>
> > <br>
> > This is an excellent summary of the current situation.<br>
> > <br>
> > I am not keen on maintaining the SSL_ERROR_SYSCALL with 0 errno as a<br>
> > long term solution. It's a very confusing API for new applications to<br>
> > use. Effectively it means SSL_ERROR_SYSCALL is a fatal error - except<br>
> > when its not. SSL_ERROR_SYSCALL should mean fatal error.<br>
> > <br>
> > That said I also recognise that it is apparently commonplace to shut<br>
> > down a TLS connection without sending close_notify - despite what the<br>
> > standards may say about it (and TBH we can hardly claim the moral<br>
> > high<br>
> > ground here since s_server does exactly this - or at least it does in<br>
> > 1.1.1 and did until very recently in master).<br>
> > <br>
> > But we do have to consider usages beyond HTTPS. I have no idea if<br>
> > this<br>
> > occurs in other settings or not.<br>
> > <br>
> > Perhaps what we need is an option for "strict shutdown". With strict<br>
> > shutdown "off" we could treat EOF as if we had received a<br>
> > close_notify<br>
> > gracefully (and don't invalidate the session). Presumably existing<br>
> > code<br>
> > would be able to cope with that???<br>
> <br>
> Yes, existing code would be able to cope with that with one important<br>
> exception that I am going to talk about below.<br>
> <br>
> > With strict shutdown "on" we treat it as SSL_ERROR_SSL (as now in<br>
> > master).<br>
> > <br>
> > I'm not sure though what the default should be.<br>
> <br>
> In case we go with this solution, which would be acceptable I think, we<br>
> MUST NOT EVER make it the default because existing applications that<br>
> depend on the existing way how the unclean EOF condition is returned<br>
> might actually depend on it to detect the truncation attack.<br>
<br>
I agree that we should not return SSL_ERROR_ZERO_RETURN by default<br>
on an unexpected EOF.<br>
<br>
If the default behaviour should be to make it a non-fatal error,<br>
like the old behaviour is, I would really prefer a different<br>
error, one that's not SSL_ERROR_SYSCALL or SSL_ERROR_SSL.<br>
<br>
So I think the suggestion is to have this:<br>
- By default, SSL_ERROR_SSL is returned with<br>
  SSL_R_UNEXPECTED_EOF_WHILE_READING, the session will be<br>
  marked invalid.<br>
- With an option, SSL_ERROR_ZERO_RETURN is returned, the session<br>
  will stay valid.<br></blockquote><div><br>If I remember correctly, session resumption is a way to significantly reduce a server's workload.</div><div>So I think that by default (and maybe the only option) we should prefer the old behaviour.</div></div><div><br></div>-- <br><div dir="ltr">SY, Dmitry Belyavsky</div></div>