Justices uphold a ban on aiding terror groups