I have stored ammo in the garage, the shed, the attic, etc. for up to 25 years. Even the stuff in the hot summer/cold winter attic shot fine.
As for the firearms, again, stored in the attic, in the rifle/shotgun cases for up to 8 years (longest I went without getting them down and wiping them off again) with no sign of rust. I just make sure I put a good coat of oil (3n1 oil was what I used back then) on the outside surfaces and in the barrel/chamber and then don't touch the metal with your bare skin when putting it in the case.
We, my family, never had issues with rust on our hunting guns following the "no touch" rule. My father-in-law, on the other hand, would blame his rust issues on spider shit, my mother-in-law moving them to vacuum the carpet (kept some of them in the corner behind the TV till he got a gun cabinet at the end of the hallway) or "someone" visiting the house handling them.