Build: Enable using HW keys with upstream MCUboot

Modify the build system (by removing restrictions) to allow HW key
usage for image authentication when the 'UPSTREAM' MCUboot repository is
selected as MCUboot v1.6.0 (current default bootloader) already includes
this feature.

Change-Id: Ifa7de6a26febb8b140b409f63fc8c059ed2c3278
Signed-off-by: David Vincze <david.vincze@linaro.org>
diff --git a/bl2/ext/mcuboot/keys.c b/bl2/ext/mcuboot/keys.c
index 480994c..df2497f 100644
--- a/bl2/ext/mcuboot/keys.c
+++ b/bl2/ext/mcuboot/keys.c
@@ -24,8 +24,10 @@
  * Modifications are Copyright (c) 2019-2020 Arm Limited.
  */
 
+#include <stddef.h>
 #include <bootutil/sign_key.h>
 #include "mcuboot_config/mcuboot_config.h"
+#include "platform/include/tfm_plat_crypto_keys.h"
 
 #if !defined(MCUBOOT_HW_KEY)
 #if defined(MCUBOOT_SIGN_RSA)
@@ -246,4 +248,13 @@
     },
 };
 const int bootutil_key_cnt = 1;
-#endif
+
+int boot_retrieve_public_key_hash(uint8_t image_index,
+                                  uint8_t *public_key_hash,
+                                  size_t *key_hash_size)
+{
+    return tfm_plat_get_rotpk_hash(image_index,
+                                   public_key_hash,
+                                   (uint32_t *)key_hash_size);
+}
+#endif /* !MCUBOOT_HW_KEY */