/* If AuthenticationOperation is not recongnized, return FALSE. If AuthenticationOperation is EFI_AUTH_OPERATION_NONE, return FALSE. If AuthenticationOperation includes security operation and authentication operation, return FALSE. If the previous register handler can't be executed before the later register handler, return FALSE. */
BOOLEAN CheckAuthentication2Operation(IN UINT32 CurrentAuthOperation, IN UINT32 CheckAuthOperation)
/* If AuthenticationOperation is not recongnized, return FALSE. If AuthenticationOperation is EFI_AUTH_OPERATION_NONE, return FALSE. If AuthenticationOperation includes security operation and authentication operation, return FALSE. If the previous register handler can't be executed before the later register handler, return FALSE. */
BOOLEAN CheckAuthentication2Operation(IN UINT32 CurrentAuthOperation, IN UINT32 CheckAuthOperation)
{
  if (CheckAuthOperation == EFI_AUTH_OPERATION_NONE) {
    return FALSE;
  }
  if ((CheckAuthOperation & ~(EFI_AUTH_IMAGE_OPERATION_MASK |
                              EFI_AUTH_NONE_IMAGE_OPERATION_MASK |
                              EFI_AUTH_OPERATION_IMAGE_REQUIRED)) != 0)
  {
    return FALSE;
  }
  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) == 0))
    {
      return TRUE;
    } else {
      return FALSE;
    }
  }
  return TRUE;
}