]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lib: rsa: export rsa_verify_with_pkey()
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Tue, 16 Jun 2020 05:26:48 +0000 (14:26 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 11 Jul 2020 21:14:16 +0000 (23:14 +0200)
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 <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/u-boot/rsa.h
lib/rsa/rsa-verify.c

index a0bae495f0547b3b51201dbed90ac8cb38ce8e12..bed1c097c2ce146a5b7d2699fc6b32780b5e21bc 100644 (file)
@@ -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);
index 6c4bbc46250d124ccf9c01a0341465db81138fe9..2057f6819db8ac721ad99d4980ac9d579f3ff5b6 100644 (file)
@@ -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;
 }