From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 4/5] public-keys: rsa: remove unused functions
Date: Mon, 20 Oct 2025 13:31:01 +0200 [thread overview]
Message-ID: <20251020-public-keys-const-v1-4-301de7918b06@pengutronix.de> (raw)
In-Reply-To: <20251020-public-keys-const-v1-0-301de7918b06@pengutronix.de>
The functions to duplicate and free a rsa key are no longer used. Remove
them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
crypto/rsa.c | 18 ------------------
include/crypto/rsa.h | 8 --------
2 files changed, 26 deletions(-)
diff --git a/crypto/rsa.c b/crypto/rsa.c
index e4fc980f9187b49511d5b1a8e68d488944d9b483..ec5bd451158c29047cfd51eb64d3c38f4671e74d 100644
--- a/crypto/rsa.c
+++ b/crypto/rsa.c
@@ -447,24 +447,6 @@ struct public_key *rsa_of_read_key(struct device_node *node)
return err ? ERR_PTR(err) : key;
}
-void rsa_key_free(struct rsa_public_key *key)
-{
- free(key->modulus);
- free(key->rr);
- free(key);
-}
-
-struct rsa_public_key *rsa_key_dup(const struct rsa_public_key *key)
-{
- struct rsa_public_key *new;
-
- new = xmemdup(key, sizeof(*key));
- new->modulus = xmemdup(key->modulus, key->len * sizeof(uint32_t));
- new->rr = xmemdup(key->rr, key->len * sizeof(uint32_t));
-
- return new;
-}
-
static void rsa_init_keys_of(void)
{
struct device_node *sigs, *sig;
diff --git a/include/crypto/rsa.h b/include/crypto/rsa.h
index efc8fca152743482697bbca1dd48e59519275861..fce94df094f90359ef500088277a0c1bf9130c14 100644
--- a/include/crypto/rsa.h
+++ b/include/crypto/rsa.h
@@ -37,7 +37,6 @@ struct rsa_public_key {
struct device_node;
struct public_key *rsa_of_read_key(struct device_node *node);
-void rsa_key_free(struct rsa_public_key *key);
#ifdef CONFIG_CRYPTO_RSA
/**
@@ -55,8 +54,6 @@ void rsa_key_free(struct rsa_public_key *key);
int rsa_verify(const struct rsa_public_key *key, const uint8_t *sig,
const uint32_t sig_len, const uint8_t *hash,
enum hash_algo algo);
-
-struct rsa_public_key *rsa_key_dup(const struct rsa_public_key *key);
#else
static inline int rsa_verify(const struct rsa_public_key *key, const uint8_t *sig,
const uint32_t sig_len, const uint8_t *hash,
@@ -64,11 +61,6 @@ static inline int rsa_verify(const struct rsa_public_key *key, const uint8_t *si
{
return -ENOSYS;
}
-
-static inline struct rsa_public_key *rsa_key_dup(const struct rsa_public_key *key)
-{
- return NULL;
-}
#endif
#endif
--
2.47.3
next prev parent reply other threads:[~2025-10-20 12:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 11:30 [PATCH 0/5] public_keys: make const Sascha Hauer
2025-10-20 11:30 ` [PATCH 1/5] public-keys: ecdsa: remove list in ecdsa keys Sascha Hauer
2025-10-20 11:30 ` [PATCH 2/5] public-keys: move list out of struct public_key Sascha Hauer
2025-10-20 11:31 ` [PATCH 3/5] public-keys: rsa: allow struct public_key to be const Sascha Hauer
2025-10-20 11:31 ` Sascha Hauer [this message]
2025-10-20 11:31 ` [PATCH 5/5] public-keys: make const Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251020-public-keys-const-v1-4-301de7918b06@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox