Here’s what Canon Law says:
Can. 1156 ß1 To validate a marriage which is invalid because of a diriment impediment, it is required that the impediment cease or be dispensed, and that at least the party aware of the impediment renews consent.
ß2 This renewal is required by ecclesiastical law for the validity of the validation, even if at the beginning both parties had given consent and had not afterwards withdrawn it.
Can. 1157 The renewal of consent must be a new act of will consenting to a marriage which the renewing party knows or thinks was invalid from the beginning.
Can. 1158 ß1 If the impediment is public, consent is to be renewed by both parties in the canonical form, without prejudice to the provision of Can. 1127 ß3.
ß2 If the impediment cannot be proved, it is sufficient that consent be renewed privately and in secret, specifically by the party who is aware of the impediment provided the other party persists in the consent given, or by both parties if the impediment is known to both.
Can. 1159 ß1 A marriage invalid because of a defect of consent is validated if the party who did not consent, now does consent, provided the consent given by the other party persists.
2‚ If the defect of the consent cannot be proven, it is sufficient that the party who did not consent, gives consent privately and in secret.
ß3 If the defect of consent can be proven, it is necessary that consent be given in the canonical form.
Can. 1160 For a marriage which is invalid because of defect of form to become valid, it must be contracted anew in the canonical form, without prejudice to the provisions of Can. 1127 ß3 [4] .
ARTICLE 2: RETROACTIVE VALIDATION
Can. 1161 ß1 The retroactive validation of an invalid marriage is its validation without the renewal of consent, granted by the competent authority. It involves a dispensation from an impediment if there is one and from the canonical form if it had not been observed, as well as a referral back to the past of the canonical effects.
ß2 The validation takes place from the moment the favor is granted; the referral back, however, is understood to have been made to the moment the marriage was celebrated, unless it is otherwise expressly provided.
ß3 A retroactive validation is not to be granted unless it is probable that the parties intend to persevere in conjugal life.
Can. 1162 ß1 If consent is lacking in either or both of the parties, a marriage cannot be rectified by a retroactive validation, whether consent was absent from the beginning or, though given at the beginning, was subsequently revoked.
ß2 If the consent was indeed absent from the beginning but was subsequently given, a retroactive validation can be granted from the moment the consent was given.
Can. 1163 ß1 A marriage which is invalid because of an impediment or because of defect of the legal form, can be validated retroactively, provided the consent of both parties persists.
ß2 A marriage which is invalid because of an impediment of the natural law or of the divine positive law, can be validated retroactively only after the impediment has ceased.
Can. 1164 A retroactive validation may validly be granted even if one or both of the parties is unaware of it; it is not, however, to be granted except for a grave reason.
Can. 1165 ß1 Retroactive validation can be granted by the Apostolic See.
ß2 It can be granted by the diocesan Bishop in individual cases, even if a number of reasons for nullity occur together in the same marriage, assuming that for a retroactive validation of a mixed marriage the conditions of Can. 1125 will have been fulfilled. It cannot, however, be granted by him if there is an impediment whose dispensation is reserved to the Apostolic See in accordance with Can. 1078 ß2, or if there is question of an impediment of the natural law or of the divine positive law which has now ceased.