<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libtls/tls_keypair.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>2026-04-16T07:29:53+00:00</updated>
<entry>
<title>libtls: use tls_error_setx() after BIO_new_mem_buf()</title>
<updated>2026-04-16T07:29:53+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2026-04-16T07:29:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=03c4722ecfb4116b7f9fd10b6a216287a7ecf24d'/>
<id>urn:sha1:03c4722ecfb4116b7f9fd10b6a216287a7ecf24d</id>
<content type='text'>
This is the only place where tls_error_set() was used. While the new length
check now guarantees that the failure is due to ENOMEM, this info does not
add value.

From Michael Forney

ok bcook
</content>
</entry>
<entry>
<title>libtls: prefer x version of error setting</title>
<updated>2026-04-16T07:28:00+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2026-04-16T07:28:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=4ab01251a636fac40d8a39e8cc3ba506580aa79b'/>
<id>urn:sha1:4ab01251a636fac40d8a39e8cc3ba506580aa79b</id>
<content type='text'>
If a check fails and errno is not necessarily set by the previous API call
use tls_set_errorx() or tls_error_setx() since turning an unrelated errno
into an error string is unhelpful.

From Michael Forney

ok bcook
</content>
</entry>
<entry>
<title>libtls: add missing length checks before BIO_new_mem_buf()</title>
<updated>2026-04-16T05:16:48+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2026-04-16T05:16:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=d680a6fb78c5f1a30a0d45de7b989cee9631652a'/>
<id>urn:sha1:d680a6fb78c5f1a30a0d45de7b989cee9631652a</id>
<content type='text'>
Like all proper libcrypto APIs, BIO_new_mem_buf() takes an int as a length
argument. Check the size_t passed in to be at most INT_MAX to avoid issues
with truncation and overflow like it's done everywhere else. After release
this should probably be clamped down further since legitimate files (certs
and keys) are nowhere near this large.

Prompted by a diff by Michael Forney

ok jsing
</content>
</entry>
<entry>
<title>Add error code support to libtls</title>
<updated>2024-03-26T06:24:52+00:00</updated>
<author>
<name>joshua</name>
<email></email>
</author>
<published>2024-03-26T06:24:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=bd68c6e1694d8d4eb801f32889da4cdde0b3c311'/>
<id>urn:sha1:bd68c6e1694d8d4eb801f32889da4cdde0b3c311</id>
<content type='text'>
This adds tls_config_error_code() and tls_error_code(), which will become
public API at a later date.

Additional error codes will be added in follow-up commits.

ok jsing@ beck@
</content>
</entry>
<entry>
<title>Fix indent.</title>
<updated>2021-01-05T17:37:12+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2021-01-05T17:37:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=34fac48299b0cc05da218aa9d764f8b28cfb190b'/>
<id>urn:sha1:34fac48299b0cc05da218aa9d764f8b28cfb190b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix return value variable type in tls_keypair_load_cert</title>
<updated>2020-12-15T08:47:45+00:00</updated>
<author>
<name>inoguchi</name>
<email></email>
</author>
<published>2020-12-15T08:47:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=512be7bfc4cad08f2f6caac6207aa310bfa15630'/>
<id>urn:sha1:512be7bfc4cad08f2f6caac6207aa310bfa15630</id>
<content type='text'>
ERR_peek_error() returns unsigned long.
Reported by github issue by @rozhuk-im.

ok bcook@ jsing@
</content>
</entry>
<entry>
<title>Correct tls_config_clear_keys() behaviour.</title>
<updated>2018-04-07T16:35:34+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2018-04-07T16:35:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=111c0ba098842c9337026115c4d68b9a0f312b9d'/>
<id>urn:sha1:111c0ba098842c9337026115c4d68b9a0f312b9d</id>
<content type='text'>
Previously this incorrectly called tls_keypair_clear(), which results in
the private key being cleared, along with the certificate, OCSP staple and
pubkey hash. This breaks OCSP stapling if tls_config_clear_keys() is called
following tls_configure(), as is done by httpd.

Fix this by calling tls_keypair_clear_key() so that only the private key is
cleared, leaving the other public data untouched. While here, remove
tls_keypair_clear() and fold the necessary parts into tls_keypair_free().

ok beck@
</content>
</entry>
<entry>
<title>Move the keypair pubkey hash handling code to during config.</title>
<updated>2018-02-10T04:57:35+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2018-02-10T04:57:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=351d578b1eacfbf1586f49fbbabbdb4e7efdbf5c'/>
<id>urn:sha1:351d578b1eacfbf1586f49fbbabbdb4e7efdbf5c</id>
<content type='text'>
The keypair pubkey hash was being generated and set in the keypair when the
TLS context was being configured. This code should not be messing around
with the keypair contents, since it is part of the config (and not the
context).

Instead, generate the pubkey hash and store it in the keypair when the
certificate is configured. This means that we are guaranteed to have the
pubkey hash and as a side benefit, we identify bad certificate content
when it is provided, instead of during the context configuration.

ok beck@
</content>
</entry>
<entry>
<title>Have tls_keypair_pubkey_hash() call tls_keypair_load_cert() instead of</title>
<updated>2018-02-08T10:19:31+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2018-02-08T10:19:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=1f7ca2478ab23918c94907b989d2935db2a2b660'/>
<id>urn:sha1:1f7ca2478ab23918c94907b989d2935db2a2b660</id>
<content type='text'>
rolling its own certificate loading. This also means we get better error
reporting on failure.
</content>
</entry>
<entry>
<title>Ensure that tls_keypair_clear() clears the OCSP staple and pubkey hash.</title>
<updated>2018-02-08T10:03:19+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2018-02-08T10:03:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=3201cd5485a2044378dd20e89b032881dfe85945'/>
<id>urn:sha1:3201cd5485a2044378dd20e89b032881dfe85945</id>
<content type='text'>
</content>
</entry>
</feed>
