diff options
| author | AKASHI Takahiro <[email protected]> | 2020-06-16 14:26:48 +0900 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2020-07-11 23:14:16 +0200 |
| commit | 491bfe86062464b892386e8c8dfe0069975ecedc (patch) | |
| tree | baec662d2fe965b8818aabe40a987998bd8e607b | |
| parent | 53ce9a6ed98b69a82e54a28254b014e480fc98ca (diff) | |
lib: rsa: export rsa_verify_with_pkey()
This function will be used to implement public_key_verify_signature()
in a later patch. rsa_verify() is not suitable here because calculation
of message digest is not necessary.
Signed-off-by: AKASHI Takahiro <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
| -rw-r--r-- | include/u-boot/rsa.h | 3 | ||||
| -rw-r--r-- | lib/rsa/rsa-verify.c | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/include/u-boot/rsa.h b/include/u-boot/rsa.h index a0bae495f05..bed1c097c2c 100644 --- a/include/u-boot/rsa.h +++ b/include/u-boot/rsa.h @@ -112,6 +112,9 @@ int rsa_verify(struct image_sign_info *info, const struct image_region region[], int region_count, uint8_t *sig, uint sig_len); +int rsa_verify_with_pkey(struct image_sign_info *info, + const void *hash, uint8_t *sig, uint sig_len); + int padding_pkcs_15_verify(struct image_sign_info *info, uint8_t *msg, int msg_len, const uint8_t *hash, int hash_len); diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c index 6c4bbc46250..2057f6819db 100644 --- a/lib/rsa/rsa-verify.c +++ b/lib/rsa/rsa-verify.c @@ -387,8 +387,8 @@ static int rsa_verify_key(struct image_sign_info *info, * * Return 0 if verified, -ve on error */ -static int rsa_verify_with_pkey(struct image_sign_info *info, - const void *hash, uint8_t *sig, uint sig_len) +int rsa_verify_with_pkey(struct image_sign_info *info, + const void *hash, uint8_t *sig, uint sig_len) { struct key_prop *prop; int ret; @@ -408,8 +408,8 @@ static int rsa_verify_with_pkey(struct image_sign_info *info, return ret; } #else -static int rsa_verify_with_pkey(struct image_sign_info *info, - const void *hash, uint8_t *sig, uint sig_len) +int rsa_verify_with_pkey(struct image_sign_info *info, + const void *hash, uint8_t *sig, uint sig_len) { return -EACCES; } |
