<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/ec, branch OPENBSD_7_3_BASE</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=OPENBSD_7_3_BASE</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=OPENBSD_7_3_BASE'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2023-03-15T06:34:07+00:00</updated>
<entry>
<title>Return the signature length after successful signing operation</title>
<updated>2023-03-15T06:34:07+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2023-03-15T06:34:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=40ffd290cb3438bcc29da70c71f6aa0d745b108a'/>
<id>urn:sha1:40ffd290cb3438bcc29da70c71f6aa0d745b108a</id>
<content type='text'>
This is required behavior of the EVP_DigestSign() API, but seemingly
almost nothing uses this. Well, turns out ldns does.

Reported by Stephane. Helpful comments by sthen.

ok jsing
</content>
</entry>
<entry>
<title>Fix a EC_GROUP_clear_free() that snuck through.</title>
<updated>2023-03-08T07:15:42+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-03-08T07:15:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=a98c7e8eda3eab639164bc30a686dde5afead101'/>
<id>urn:sha1:a98c7e8eda3eab639164bc30a686dde5afead101</id>
<content type='text'>
Thanks to Mark Patruck for reporting.
</content>
</entry>
<entry>
<title>Fix previous.</title>
<updated>2023-03-08T06:47:30+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-03-08T06:47:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=4b15066232b0315d89bd6b06997313243d49cf7a'/>
<id>urn:sha1:4b15066232b0315d89bd6b06997313243d49cf7a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Always clear EC groups and points on free.</title>
<updated>2023-03-08T05:45:31+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-03-08T05:45:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=948c28a26f1877b33103e7640006ebcd45dd4375'/>
<id>urn:sha1:948c28a26f1877b33103e7640006ebcd45dd4375</id>
<content type='text'>
Rather than sometimes clearing, turn the free functions into ones that
always clear (as we've done elsewhere). Turn the EC_GROUP_clear_free() and
EC_POINT_clear_free() functions into wrappers that call the *_free()
version. Do similar for the EC_METHOD implementations, removing the
group_clear_finish() and point_clear_finish() hooks in the process.

ok tb@
</content>
</entry>
<entry>
<title>Stop trying to use EC_GFp_nist_method().</title>
<updated>2023-03-08T05:35:51+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-03-08T05:35:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=3be8a86f4ba429fee41aff51d19115163d2a66b1'/>
<id>urn:sha1:3be8a86f4ba429fee41aff51d19115163d2a66b1</id>
<content type='text'>
Currently, if compiled without OPENSSL_BN_ASM_MONT,
EC_GROUP_new_curve_GFp() tries to use EC_GFp_nist_method(), falling back to
EC_GFp_mont_method() if it is not a NIST curve (if OPENSSL_BN_ASM_MONT is
defined we use EC_GFp_mont_method() unconditionally).

Now that we have a reasonable non-assembly Montgomery implementation, the
performance of EC_GFp_nist_method() is either similar or slower than
EC_GFp_mont_method() (the exception being P-521, however if you're using
that you're not doing it for performance reasons anyway).

The EC_GFp_nist_method() uses rather scary BN NIST code (which would
probably already be removed, if not for the BN and EC public APIs), it uses
code paths that are currently less constant time, and there is additional
overhead in checking to see if the curve is actually supported.

Stop trying to use EC_GFp_nist_method() and unconditionally use
EC_GFp_mont_method() in all cases. While here, factor out the common
setup code and call it from both EC_GROUP_new_curve_GFp() and
EC_GROUP_new_curve_GF2m().

ok beck@ tb@
</content>
</entry>
<entry>
<title>Remove EC_FLAGS_DEFAULT_OCT.</title>
<updated>2023-03-08T04:50:27+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-03-08T04:50:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=c1e53bad96443f0f9eea47910c725fb8cb5636ac'/>
<id>urn:sha1:c1e53bad96443f0f9eea47910c725fb8cb5636ac</id>
<content type='text'>
The EC code has an amazing array of function pointer hooks, such that a
method can hook into almost any operation... and then there is the
EC_FLAGS_DEFAULT_OCT flag, which adds a bunch of complex code and #ifdef
so you can avoid setting three of those function pointers!

Remove EC_FLAGS_DEFAULT_OCT, the now unused flags field from EC_METHOD,
along with the various code that was wrapped in EC_FLAGS_DEFAULT_OCT,
setting the three function pointers that need to be set in each of the
EC_METHODs.

ok beck@ tb@
</content>
</entry>
<entry>
<title>Call BN_free() instead of BN_clear_free().</title>
<updated>2023-03-07T09:27:10+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-03-07T09:27:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=19dfe7f484e5739359ee8c102d879d125df916ad'/>
<id>urn:sha1:19dfe7f484e5739359ee8c102d879d125df916ad</id>
<content type='text'>
BN_clear_free() is a wrapper that calls BN_free() - call BN_free() directly
instead.

ok tb@
</content>
</entry>
<entry>
<title>Fix another return value check for CMS_SharedInfo_encode()</title>
<updated>2023-03-07T07:01:35+00:00</updated>
<author>
<name>tb</name>
<email></email>
</author>
<published>2023-03-07T07:01:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=e67f9e65948ede08383b3f3e867520b37c8f7553'/>
<id>urn:sha1:e67f9e65948ede08383b3f3e867520b37c8f7553</id>
<content type='text'>
This should have been included in a previous diff/commit...
</content>
</entry>
<entry>
<title>Move EC_GFp_simple_method() to the bottom of the file.</title>
<updated>2023-03-07T05:54:40+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-03-07T05:54:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=d92645e4cc1bfb53f3218199eb21c2e876dbd098'/>
<id>urn:sha1:d92645e4cc1bfb53f3218199eb21c2e876dbd098</id>
<content type='text'>
Most of the implemeentation functions for EC_GFp_simple_method() are reused
by other code, hence they cannot be made static. However, this keeps the
pattern consistent.

ok tb@
</content>
</entry>
<entry>
<title>Use static functions for EC_GF2m_simple_method() implementation.</title>
<updated>2023-03-07T05:50:59+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2023-03-07T05:50:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=9aae699938e6684ed47cd6d37a031e3100587c47'/>
<id>urn:sha1:9aae699938e6684ed47cd6d37a031e3100587c47</id>
<content type='text'>
Move the EC_METHOD to the bottom of the file, which allows implementation
functions to become static. Remove unneeded prototypes.

ok tb@
</content>
</entry>
</feed>
