From 8f4fe24929feda77826880d8a2deacd7fc9b95ac Mon Sep 17 00:00:00 2001 From: Pete Bentley Date: Fri, 10 Mar 2023 14:22:47 +0000 Subject: Change masked_tag() return type to match BoringSSL change. Did some static analysis and this seems quite safe, this method casts a fixed size type to the API type expected by BoringSSL, which is now int on both 32 and 64 bit build. Test: atest keymaster_tests Change-Id: Ia4cd71464cf232ce9e7946aaa7215ef1d79070e1 --- include/keymaster/keymaster_tags.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/keymaster/keymaster_tags.h b/include/keymaster/keymaster_tags.h index e8188e8..29eae7c 100644 --- a/include/keymaster/keymaster_tags.h +++ b/include/keymaster/keymaster_tags.h @@ -108,7 +108,7 @@ template class TypedTag { // NOLINTNEXTLINE(google-explicit-constructor) inline operator keymaster_tag_t() { return tag; } // NOLINTNEXTLINE(google-runtime-int) - inline long masked_tag() { return static_cast(keymaster_tag_mask_type(tag)); } + inline int masked_tag() { return static_cast(keymaster_tag_mask_type(tag)); } }; template @@ -126,7 +126,7 @@ class TypedEnumTag { // NOLINTNEXTLINE(google-explicit-constructor) inline operator keymaster_tag_t() { return tag; } // NOLINTNEXTLINE(google-runtime-int) - inline long masked_tag() { return static_cast(keymaster_tag_mask_type(tag)); } + inline int masked_tag() { return static_cast(keymaster_tag_mask_type(tag)); } }; #ifdef KEYMASTER_NAME_TAGS -- cgit v1.2.3