diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2022-05-04 12:54:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-05-04 15:12:31 +0200 |
commit | 8a44a0c3259511f4eda61383d333f9f0858ca4a5 (patch) | |
tree | 0107327cb3ffe4abf6735dbdb51edd511e0316f6 /crypto | |
parent | b2f33a4b95af0566c735cfc188dc8758636c2263 (diff) | |
download | barebox-8a44a0c3259511f4eda61383d333f9f0858ca4a5.tar.gz barebox-8a44a0c3259511f4eda61383d333f9f0858ca4a5.tar.xz |
rsa: Add iterator for rsa keys
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/rsa.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/rsa.c b/crypto/rsa.c index 4e2d463b54..2eeb9984b1 100644 --- a/crypto/rsa.c +++ b/crypto/rsa.c @@ -446,6 +446,15 @@ void rsa_key_free(struct rsa_public_key *key) static LIST_HEAD(rsa_keys); +const struct rsa_public_key *rsa_key_next(const struct rsa_public_key *prev) +{ + prev = list_prepare_entry(prev, &rsa_keys, list); + list_for_each_entry_continue(prev, &rsa_keys, list) + return prev; + + return NULL; +} + const struct rsa_public_key *rsa_get_key(const char *name) { const struct rsa_public_key *key; |