Fixed an issue that supported later versions of mbedtls than mbedtls-2.6.1

Signed-off-by: Yiping Peng <836885645@qq.com>
Signed-off-by: Yiping Peng <yibingp@internal.synopsys.com>
diff --git a/boot/bootutil/src/image_rsa.c b/boot/bootutil/src/image_rsa.c
index 7a9ca15..0534c12 100644
--- a/boot/bootutil/src/image_rsa.c
+++ b/boot/bootutil/src/image_rsa.c
@@ -27,6 +27,7 @@
 
 #include "mbedtls/rsa.h"
 #include "mbedtls/asn1.h"
+#include "mbedtls/version.h"
 
 #include "bootutil_priv.h"
 
@@ -89,9 +90,18 @@
         return -4;
     }
 
-    if ((rc = mbedtls_rsa_check_pubkey(ctx)) != 0) {
+    /* The mbedtls version is more than 2.6.1 */
+#if MBEDTLS_VERSION_NUMBER > 0x02060100
+    rc = mbedtls_rsa_import(ctx, &ctx->N, NULL, NULL, NULL, &ctx->E);
+    if (rc != 0) {
         return -5;
     }
+#endif
+
+    rc = mbedtls_rsa_check_pubkey(ctx);
+    if (rc != 0) {
+        return -6;
+    }
 
     ctx->len = mbedtls_mpi_size(&ctx->N);