Corrosion and passivation of magnesium alloys