Author: Javier Martinez Canillas <javierm(a)redhat.com>
Date: 2017-11-28 (Tue, 28 Nov 2017)
lib: mask TPM_RC to only get the bits set by the TPM
The TPM only uses the lower 12 bits from the 32 bits of TPM_RC, the other
layers uses some of the higher unused 20 bits to indicate from which layer
of the stack the error comes from.
So mask the low-order 12 bits of the TPM_RC variable instead comparing TPM
response codes directly. There's no need to mask when the check is against
TPM_RC_SUCCESS, since in this case the upper 20 bits are going to be zero.
Signed-off-by: Javier Martinez Canillas <javierm(a)redhat.com>