Merge "Keymint Support: Fix keymint_tags.h" am: 736d935157

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1566354

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I200b84b3267971ce38e681b2f3de5db1b22d5e3b
This commit is contained in:
Janis Danisevskis
2021-02-01 16:42:52 +00:00
committed by Automerger Merge Worker

View File

@@ -326,7 +326,9 @@ template <TagType tag_type, Tag tag>
inline std::optional<
std::reference_wrapper<const typename TypedTag2ValueType<TypedTag<tag_type, tag>>::type>>
authorizationValue(TypedTag<tag_type, tag> ttag, const KeyParameter& param) {
if (TypedTag2ValueType<TypedTag<tag_type, tag>>::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);
}