<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/dh, branch master</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=master</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2026-01-23T08:32:22+00:00</updated>
<entry>
<title>DH_check: teach this DoS vector about RFC 7919 primes</title>
<updated>2026-01-23T08:32:22+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2026-01-23T08:32:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=cd68beaaec2fafb4bd60e9b8655b93d91804cc69'/>
<id>urn:sha1:cd68beaaec2fafb4bd60e9b8655b93d91804cc69</id>
<content type='text'>
ok beck
</content>
</entry>
<entry>
<title>Scapy special for DH_check()</title>
<updated>2026-01-23T08:21:52+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2026-01-23T08:21:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=e8699208c6c4338d425f0979a68ec6ea04009819'/>
<id>urn:sha1:e8699208c6c4338d425f0979a68ec6ea04009819</id>
<content type='text'>
The latest release of Scapy calls DH_check() on all the well-known
Diffie-Hellman parameters for RFCs 2409, 3526, and 7919. It does this
via pyca/cryptography at startup. Every single time. This is obviously
very expensive, due to our 64 MR rounds (which are complete overkill
now that we have BPSW). Instead of pondering the ideal number of rounds
for BPSW with FFDH, simply skip the check if the parameter matches a
well-known prime. These are known to be safe primes, so we can skip
those super-expensive and pointless checks without any risk.

This is only done for the public dh-&gt;p parameter. It could be further
optimized, but with the follow-up commit adding the RFC 7919 primes this
reduces the startup time to what it was before Scapy 2.7.0: &lt; 1s.

Reverting from 64 MR rounds to BN_check_primes rounds, we would still
have ~8s startup time without this optimization, which isn't great for
an interactive tool.

Clearly, it's not entirely our fault, it's also Scapy and cryptography
that do something ... suboptimal, but I think we're better off if
DH_check() isn't a complete DoS vector. If you're using non-standard
parameters with FFDH, you deserve it.

We could consider adding a flag for non-well-known p and thus making
DH_check() indicate failure for candidate primes larger than, say, 4k.

https://github.com/pyca/cryptography/issues/14048

ok beck kenjiro
</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>Remove #error if OPENSSL_NO_FOO is defined</title>
<updated>2025-01-25T17:59:44+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-25T17:59:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=5d52abc236226c5a47c36b07e2256e77141e373a'/>
<id>urn:sha1:5d52abc236226c5a47c36b07e2256e77141e373a</id>
<content type='text'>
discussed with jsing
</content>
</entry>
<entry>
<title>dh_ameth: explcitly -&gt; explicitly</title>
<updated>2025-01-17T05:04:25+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-17T05:04:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=cd1f21f8cbb9151769acbc7fd34da681a4d97a73'/>
<id>urn:sha1:cd1f21f8cbb9151769acbc7fd34da681a4d97a73</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove X9.42 DH rudiments</title>
<updated>2024-11-29T15:59:57+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2024-11-29T15:59:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=30b4f7f318b03413f22e3849cf9eeba83c165643'/>
<id>urn:sha1:30b4f7f318b03413f22e3849cf9eeba83c165643</id>
<content type='text'>
In the unlikely event that we should ever decide to implement this after
a quarter century of not needing it, we can readily put this back. Until
then this is dead weight.

prompted by a question by djm
ok jsing
</content>
</entry>
<entry>
<title>Remove weird pad member that was never set to zero after malloc() so</title>
<updated>2024-11-29T07:42:35+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2024-11-29T07:42:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=916f80d01875d84154d09cf15bfc3c885c8c0b05'/>
<id>urn:sha1:916f80d01875d84154d09cf15bfc3c885c8c0b05</id>
<content type='text'>
the weird thing it was supposed to be doing couldn't possibly work.

ok jsing
</content>
</entry>
<entry>
<title>Garbage collect the DH_check*_ex() API</title>
<updated>2024-08-30T17:44:56+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2024-08-30T17:44:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=67d80505486d7a6c9512d45a4d7e0add8a2b13ec'/>
<id>urn:sha1:67d80505486d7a6c9512d45a4d7e0add8a2b13ec</id>
<content type='text'>
This was only needed by the EVP_PKEY_*check() API, which was defanged. So
this silly garbage can now go: it translated flags to errors on the error
stack so that openssl *check could print ugly errors while DoS-ing the
user.

ok beck
</content>
</entry>
<entry>
<title>Remove the pkey_{,public_,param_}check() handlers</title>
<updated>2024-08-29T16:58:19+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2024-08-29T16:58:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=c8099c070f0c547b73edced83591dbd871254307'/>
<id>urn:sha1:c8099c070f0c547b73edced83591dbd871254307</id>
<content type='text'>
This disables the EVP_PKEY_*check() API and makes it fail (more precisely
indicate lack of support) on all key types.

This is an intermediate step to full removal.
Removal is ok beck jsing
</content>
</entry>
<entry>
<title>replace strtol(3) usage with strtonum(3); idea/ok/tweaks tb@</title>
<updated>2024-08-26T22:00:47+00:00</updated>
<author>
<name>op</name>
<email></email>
</author>
<published>2024-08-26T22:00:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=74733354b5147290f7bc39826a56793e0c4bdcda'/>
<id>urn:sha1:74733354b5147290f7bc39826a56793e0c4bdcda</id>
<content type='text'>
</content>
</entry>
</feed>
