/* Check whether an operation is valid according to the requirement of current operation, which must make sure that the measure image operation is the last one. */
BOOLEAN CheckAuthenticationOperation(IN UINT32 CurrentAuthOperation, IN UINT32 CheckAuthOperation)
/* Check whether an operation is valid according to the requirement of current operation, which must make sure that the measure image operation is the last one. */
BOOLEAN CheckAuthenticationOperation(IN UINT32 CurrentAuthOperation, IN UINT32 CheckAuthOperation)
{
  ASSERT ((CheckAuthOperation & ~(EFI_AUTH_IMAGE_OPERATION_MASK | EFI_AUTH_OPERATION_AUTHENTICATION_STATE | EFI_AUTH_OPERATION_IMAGE_REQUIRED)) == 0);
  if ((CurrentAuthOperation & EFI_AUTH_OPERATION_MEASURE_IMAGE) == EFI_AUTH_OPERATION_MEASURE_IMAGE) {
    if (((CheckAuthOperation & EFI_AUTH_OPERATION_MEASURE_IMAGE) == EFI_AUTH_OPERATION_MEASURE_IMAGE) ||
        ((CheckAuthOperation & EFI_AUTH_IMAGE_OPERATION_MASK) == EFI_AUTH_OPERATION_NONE))
    {
      return TRUE;
    } else {
      return FALSE;
    }
  }
  return TRUE;
}