app: aboot: mdtp: Fix blocking of fastboot boot command

When MDTP is activated, fastboot boot command should be blocked.
The change fixes the way it is done, such that fastboot boot
command is blocked before MDTP image verification is done.

Change-Id: I7567aecf8b28153405c03540bedc56f7110b0503
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 6f72f15..a032f6a 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -1877,6 +1877,9 @@
 
 void cmd_boot(const char *arg, void *data, unsigned sz)
 {
+#ifdef MDTP_SUPPORT
+	static bool is_mdtp_activated = 0;
+#endif /* MDTP_SUPPORT */
 	unsigned kernel_actual;
 	unsigned ramdisk_actual;
 	uint32_t image_actual;
@@ -1950,18 +1953,14 @@
 	else
 	{
 		/* fastboot boot is not allowed when MDTP is activated */
-
 		mdtp_ext_partition_verification_t ext_partition;
-		ext_partition.partition = boot_into_recovery ? MDTP_PARTITION_RECOVERY : MDTP_PARTITION_BOOT;
-		ext_partition.integrity_state = MDTP_PARTITION_STATE_UNSET;
-		ext_partition.page_size = page_size;
-		ext_partition.image_addr = (uint32_t)data;
-		ext_partition.image_size = image_actual - sig_actual;
-		ext_partition.sig_avail = TRUE;
-		mdtp_fwlock_verify_lock(&ext_partition);
+
+		if (!is_mdtp_activated) {
+			ext_partition.partition = MDTP_PARTITION_NONE;
+			mdtp_fwlock_verify_lock(&ext_partition);
+		}
 	}
 
-	bool is_mdtp_activated = 0;
 	mdtp_activated(&is_mdtp_activated);
 	if(is_mdtp_activated){
 		dprintf(CRITICAL, "fastboot boot command is not available.\n");