Classified material shows U.S. eavesdrops on allies as well as enemies