<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/bio/bss_mem.c, branch OPENBSD_7_9_BASE</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9_BASE</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9_BASE'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2025-05-31T11:31:16+00:00</updated>
<entry>
<title>Plug leak of bm-&gt;buf-&gt;data</title>
<updated>2025-05-31T11:31:16+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-05-31T11:31:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=410c2d0bcc144feb12f0d8a71338cd32edc4fcc9'/>
<id>urn:sha1:410c2d0bcc144feb12f0d8a71338cd32edc4fcc9</id>
<content type='text'>
BIO_new(BIO_s_mem()) now allocates this pointer, so we need to free it
before assigning to it.
</content>
</entry>
<entry>
<title>Create bm-&gt;buf from the start to avoid arithmetic on NULL</title>
<updated>2025-05-24T19:45:34+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-05-24T19:45:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=8f9b910dab9bb415ae6b6c130c5e1d7bf9045d92'/>
<id>urn:sha1:8f9b910dab9bb415ae6b6c130c5e1d7bf9045d92</id>
<content type='text'>
This is a different way of avoiding the pointer arithmetic on NULL and
avoids test breakage in pyca/cryptography. This is also a gross hack
that penalizes existing callers of BIO_s_mem(), but this is rarely
called in a hot loop and if so that will most likely be a test.

ok kenjiro joshua jsing
</content>
</entry>
<entry>
<title>Revert "bio_mem: avoid pointer arithmetic on NULL"</title>
<updated>2025-05-24T19:43:09+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-05-24T19:43:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=fca273f703deb8e39e842b4028f0797813f40bbf'/>
<id>urn:sha1:fca273f703deb8e39e842b4028f0797813f40bbf</id>
<content type='text'>
This causes a test failure in pyca/cryptography.
</content>
</entry>
<entry>
<title>bio_mem: avoid pointer arithmetic on NULL</title>
<updated>2025-05-18T06:38:11+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-05-18T06:38:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=af1ef3c1489da1809c2ff641297daa2a8c023e75'/>
<id>urn:sha1:af1ef3c1489da1809c2ff641297daa2a8c023e75</id>
<content type='text'>
Prompted by a diff by Kenjiro Nakayama

ok jsing
</content>
</entry>
<entry>
<title>Use err_local.h rather than err.h in most places</title>
<updated>2025-05-10T05:54:39+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-05-10T05:54:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=41e8f99dd1625a9f0c80ce9d4383e95b18e85709'/>
<id>urn:sha1:41e8f99dd1625a9f0c80ce9d4383e95b18e85709</id>
<content type='text'>
ok jsing
</content>
</entry>
<entry>
<title>Hide symbols in asn1 and bio</title>
<updated>2023-07-05T21:23:37+00:00</updated>
<author>
<name>beck</name>
<email></email>
</author>
<published>2023-07-05T21:23:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=0da1913b3c721e1a62fd66bc43547b4e910cbc34'/>
<id>urn:sha1:0da1913b3c721e1a62fd66bc43547b4e910cbc34</id>
<content type='text'>
ok jsing@
</content>
</entry>
<entry>
<title>Reduce memmoves in memory BIOs.</title>
<updated>2022-02-19T15:59:12+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2022-02-19T15:59:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=ecfbd0cd7a34e8b04af5f08a69bc02929f863d11'/>
<id>urn:sha1:ecfbd0cd7a34e8b04af5f08a69bc02929f863d11</id>
<content type='text'>
Currently, a read/write memory BIO pulls up the data via memmove() on each
read. This becomes very expensive when a lot of small reads are performed,
especially if there is a reasonable amount of data stored in the memory
BIO.

Instead, store a read offset into the buffer and only perform a memmove()
to pull up the data on a write, if we have read more than 4096 bytes. This
way we only perform memmove() when the space saving will potentially be of
benefit, while avoiding frequent memmove() in the case of small interleaved
reads and writes.

Should address oss-fuzz #19881.

ok inoguchi@ tb@
</content>
</entry>
<entry>
<title>Provide a struct bio_mem for memory BIO specific data.</title>
<updated>2022-02-19T08:11:16+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2022-02-19T08:11:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=5504d19c6403ab7e219eaf0b32151f79998f1d0d'/>
<id>urn:sha1:5504d19c6403ab7e219eaf0b32151f79998f1d0d</id>
<content type='text'>
In order to fix and improve the memory BIO, we need to be able to track
more than just a single BUF_MEM *. Provide a struct bio_mem (which
currently only contains a BUF_MEM *) and rework the internals to use this
struct.

ok inoguchi@ tb@
</content>
</entry>
<entry>
<title>Clean up and simplify memory BIO code.</title>
<updated>2022-02-18T17:30:13+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2022-02-18T17:30:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=e7ff7e9be98905e4e791056a5d6ec18f71fc52ff'/>
<id>urn:sha1:e7ff7e9be98905e4e791056a5d6ec18f71fc52ff</id>
<content type='text'>
This is a first pass that uses sensible and consistent names for variables.
Call the BIO 'bio' (instead of 'a', 'b', 'bp', or 'h'), drop a bunch of
unnecessary casts, simplify some logic and add additional error checking.

With input from and ok tb@
</content>
</entry>
<entry>
<title>Add a new, mostly empty, bio_local.h and include it in the files</title>
<updated>2022-01-07T09:02:18+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-01-07T09:02:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=1eb53a0fe0ea503fe673aa0a6e347e503090c429'/>
<id>urn:sha1:1eb53a0fe0ea503fe673aa0a6e347e503090c429</id>
<content type='text'>
that will need it in the upcoming bump.

discussed with jsing
</content>
</entry>
</feed>
