]> git.sur5r.net Git - u-boot/blobdiff - lib/rsa/rsa-verify.c
rsa: Use checksum algorithms from struct hash_algo
[u-boot] / lib / rsa / rsa-verify.c
index da45daffd3b434c685a8f4b8aad7050800b9be01..60126d22884b6e29dd18887ee7fbad90869ed049 100644 (file)
@@ -184,7 +184,12 @@ int rsa_verify(struct image_sign_info *info,
        }
 
        /* Calculate checksum with checksum-algorithm */
-       info->algo->checksum->calculate(region, region_count, hash);
+       ret = info->algo->checksum->calculate(info->algo->checksum->name,
+                                       region, region_count, hash);
+       if (ret < 0) {
+               debug("%s: Error in checksum calculation\n", __func__);
+               return -EINVAL;
+       }
 
        /* See if we must use a particular key */
        if (info->required_keynode != -1) {