[PATCH 4/5] public-keys: rsa: remove unused functions

Sascha Hauer s.hauer at pengutronix.de
Mon Oct 20 04:31:01 PDT 2025


The functions to duplicate and free a rsa key are no longer used. Remove
them.

Signed-off-by: Sascha Hauer <s.hauer at 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




More information about the barebox mailing list