Commit 785dc4c9 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

Fix RSA sigs for mbed TLS 2.7.0

In https://github.com/ARMmbed/mbedtls/commit/2f8f06aa25e9d5ee4fc9fe217543c872b39e4d05

    commit 2f8f06aa25e9d5ee4fc9fe217543c872b39e4d05
    Author: Hanno Becker <hanno.becker@arm.com>
    Date:   Fri Sep 29 11:47:26 2017 +0100

        Don't always recompute context length in mbedtls_rsa_get_len

mbed TLS begins assuming that the 'len' field of the context has been
set properly.  Previously, we relied on this not being true, and various
tests fail for all keys without setting this.

The fix is to simply set the length based on the value we read.

fixes #235.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 4dce6aac
Loading
Loading
Loading
Loading
+2
Changes for boot/bootutil/src/image_rsa.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -85,6 +85,8 @@ bootutil_parse_rsakey(mbedtls_rsa_context *ctx, uint8_t **p, uint8_t *end)
        return -3;
    }

    ctx->len = mbedtls_mpi_size(&ctx->N);

    if (*p != end) {
        return -4;
    }