Effects of porosity in a model of corrosion and passive layer growth