I would recommend less sidewall for the 02-05 WRX, especially compared to the late model years with taller tires. The EJ205 is fairly laggy and shorter tires help reduce gearing. 235/40R17 is in my opinion the optimal tire size for the 02-07 WRX sedan. The 2011 WRX wheels are fine for that size and have a nice offset (though a little heavy). I would try to avoid using the stock 2011 WRX tires on an 02-07 WRX if you can. If the 02-05 WRX's suspension is stock the tire size should not cause any rubbing, but it's not ideal.
The 04-07 STi has much shorter gearing and benefits greatly from the taller 235/45R17 tire. Different gearing, different answer.
2015 STi: Still Stock
04 STi, 04 WRX: SOLD