<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/lib/rsa, branch v2021.10</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/lib/rsa?h=v2021.10</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/lib/rsa?h=v2021.10'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2021-09-14T15:46:48Z</updated>
<entry>
<title>image: rsa: Move padding_algos to linker lists</title>
<updated>2021-09-14T15:46:48Z</updated>
<author>
<name>Alexandru Gagniuc</name>
<email>mr.nuke.me@gmail.com</email>
</author>
<published>2021-08-18T22:49:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=de41f0ee0d68bcdf7d97018fdfe4bfe9fe3e53a2'/>
<id>urn:sha1:de41f0ee0d68bcdf7d97018fdfe4bfe9fe3e53a2</id>
<content type='text'>
We are not guaranteed to have the padding_pkcs_15_verify symbol since
commit 92c960bc1d ("lib: rsa: Remove #ifdefs from rsa.h"), and
commit 61416fe9df ("Kconfig: FIT_SIGNATURE should not select RSA_VERIFY")

The padding_algos only make sense with RSA verification, which can now
be disabled in lieu of ECDSA. In fact this will lead to build failures
because of the missing symbol mentioned earlier.

To resolve this, move the padding_algos to a linker list, with
declarations moved to rsa_verify.c. This is consistent with commit
6909edb4ce ("image: rsa: Move verification algorithm to a linker list")

One could argue that the added #ifdef USE_HOSTCC is ugly, and should
be hidden within the U_BOOT_PADDING_ALGO() macro. However, this would
be inconsistent with the "cryptos" list. This logic for was not
previously explored:

Without knowledge of the U_BOOT_PADDING_ALGO() macro, its use is
similar to something being declared. However, should #ifndef
USE_HOSTCC be part of the macro, it would not be obvious that it
behaves differently on host code and target code. Having the #ifndef
outside the macro makes this obvious.

Also, the #ifdef is not always necessary. For example ecda-verify
makes use of U_BOOT_CRYPTO_ALGO() without any accompanying #ifdefs.
The fundamental issue is a lack of separation of host and target code
in rsa_verify. Therefore, the declaration of a padding algo with the
external #ifdef is more readable and consistent.

Signed-off-by: Alexandru Gagniuc &lt;mr.nuke.me@gmail.com&gt;
</content>
</entry>
<entry>
<title>lib/rsa: don't use NULL as key_id</title>
<updated>2021-09-14T13:07:18Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>xypron.glpk@gmx.de</email>
</author>
<published>2021-08-28T10:13:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d607dfd878700648a7cc07ab40b2faf77df29acd'/>
<id>urn:sha1:d607dfd878700648a7cc07ab40b2faf77df29acd</id>
<content type='text'>
If keydir is not provided but name is we want to use name as key_id.

But with the current coding name is only used on its own if it is NULL
and keydir is provided which never occurs.

Fixes: 824ee745fbca ("lib/rsa: Use the 'keyfile' argument from mkimage")
Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>mkimage: use environment variable MKIMAGE_SIGN_PIN to set pin for OpenSSL Engine</title>
<updated>2021-07-29T00:46:34Z</updated>
<author>
<name>Marc Kleine-Budde</name>
<email>mkl@pengutronix.de</email>
</author>
<published>2021-07-23T20:17:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=62b27a561c2868d95445905ad554297e43cc0f2b'/>
<id>urn:sha1:62b27a561c2868d95445905ad554297e43cc0f2b</id>
<content type='text'>
This patch adds the possibility to pass the PIN the OpenSSL Engine
used during signing via the environment variable MKIMAGE_SIGN_PIN.
This follows the approach used during kernel module
signing ("KBUILD_SIGN_PIN") or UBIFS image
signing ("MKIMAGE_SIGN_PIN").

Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>lib: rsa: rsa-sign: Minor bug in debug message</title>
<updated>2021-07-29T00:46:34Z</updated>
<author>
<name>Chan, Donald</name>
<email>hoiho@lab126.com</email>
</author>
<published>2021-07-19T16:18:54Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6d59ace988fdc1bb9f52ab70e21af0d40380c3f3'/>
<id>urn:sha1:6d59ace988fdc1bb9f52ab70e21af0d40380c3f3</id>
<content type='text'>
*sig_size isn't set until later so use the correct variables.

