Re: [PATCH] OpenSSL: Mark underlying BIO with the appropriate type flags

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Itamar Gafni <itamar.gafni@imperva.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2021-08-09T15:35:59Z
Lists: pgsql-hackers
> On 6 Aug 2021, at 12:16, Itamar Gafni <itamar.gafni@imperva.com> wrote:

> Previous to OpenSSL version 1.1.0, the BIO methods object would be copied directly from the existing socket type and then its read\write functions would be replaced.
> With 1.1.0 and up, the object is created from scratch and then all its methods are initialized to be the ones of the socket type, except read/write which are custom.
> In this newer way, a new type is given to it by calling “BIO_get_new_index”, but the related type flags aren’t added.

According to the documentation (I haven't tested it yet but will) I think you
are right that the type should be set with the appropriate BIO_TYPE_ flags.

For OpenSSL 1.0.1 and 1.0.2, wouldn't we need to set the .type with a randomly
chosen index anded with BIO_TYPE_DESCRIPTOR and BIO_TYPE_SOURCE_SINK as well?

--
Daniel Gustafsson		https://vmware.com/




Commits

  1. Set type identifier on BIO