(murena) avb: add murena public key

Change-Id: If1f1f3b6f861bdb124d737418c8396829dc4b1aa
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
diff --git a/AndroidBoot.mk b/AndroidBoot.mk
index 7bf0170..85fb1d8 100644
--- a/AndroidBoot.mk
+++ b/AndroidBoot.mk
@@ -84,6 +84,7 @@
 else
 	BOARD_BOOTLOADER_VERSION := unknown
 endif
+BOARD_BOOTLOADER_VERSION := $(BOARD_BOOTLOADER_VERSION)-murena
 
 ifneq ($(TARGET_BOARD_TYPE),auto)
 	TARGET_BOARD_TYPE_AUTO := TARGET_BOARD_TYPE_AUTO=0
diff --git a/QcomModulePkg/Library/avb/OEMPublicKey.h b/QcomModulePkg/Library/avb/OEMPublicKey.h
index a0e7f52..09d1f2c 100644
--- a/QcomModulePkg/Library/avb/OEMPublicKey.h
+++ b/QcomModulePkg/Library/avb/OEMPublicKey.h
@@ -101,4 +101,101 @@
 0xa2,0x61,0x2c,0xf9,0x6f,0xf4,0xf3,0xb7
 };
 
+static const char MurenaPublicKey[] = {
+	0x00, 0x00, 0x10, 0x00, 0xb8, 0x0b, 0xfd, 0x49, 0xb6, 0x3d, 0xe2,
+	0x49, 0xb0, 0x82, 0xf2, 0x03, 0xe1, 0xe3, 0xbf, 0xce, 0xb2, 0xd9,
+	0xe9, 0xb2, 0x04, 0xd7, 0xe8, 0xa5, 0x81, 0x49, 0xa7, 0x62, 0xe8,
+	0x12, 0xf3, 0xa3, 0x1c, 0x28, 0xca, 0x28, 0x85, 0x06, 0x3f, 0xf0,
+	0x2d, 0x34, 0x76, 0x8d, 0x75, 0x35, 0x72, 0x71, 0xc9, 0x9b, 0xe2,
+	0x74, 0x69, 0x08, 0x72, 0x69, 0xac, 0x39, 0xff, 0xf9, 0xd3, 0xb4,
+	0xa1, 0x66, 0xb5, 0x93, 0x8f, 0xe0, 0xe5, 0x76, 0x97, 0x0b, 0x5a,
+	0xeb, 0x8d, 0x43, 0x74, 0xcd, 0xc3, 0x02, 0x53,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 0x94, 0x07, 0x51, 0xaf, 0xff, 0xa2, 0x6f, 0xcc,
+	0x56, 0x5f, 0x3f, 0x22, 0xcb, 0xf8, 0xa5, 0x6a, 0x20, 0x2d, 0x3c,
+	0x83, 0x65, 0x1b, 0x8d, 0x6b, 0xa8, 0x6f, 0x4d, 0xe3, 0x10, 0x08,
+	0x92, 0xa2, 0xd4, 0x63, 0xe8, 0xa8, 0xb1, 0xe3, 0x66, 0xb2, 0x1a,
+	0x59, 0x23, 0xdb, 0xe0, 0xb6, 0xf9, 0x7b, 0xf1, 0xf0
+};
+
 #endif /* __OEM_PUBLIC_KEY_H__ */
diff --git a/QcomModulePkg/Library/avb/libavb/avb_ops.c b/QcomModulePkg/Library/avb/libavb/avb_ops.c
index fd5c828..24a2c63 100644
--- a/QcomModulePkg/Library/avb/libavb/avb_ops.c
+++ b/QcomModulePkg/Library/avb/libavb/avb_ops.c
@@ -352,6 +352,9 @@
 	} else if (PublicKeyLength == ARRAY_SIZE(OEMPublicKey) &&
 	           CompareMem(PublicKeyData, OEMPublicKey, PublicKeyLength) == 0) {
 		*OutIsTrusted = true;
+	} else if (PublicKeyLength == ARRAY_SIZE(MurenaPublicKey) &&
+	           CompareMem(PublicKeyData, MurenaPublicKey, PublicKeyLength) == 0) {
+		*OutIsTrusted = true;
 	} else {
 		*OutIsTrusted = false;
 		SetMem(UserData->PublicKey, ARRAY_SIZE(UserData->PublicKey), 0);
@@ -411,6 +414,9 @@
         } else if (PublicKeyLength == ARRAY_SIZE (OEMPublicKey) &&
 	           CompareMem(PublicKeyData, OEMPublicKey, PublicKeyLength) == 0) {
 		*OutIsTrusted = true;
+        } else if (PublicKeyLength == ARRAY_SIZE (MurenaPublicKey) &&
+	           CompareMem(PublicKeyData, MurenaPublicKey, PublicKeyLength) == 0) {
+		*OutIsTrusted = true;
 	} else {
 		*OutIsTrusted = false;
                 SetMem (UserData->PublicKey,