From 2d5868b4e0ffb3553089c9002f47e0ea22a67f4c Mon Sep 17 00:00:00 2001 From: Janis Danisevskis Date: Sun, 31 Jan 2021 12:33:21 -0800 Subject: [PATCH] Keymint Support: Fix keymint_tags.h authorizationValue checked the uion value tag twice instead of checking the actual tag value. Test: N/A Change-Id: I348b5ac06801a04ca7243088d758374148910d39 --- .../keymint/support/include/keymint_support/keymint_tags.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/security/keymint/support/include/keymint_support/keymint_tags.h b/security/keymint/support/include/keymint_support/keymint_tags.h index 8d2fe28b9b..43cfb63a2f 100644 --- a/security/keymint/support/include/keymint_support/keymint_tags.h +++ b/security/keymint/support/include/keymint_support/keymint_tags.h @@ -326,7 +326,9 @@ template inline std::optional< std::reference_wrapper>::type>> authorizationValue(TypedTag ttag, const KeyParameter& param) { - if (TypedTag2ValueType>::unionTag != param.value.getTag()) return {}; + // We only check if the parameter has the correct tag here; accessTagValue checks if the correct + // union field was initialized. + if (tag != param.tag) return {}; return accessTagValue(ttag, param); }