]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rsa: reject images with unknown padding
authorPatrick Doyle <wpdster@gmail.com>
Fri, 14 Jun 2019 17:43:38 +0000 (13:43 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 21 Jun 2019 14:07:11 +0000 (10:07 -0400)
Previously we would store NULL in info->padding and jump to an illegal
instruction if an unknown value for "padding" was specified in the
device tree.

Signed-off-by: Patrick Doyle <pdoyle@irobot.com>
common/image-sig.c

index 4f6b4ec412c30c11989080e7c3e56a61959d572f..004fbc525b5c0dcac81e6fcf974f52806cdd1898 100644 (file)
@@ -211,7 +211,7 @@ static int fit_image_setup_verify(struct image_sign_info *info,
        info->required_keynode = required_keynode;
        printf("%s:%s", algo_name, info->keyname);
 
-       if (!info->checksum || !info->crypto) {
+       if (!info->checksum || !info->crypto || !info->padding) {
                *err_msgp = "Unknown signature algorithm";
                return -1;
        }