From 33c5fd6f5ade4e9bac2af1c2ca5755da1b0bc705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 18 May 2018 22:02:55 +0200 Subject: [PATCH] IOSC: Verify that RSA signature size is correct --- Source/Core/Core/IOS/IOSC.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Core/IOS/IOSC.cpp b/Source/Core/Core/IOS/IOSC.cpp index c2bbb292f3..7f47421ca8 100644 --- a/Source/Core/Core/IOS/IOSC.cpp +++ b/Source/Core/Core/IOS/IOSC.cpp @@ -316,6 +316,7 @@ ReturnCode IOSC::VerifyPublicKeySign(const std::array& sha1, Handle sign { const size_t expected_key_size = entry->subtype == SUBTYPE_RSA2048 ? 0x100 : 0x200; ASSERT(entry->data.size() == expected_key_size); + ASSERT(signature.size() == expected_key_size); mbedtls_rsa_context rsa; mbedtls_rsa_init(&rsa, MBEDTLS_RSA_PKCS_V15, 0);