Skip to content

Commit

Permalink
Add patch to prevent shift-count-overflow error
Browse files Browse the repository at this point in the history
  • Loading branch information
Einhornhool committed Jul 5, 2022
1 parent fd597cf commit baa6b07
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pkg/cryptoauthlib/patches/0003-Cast-DEVICE_MASK-to-32-bit.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 33e403483a2eb3ce299949762dad636ddff07212 Mon Sep 17 00:00:00 2001
From: Lena Boeckmann <lena.boeckmann@haw-hamburg.de>
Date: Tue, 5 Jul 2022 16:00:27 +0200
Subject: [PATCH] Cast DEVICE_MASK to 32 bit

---
test/atca_test.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/atca_test.h b/test/atca_test.h
index fbf9be02..f3ec11fe 100644
--- a/test/atca_test.h
+++ b/test/atca_test.h
@@ -58,7 +58,7 @@ typedef struct
fp_menu_handler fp_handler;
} t_menu_info;

-#define DEVICE_MASK(device) ((uint8_t)1 << device)
+#define DEVICE_MASK(device) ((uint32_t)1 << device)
#define REGISTER_TEST_CASE(group, name) TEST_ ## group ## _ ## name ## _run

#define DEVICE_MASK_ECC (DEVICE_MASK(ATECC108A) | DEVICE_MASK(ATECC508A) | DEVICE_MASK(ATECC608))
--
2.37.0

0 comments on commit baa6b07

Please sign in to comment.