<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/bio, branch libressl-v3.7.0</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=libressl-v3.7.0</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=libressl-v3.7.0'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2022-12-07T23:08:47+00:00</updated>
<entry>
<title>Improve the implementation of BIO_push(3) such that it changes nothing</title>
<updated>2022-12-07T23:08:47+00:00</updated>
<author>
<name>schwarze</name>
<email></email>
</author>
<published>2022-12-07T23:08:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=eab11350130a507ed42936e4a3c922f3930a163e'/>
<id>urn:sha1:eab11350130a507ed42936e4a3c922f3930a163e</id>
<content type='text'>
and reports failure if a call would result in a cycle.
The algorithm used was originally suggested by jsing@.
Feedback and OK tb@.
</content>
</entry>
<entry>
<title>Make sure BIO_push(3) always preserves all invariants of the prev_bio</title>
<updated>2022-12-06T17:59:21+00:00</updated>
<author>
<name>schwarze</name>
<email></email>
</author>
<published>2022-12-06T17:59:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=3b64f394bc39450f6bc4bd64ecff7d97d8f0ddb7'/>
<id>urn:sha1:3b64f394bc39450f6bc4bd64ecff7d97d8f0ddb7</id>
<content type='text'>
and next_bio fields of all BIO objects in all affected chains, no
matter what the arguments are.
In particular, if the second argument (the one to be appended) is
not at the beginning of its chain, properly detach the beginning
of its chain before appending.

We have weak indications that this bug might affect real-world code.
For example, in FreeRDP, file libfreerdp/crypto/tls.c, function
bio_rdp_tls_ctrl(), case BIO_C_SET_SSL, BIO_push(3) is definitely
called with a second argument that is *not* at the beginning of its
chain.  Admittedly, that code is hard to fathom, but it does appear
to result in a bogus prev_bio pointer without this patch.
The practical impact of this bug in this and other software remains
unknown; the consequences might possibly escalate up to use-after-free
issues if BIO_pop(3) is afterwards called on corrupted BIO objects.

OK tb@
</content>
</entry>
<entry>
<title>Improve the poorly designed BIO_set_next(3) API to always preserve all</title>
<updated>2022-12-06T16:10:55+00:00</updated>
<author>
<name>schwarze</name>
<email></email>
</author>
<published>2022-12-06T16:10:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=acd6804e79b3e295f377e2b130890a08aafc3c2f'/>
<id>urn:sha1:acd6804e79b3e295f377e2b130890a08aafc3c2f</id>
<content type='text'>
invariants of the prev_bio and next_bio fields of all BIO objects
in all involved chains, no matter which arguments this function is
called with.

Both real-world uses of this function (in libssl and freerdp) have
been audited to make sure this makes nothing worse.  We believe libssl
behaves correctly before and after the patch (mostly because the second
argument is NULL there), and we believe the code in freerdp behaves
incorrectly before and after the patch, leaving a prev_bio pointer in
place that is becoming bogus, only in a different object before and
after the patch.  But after the patch, that bogus pointer is due to a
separate bug in BIO_push(3), which we are planning to fix afterwards.

Joint work with and OK tb@.
</content>
</entry>
<entry>
<title>Revert bio_prev removal</title>
<updated>2022-12-02T19:44:04+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-12-02T19:44:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=a24e48fc0fa4c6c759985c014000574a65d4d0a8'/>
<id>urn:sha1:a24e48fc0fa4c6c759985c014000574a65d4d0a8</id>
<content type='text'>
As schwarze points out, you can pop any BIO in a chain, not just the first
one (bonus points for a great name for this API).