Signed-off-by: Donald Chan &lt;hoiho@lab126.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>lib: rsa: rsa-verify: Fix a typo in a debug message</title>
<updated>2021-07-29T00:46:34Z</updated>
<author>
<name>Thomas Perrot</name>
<email>thomas.perrot@bootlin.com</email>
</author>
<published>2021-07-19T14:04:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0eadb2b2da9ef7fccd39b22487a1de581f37330a'/>
<id>urn:sha1:0eadb2b2da9ef7fccd39b22487a1de581f37330a</id>
<content type='text'>
Signed-off-by: Thomas Perrot &lt;thomas.perrot@bootlin.com&gt;
</content>
</entry>
<entry>
<title>image: rsa: Move verification algorithm to a linker list</title>
<updated>2021-07-16T19:38:49Z</updated>
<author>
<name>Alexandru Gagniuc</name>
<email>mr.nuke.me@gmail.com</email>
</author>
<published>2021-07-14T22:05:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6909edb4cedf90c7a1fb68302dc2cec6291a0fcd'/>
<id>urn:sha1:6909edb4cedf90c7a1fb68302dc2cec6291a0fcd</id>
<content type='text'>
Move the RSA verification crytpo_algo structure out of the
crypto_algos array, and into a linker list.

Although it appears we are adding an #ifdef to rsa-verify.c, the gains
outweigh this small inconvenience. This is because rsa_verify() is
defined differently based on #ifdefs. This change allows us to have
a single definition of rsa_verify().

Signed-off-by: Alexandru Gagniuc &lt;mr.nuke.me@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>image: Rename CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT</title>
<updated>2021-07-16T16:58:55Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-07-14T22:05:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ad74aed11e1dfe39b7f32dd855859abaf51d33f0'/>
<id>urn:sha1:ad74aed11e1dfe39b7f32dd855859abaf51d33f0</id>
<content type='text'>
Drop the ENABLE and SUPPORT parts of this, which are redundant.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Alexandru Gagniuc &lt;mr.nuke.me@gmail.com&gt;
Signed-off-by: Alexandru Gagniuc &lt;mr.nuke.me@gmail.com&gt;
</content>
</entry>
<entry>
<title>lib/rsa: Use EVP_PKEY instead of RSA</title>
<updated>2021-04-14T21:45:04Z</updated>
<author>
<name>Chan, Donald</name>
<email>hoiho@lab126.com</email>
</author>
<published>2021-04-01T22:42:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fbc777429fa35312a9ea5f106692172d3153e659'/>
<id>urn:sha1:fbc777429fa35312a9ea5f106692172d3153e659</id>
<content type='text'>
Most modern OpenSSL engines have methods overridden at the EVP level rather
than at RSA level, to make these engines work properly with mkimage, the RSA
signing code needs to switch to using EVP_* APIs as much as possible.

Signed-off-by: Donald Chan &lt;hoiho@lab126.com&gt;
[trini: Rebase on top of keyfile changes]
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>lib/rsa: Use the 'keyfile' argument from mkimage</title>
<updated>2021-04-14T19:23:01Z</updated>
<author>
<name>Alexandru Gagniuc</name>
<email>mr.nuke.me@gmail.com</email>
</author>
<published>2021-02-19T18:45:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=824ee745fbcaa73ad74a30f992aaf2e732a5a325'/>
<id>urn:sha1:824ee745fbcaa73ad74a30f992aaf2e732a5a325</id>
<content type='text'>
Keys can be derived from keydir, and the "key-name-hint" property of
the FIT. They can also be specified ad-literam via 'keyfile'. Update
the RSA signing path to use the appropriate one.

Signed-off-by: Alexandru Gagniuc &lt;mr.nuke.me@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>lib/rsa: Make fdt_add_bignum() available outside of RSA code</title>
<updated>2021-04-14T19:06:08Z</updated>
<author>
<name>Alexandru Gagniuc</name>
<email>mr.nuke.me@gmail.com</email>
</author>
<published>2021-02-19T18:45:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4c17e5f69170bf033df7b4f1a2b87fa72f18aaf5'/>
<id>urn:sha1:4c17e5f69170bf033df7b4f1a2b87fa72f18aaf5</id>
<content type='text'>
fdt_add_bignum() is useful for algorithms other than just RSA. To
allow its use for ECDSA, move it to a common file under lib/.

The new file is suffixed with '-libcrypto' because it has a direct
dependency on openssl. This is due to the use of the "BIGNUM *" type.

Signed-off-by: Alexandru Gagniuc &lt;mr.nuke.me@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
</feed>
