[DUP-2] enrollment.ex vs renewal.ex share ~135 lines of byte-identical functions, plus a third copy inside renewal itself #37
Labels
No labels
architecture
code-quality
correctness
critical
docs
high
low
medium
ops
performance
privacy
security
tests
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
antrapol/CA-MDID-eMudhra#37
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
parse_csr,verify_csr,get_sub_ca,build_leaf_owner,generate_leaf_cert(differs only in default validity),extract_ic_number/fullname/issuer_cn,copy_subject_field/values,copy_state_or_localityare duplicated; renewal additionally duplicates the cert pipeline a third time (generate_leaf_certvsgenerate_renewal_cert) and the request-builder struct copy twice.Evidence
lib/mdid_ws/cert_management/enrollment.ex:64-120, 178-337vsrenewal.ex:56-151, 235-263, 508-549, 581-612, 614-645Impact
The historical Sub-CA public-key bug had to be fixed twice for exactly this reason; ~170 removable lines.
Fix
Line numbers refer to the initial import commit
282cb11. Source: comprehensive audit, 2026-11-12 (first review of this codebase).Verified fixed on main (
1b6216b): enrollment and renewal share LeafIssuer (B6, PR #59).