commit | 24a732cd14e4bdbe95e47d48d286a4a666a1d8c0 | [log] [tgz] |
---|---|---|
author | Janis Danisevskis <jdanis@google.com> | Mon Feb 01 18:00:31 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Feb 01 18:00:31 2021 +0000 |
tree | a9dcf655750304d97ae30ec566d00e182080e105 | |
parent | 033cc9a374981a917d14fad3cac305b06b6f996f [diff] | |
parent | 8c49bc611e816da8eb1f2b24ba1766b4a0c02765 [diff] |
Merge "Keymint Support: Fix keymint_tags.h" am: 736d935157 am: 3686d22043 am: 8c49bc611e Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1566354 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I27fbdcc6dcf21681f01f5be11677a83bd9470225
diff --git a/security/keymint/support/include/keymint_support/keymint_tags.h b/security/keymint/support/include/keymint_support/keymint_tags.h index 8d2fe28..43cfb63 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 @@ 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); }