The internal doubly linked was used to fix up the BIO chain bio was part
of when you BIO_pop() a bio that wasn't in the first position, which is
explicitly allowed in our documentation and implied by OpenSSL's.
</content>
</entry>
<entry>
<title>Mostly align BIO_read()/BIO_write() return values with OpenSSL 3.x.</title>
<updated>2022-11-30T01:56:18+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2022-11-30T01:56:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=91315cb3be072462af759c6d8f63e0611eacd0e2'/>
<id>urn:sha1:91315cb3be072462af759c6d8f63e0611eacd0e2</id>
<content type='text'>
For various historical reasons, there are a number of cases where our
BIO_read() and BIO_write() return slightly different values to what
OpenSSL 3.x does (of course OpenSSL 1.0 differs from OpenSSL 1.1 which
differs from OpenSSL 3.x). Mostly align these - some further work will be
needed.

Issue raised by tb@ who also wrote some test code.
</content>
</entry>
<entry>
<title>Retire prev_bio</title>
<updated>2022-11-28T07:50:00+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-11-28T07:50:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=12f76b76beacba6aead901d495f28742f55c8995'/>
<id>urn:sha1:12f76b76beacba6aead901d495f28742f55c8995</id>
<content type='text'>
While BIO chains are doubly linked lists, nothing has ever made use of this
fact internally. Even libssl has failed to maintain prev_bio properly in
two places for a long time. When BIO was made opaque, the opportunity to
fix that was missed. Instead, BIO_set_next() now allows breaking the lists
from outside the library, which freerdp has long done.

Problem found by schwarze while trying to document BIO_set_next().

schwarze likes the idea
ok jsing
</content>
</entry>
<entry>
<title>Avoid potential divide by zero in BIO_dump_indent_cb()</title>
<updated>2022-10-17T18:26:41+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2022-10-17T18:26:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=16d28f35982285c3fa25fa684eeccb156a626557'/>
<id>urn:sha1:16d28f35982285c3fa25fa684eeccb156a626557</id>
<content type='text'>
Passing an indent value of 67 results in DUMP_WIDTH_LESS_IDENT returning a
value of zero, which is promptly used for division. Likewise, passing a
value larger than 67 results in a negative value being returned.

Prevent this by limiting indent to 64 (which matches OpenSSL's current
behaviour), as well as ensuring that dump_width is &gt; 0.

Should fix oss-fuzz #52464 and #52467.

ok miod@ tb@
</content>
</entry>
<entry>
<title>Make BIO_info_cb() identical to bio_info_cb()</title>
<updated>2022-09-11T17:26:03+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-09-11T17:26:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=94cbd0cbaa6bd7b993b4ff34b97d4b25871d250e'/>
<id>urn:sha1:94cbd0cbaa6bd7b993b4ff34b97d4b25871d250e</id>
<content type='text'>
Various projects use bio_info_cb and BIO_info_cb interchangeably, for
example mupdf and freerdp. This is because this was changed in OpenSSL
commit fce78bd4 (2017), triggered by new warnings in gcc 8.

https://github.com/openssl/openssl/pull/4493

This results in some scary compiler warnings and useless patches in ports.
Nobody seems to be using the old bio_info_cb() version.

ok jsing
</content>
</entry>
<entry>
<title>Initialize readbytes in BIO_gets()</title>
<updated>2022-08-15T10:48:45+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-08-15T10:48:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=9941457719d171d10c67071b0c61a16d8bde375c'/>
<id>urn:sha1:9941457719d171d10c67071b0c61a16d8bde375c</id>
<content type='text'>
If the bgets() callback returns &lt;= 0, we currently rely on the user
provided callback to set readbytes, which isn't ideal. This also
matches what's done in BIO_read() and BIO_write().

ok jsing
</content>
</entry>
<entry>
<title>Remove mkerr.pl remnants from LibreSSL</title>
<updated>2022-07-12T14:42:50+00:00</updated>
<author>
<name>kn</name>
<email></email>
</author>
<published>2022-07-12T14:42:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=89e42d5857196a8071fbafb5565388d0e20ec32b'/>
<id>urn:sha1:89e42d5857196a8071fbafb5565388d0e20ec32b</id>
<content type='text'>
This script is not used at all and files are edited by hand instead.
Thus remove misleading comments incl. the obsolete script/config.

Feedback OK jsing tb
</content>
</entry>
</feed>
