<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/rsa, 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-04-07T13:16:41+00:00</updated>
<entry>
<title>Rename labellen to label_len</title>
<updated>2026-04-07T13:16:41+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2026-04-07T13:16:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=825b6076f1b1772665d1adce40e8087ee4e3d091'/>
<id>urn:sha1:825b6076f1b1772665d1adce40e8087ee4e3d091</id>
<content type='text'>
Requested by jsing, ok beck
</content>
</entry>
<entry>
<title>Fix NULL deref for malformed OAEP parameters in CMS decryption</title>
<updated>2026-04-07T13:15:29+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2026-04-07T13:15:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=e783182e57d664df5859c6b6cbd65563cdc26528'/>
<id>urn:sha1:e783182e57d664df5859c6b6cbd65563cdc26528</id>
<content type='text'>
This converts rsa_cms_decrypt() to use X509_ALGOR_get0() and fixes a
NULL deref when a parameter is (invalidly) omitted similar to the fix
in ec/ec_ameth.c r1.66 from a couple years back. There is currently
an XXX annotating a hairy leak due to trying to be smart and stealing
the parameters from the oaep object. Instead, just make a copy of the
label string and free it in the exit path.

The diff adds an error for labellen == 0 since that is an invalid
encoding of pSpecifiedEmpty (see RFC 8017) -- per the DER the default
must be omitted. This way we avoid a malloc(0) implementation-defined
behavior.

This minor issue was assigned CVE-2026-28390 by OpenSSL and was reported
by too many to list. The fix is my own. It is similar to OpenSSL's fix
only because I rewiewed theirs and suggested an improvement or two.

This is the last of the "security fixes" in today's OpenSSL release that
"affect" LibreSSL. All the other bugs were already fixed a few years back
or we didn't have the code/bugs in the first place.

ok beck jsing
</content>
</entry>
<entry>
<title>libcrypto: add header guards to *_local.h</title>
<updated>2025-11-26T10:19:57+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-11-26T10:19:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=4879f73ba340a5a6a1e4b5812f046c92cf362d95'/>
<id>urn:sha1:4879f73ba340a5a6a1e4b5812f046c92cf362d95</id>
<content type='text'>
An upcoming change requires the inclusion of asn1_local.h in x509_local.h
which doesn't work due to missing header guards. Add guards to all local
headers that don't have them, although reacharounds and multiple inclusions
are unlikely to occur for most of those.

ok jsing
</content>
</entry>
<entry>
<title>libcrypto: rsa gen: min. distance between p and q</title>
<updated>2025-09-29T08:46:15+00:00</updated>
<author>
<name>jan</name>
<email></email>
</author>
<published>2025-09-29T08:46:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=46c56e258ad51543fa1d174ca9568ef545233a34'/>
<id>urn:sha1:46c56e258ad51543fa1d174ca9568ef545233a34</id>
<content type='text'>
This is required in NIST Special Publication 800-56B Revision 2
"Recommendation for Pair-Wise Key Establishment Using Integer
Factorization Cryptography":

 6 RSA Key Pairs
 6.2 Criteria for RSA Key Pairs for Key Establishment
 6.2.1 Definition of a Key Pair

	3. The prime factors p and q shall be generated using one of
	   the methods specified in Appendix B.3 of FIPS 186 such that:

		c. |p – q| &gt; 2nBits/2−100

ok djm@, tb@
</content>
</entry>
<entry>
<title>zap stray space</title>
<updated>2025-08-25T18:47:39+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-08-25T18:47:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=77f522b90e5282941310b9f28674633e01d6d594'/>
<id>urn:sha1:77f522b90e5282941310b9f28674633e01d6d594</id>
<content type='text'>
</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>rsa_pmeth: unify strcmp return checks</title>
<updated>2025-01-17T15:39:19+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-17T15:39:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=13bb4d5ac808eefe3abb437533ddc959dfeeceee'/>
<id>urn:sha1:13bb4d5ac808eefe3abb437533ddc959dfeeceee</id>
<content type='text'>
ok jsing
</content>
</entry>
<entry>
<title>Fix two incorrect strtonum() conversions</title>
<updated>2025-01-17T08:50:07+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-17T08:50:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=c7b7f02c70ae7b0b2ff0afb7ffca3587c3a5e4ea'/>
<id>urn:sha1:c7b7f02c70ae7b0b2ff0afb7ffca3587c3a5e4ea</id>
<content type='text'>
The atoi() would also accept the magic negative values and old openssl
releases would expose these as arguments to -pkeyopt rsa_pss_saltlen:-1
in the openssl pkeyutl "app". While modern openssl switched to having
readable alternatives to these, the oseid component of opensc would use
the old syntax until yesterday.

Still, this is our bug and we need to keep accepting the magic values as
such, so do so. Everything below -3 will be rejected by the RSA_ctrl()
handler later.

Debugged by Doug Engert in https://github.com/OpenSC/OpenSC/issues/3317

ok jsing op
</content>
</entry>
<entry>
<title>Stop requiring the RSA_FLAG_SIGN_VER</title>
<updated>2025-01-05T15:39:12+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2025-01-05T15:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=5c33a5ef4d95e91c63b215ad65de78c9bc54ff85'/>
<id>urn:sha1:5c33a5ef4d95e91c63b215ad65de78c9bc54ff85</id>
<content type='text'>
You can set custom sign and verify handlers on an RSA method (wihch is
used to create RSA private and public key handles). However, even if you
set them explicitly with RSA_meth_set_{sign,verify}(3), these handlers
aren't used for the sake of "backward compatibility" (with what?). In order
to use them, you need to opt your objects into using the custom methods
you set by setting the RSA_FLAG_SIGN_VER flag.

OpenSSL 1.1 dropped this requirement and therefore nobody sets this flag
anyore. Like most of the mechanically added accessors, almost nothing
uses them, but, as found by kn, the yubco-piv-tool does. This resulted
in a public key being passed to rsa_private_encrypt(), which of course
doesn't end well.

So follow OpenSSL 1.1 and drop this muppetry. This makes kn's problem
with yubico-piv-tool go away.

ok jsing kn
</content>
</entry>
</feed>
