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); }