The government is examining the legality of the ferry firm’s actions, the chancellor confirms.