It is possible (and I am personally inclined to believe) that skullduggery was involved in the 1958 conclave. The Church does not declare pontifical reigns invalid because of skullduggery. Examples abound in Church history. Particularly amusing is the history of the papacy during the 1040's:
1044: Benedict IX (who obtained the Papal office through bribes in 1032) is chased from Rome by its citizens.
Jan. 1045: Sylvester III is elected.
March 1045: Benedict IX returns to Rome and deposes Sylvester III.
May 1045: Benedict IX sells the office to Gregory VI.
1046: Gregory VI resigns and is replaced by Clement II.
1047: Benedict IX again seizes the throne upon the death of Clement II.
1048: Benedict IX is driven from Rome by the German emperor, to be replaced by Damasus II.
Plenty of material is here to raise doubts about the validity of the beginnings of endings of various pontificates, yet each one is recognized by the Church and is listed in the Annuario Pontificio, including all three reigns of Benedict IX.
Assuming one day one of the various conjectures concerning Cardinal Siri were proved true, the Church would still recognize the pontificate of John XXIII.