Cardinals are appointed by the Bishop of Rome and they are, technically, Roman clergy. They obtain titular churches in the diocese of Rome, or titular dioceses in the suburbs of Rome. The case of Cardinal Patriarchs is a little different, but you can see their close association with the Roman Pontiff by their arms, which bears the tiara. It was, in antiquity, the job of the Roman clergy to elect a Bishop of Rome. That’s what they do today. NB: Not all the clergy of Rome vote, but only the designated “hinge-men” who are electors (“cardinal” comes from the Latin word for “hinge”, cardo).
If Francis was at the very least only the Bishop of Rome all these years, he could create cardinals. The College of Cardinals (divided into three orders of bishop, priest and deacon) don’t have to be consecrated as bishops. They usually are now, but not necessarily. This distinguishes the College of Cardinals from the College of Bishops, which seems more strictly related to the Successor of Peter as Vicar of Christ rather than Successor of Peter as Bishop of Rome.
Moreover, while examples don’t immediately spring to mind as I type, I believe there were cardinals created by antipopes who were later accepted as cardinals who could vote for a legitimate Pope (again, “Pope” being a complicated office that comprises Vicar of Christ and Bishop of Rome – and for a long time now the head of a state – in one person who is Successor of Peter).
All of this is to argue that, like Francis or not, think we wasn’t the legitimate POPE or that he was, it is pretty clear that he could rightly name cardinals.
It is precisely the role of cardinals to elect popes.
Ergo, we don’t have to worry about the legitimacy of the Electors.