In the clearest indication yet of how he intends to confront Senator Barack Obama on foreign policy issues in the general election , Senator John McCain on Friday again portrayed the Democratic contender as being the favorite of Hamas , the militant Palestinian group , and implied that he would also be friendly with Iran , a Hamas ally .