diff options
Diffstat (limited to 'include/rsa.h')
-rw-r--r-- | include/rsa.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/rsa.h b/include/rsa.h index 803660d19a..f1e3c1b6c3 100644 --- a/include/rsa.h +++ b/include/rsa.h @@ -12,6 +12,7 @@ #ifndef _RSA_H #define _RSA_H +#include <linux/types.h> #include <errno.h> #include <digest.h> @@ -29,6 +30,7 @@ struct rsa_public_key { uint32_t *rr; /* R^2 as little endian array */ uint64_t exponent; /* public exponent */ char *key_name_hint; + struct list_head list; }; /** @@ -37,10 +39,10 @@ struct rsa_public_key { * Verify a RSA PKCS1.5 signature against an expected hash. * * @info: Specifies key and FIT information - * @data: Pointer to the input data - * @data_len: Data length * @sig: Signature * @sig_len: Number of bytes in signature + * @hash: hash over payload + * @algo: hashing algo * @return 0 if verified, -ve on error */ int rsa_verify(const struct rsa_public_key *key, const uint8_t *sig, @@ -50,8 +52,14 @@ int rsa_verify(const struct rsa_public_key *key, const uint8_t *sig, /* This is the maximum signature length that we support, in bits */ #define RSA_MAX_SIG_BITS 4096 +struct device_node; + struct rsa_public_key *rsa_of_read_key(struct device_node *node); void rsa_key_free(struct rsa_public_key *key); -struct rsa_public_key *rsa_get_key(const char *name); +const struct rsa_public_key *rsa_get_key(const char *name); + +const struct rsa_public_key *rsa_key_next(const struct rsa_public_key *prev); +#define for_each_rsa_key(key) \ + for (key = rsa_key_next(NULL); key; key = rsa_key_next(key)) #endif |