Mechanism of the formation of peracetic acid
You are not too far off. It is somewhat of a mixture of the two mechanisms you proposed. The carbonyl oxygen is much more basic than the non-carbonyl oxygen and will be protonated preferentially. Then hydrogen peroxide can attack, and once the tetrahedral intermediate collapses, deprotonation yields peracetic acid.