summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Bentley <prb@google.com>2023-03-10 14:22:47 +0000
committerPete Bentley <prb@google.com>2023-03-10 15:09:16 +0000
commit8f4fe24929feda77826880d8a2deacd7fc9b95ac (patch)
tree08d227e3b1c7ef976133211beec46c34384edfe3
parente5fb9054314a2a04b209402abc6e1df071cbbfe2 (diff)
downloadkeymaster-8f4fe24929feda77826880d8a2deacd7fc9b95ac.tar.gz
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
-rw-r--r--include/keymaster/keymaster_tags.h4
1 files 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 <keymaster_tag_type_t tag_type, keymaster_tag_t tag> class TypedTag {
// NOLINTNEXTLINE(google-explicit-constructor)
inline operator keymaster_tag_t() { return tag; }
// NOLINTNEXTLINE(google-runtime-int)
- inline long masked_tag() { return static_cast<long>(keymaster_tag_mask_type(tag)); }
+ inline int masked_tag() { return static_cast<int>(keymaster_tag_mask_type(tag)); }
};
template <keymaster_tag_type_t tag_type, keymaster_tag_t tag, typename KeymasterEnum>
@@ -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<long>(keymaster_tag_mask_type(tag)); }
+ inline int masked_tag() { return static_cast<int>(keymaster_tag_mask_type(tag)); }
};
#ifdef KEYMASTER_NAME_TAGS