Re: [PATCH 3/3] tls: Add support l_tls_set_alpn_list() and ALPN extension

Andrew Zaborowski <[email protected]> Mon, 9 Jan 2023 13:21:29 +0100
Newsgroups dev.linux.lists.ell
Message-ID <CAOq732KFWmSjq1LWzpQ_V4ZQVjEZ4WUHcyGzZ5UXHc6TH9UvRA@mail.gmail.com>
Hi Marcel,

On Thu, 5 Jan 2023 at 16:15, Marcel Holtmann <[email protected]> wrote:
> >> +static bool tls_alpn_server_absent(struct l_tls *tls)
> >> +{
> >> +       if (!tls->alpn_list)
> >> +               return false;
> >
> > I believe this returning false will break most usages of l_tls.
>
> can you elaborate why? When are you allowed to return false.

false here means that the extension should have been present, i.e. we
signal an error.  If the extension code thinks we're fine to proceed
it returns true.

This also makes the unit test fail.

Best regards and happy new year