<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/bn, branch libressl-v3.5.3</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=libressl-v3.5.3</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=libressl-v3.5.3'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2022-03-15T15:52:39+00:00</updated>
<entry>
<title>Fix infinite loop in BN_mod_sqrt()</title>
<updated>2022-03-15T15:52:39+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-03-15T15:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=0566442e5364a22ee73d48c1a1b2e5741e5fb155'/>
<id>urn:sha1:0566442e5364a22ee73d48c1a1b2e5741e5fb155</id>
<content type='text'>
A bug in the implementation of the Tonelli-Shanks algorithm can lead to
an infinite loop. This loop can be hit in various ways, in particular on
decompressing an elliptic curve public key via EC_POINT_oct2point() - to
do this, one must solve y^2 = x^3 + ax + b for y, given x.

If a certificate uses explicit encoding for elliptic curve parameters,
this operation needs to be done during certificate verification, leading
to a DoS. In particular, everything dealing with untrusted certificates
is affected, notably TLS servers explicitly configured to request
client certificates (httpd, smtpd, various VPN implementations, ...).
Ordinary TLS servers do not consume untrusted certificates.

The problem is that we cannot assume that x^3 + ax + b is actually a
square on untrusted input and neither can we assume that the modulus
p is a prime. Ensuring that p is a prime is too expensive (it would
likely itself lead to a DoS). To avoid the infinite loop, fix the logic
to be more resilient and explicitly limit the number of iterations that
can be done.  The bug is such that the infinite loop can also be hit for
primes = 3 (mod 4) but fortunately that case is optimized earlier.

It's also worth noting that there is a size bound on the field size
enforced via OPENSSL_ECC_MAX_FIELD_BITS (= 661), which help mitigate
further DoS vectors in presence of this fix.

Reported by Tavis Ormandy and David Benjamin, Google
Patch based on the fixes by David Benjamin and Tomas Mraz, OpenSSL

ok beck inoguchi
</content>
</entry>
<entry>
<title>Avoid a NULL dereference in BN_mod_exp2_mont()</title>
<updated>2022-02-07T19:49:56+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-02-07T19:49:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=2a7a0fc6126681d5d309772a47c2a7aa45bb00cd'/>
<id>urn:sha1:2a7a0fc6126681d5d309772a47c2a7aa45bb00cd</id>
<content type='text'>
This is a very rarely used function and the crash is hard to reach in
practice. Instead of implementing BN_is_odd() badly by hand, just call
the real thing.

Reported by Guido Vranken

ok beck jsing
</content>
</entry>
<entry>
<title>Check for zero modulus in BN_MONT_CTX_set().</title>
<updated>2022-02-07T19:44:23+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-02-07T19:44:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=ba7fe30fcf200c09c61915f9a3cd9eb665e5e277'/>
<id>urn:sha1:ba7fe30fcf200c09c61915f9a3cd9eb665e5e277</id>
<content type='text'>
From OpenSSL 6a009812, prompted by a report by Guido Vranken

ok beck jsing
</content>
</entry>
<entry>
<title>Add and fix check for BN functions return value</title>
<updated>2022-01-20T10:56:22+00:00</updated>
<author>
<name>inoguchi</name>
<email></email>
</author>
<published>2022-01-20T10:56:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=ae60d4677fb27d77be1fda6163944d7d6e899bdb'/>
<id>urn:sha1:ae60d4677fb27d77be1fda6163944d7d6e899bdb</id>
<content type='text'>
ok jsing@ millert@ tb@
</content>
</entry>
<entry>
<title>Add check for BN functions return value</title>
<updated>2022-01-20T10:53:33+00:00</updated>
<author>
<name>inoguchi</name>
<email></email>
</author>
<published>2022-01-20T10:53:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=e0e1bf647e391fbbeca93e407acf21bd81b3468f'/>
<id>urn:sha1:e0e1bf647e391fbbeca93e407acf21bd81b3468f</id>
<content type='text'>
CID 21665 24835

comment from jsing@ and tb@
ok jsing@ millert@ tb@
</content>
</entry>
<entry>
<title>Move BN structs to bn_lcl.h</title>
<updated>2022-01-14T08:01:47+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-01-14T08:01:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=4c3657741a468acfaaa95c4732410b866126cefc'/>
<id>urn:sha1:4c3657741a468acfaaa95c4732410b866126cefc</id>
<content type='text'>
This makes all structs in bn.h opaque that are also opaque in OpenSSL.

ok inoguchi jsing
</content>
</entry>
<entry>
<title>Unifdef LIBRESSL_OPAQUE_* and LIBRESSL_NEXT_API</title>
<updated>2022-01-14T07:49:49+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2022-01-14T07:49:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=82ec18edf4e632f36b6f79c239fdb6961d421a82'/>
<id>urn:sha1:82ec18edf4e632f36b6f79c239fdb6961d421a82</id>
<content type='text'>
This marks the start of major surgery in libcrypto. Do not attempt to
build the tree for a while (~50 commits).
</content>
</entry>
<entry>
<title>Pull BN_{new,init,clear,clear_free,free} up to the top of bn_lib.c</title>
<updated>2021-12-27T15:12:22+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2021-12-27T15:12:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=19abe3564aaf0e3572c3b71bc4f4065e819e371a'/>
<id>urn:sha1:19abe3564aaf0e3572c3b71bc4f4065e819e371a</id>
<content type='text'>
Discussed with tb@
</content>
</entry>
<entry>
<title>Consistently call BN_init() before BN_with_flags()</title>
<updated>2021-12-26T15:16:50+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2021-12-26T15:16:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=8bbb1196379de707bb70e7d4ef92d3d214ec58bb'/>
<id>urn:sha1:8bbb1196379de707bb70e7d4ef92d3d214ec58bb</id>
<content type='text'>
BN_with_flags() preserves the BN_FLG_MALLOCED flag of the destination
which results in a potential use of an uninitialized bit. In practice
this doesn't matter since we don't free the cloned BIGNUMs anyway.

As jsing points out, these are mostly pointless noise and should be
garbage collected. I'll leave that for another rainy day.

Coverity flagged one instance BN_gcd_no_branch(), the rest was found by
the ever so helpful grep(1).

CID 345122

ok jsing
</content>
</entry>
<entry>
<title>Annotate the structs to be moved to bn_lcl.h in the next bump</title>
<updated>2021-12-04T16:11:10+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2021-12-04T16:11:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=6fff4c764088ba7436758d0c3f3e140d832d4035'/>
<id>urn:sha1:6fff4c764088ba7436758d0c3f3e140d832d4035</id>
<content type='text'>
ok inoguchi jsing
</content>
</entry>
</feed>
