Closed
Bug 1608745
Opened 5 years ago
Closed 5 years ago
Repetitive code in ProcessCrlDistPoints
Categories
(Core :: Security: PSM, task)
Tracking
()
RESOLVED
WONTFIX
Tracking | Status | |
---|---|---|
firefox74 | --- | wontfix |
People
(Reporter: alexhenrie24, Assigned: alexhenrie24)
Details
Attachments
(1 file)
Since before the switch to Mercurial in 2007, ProcessCrlDistPoints has had (with minor changes) the following lengthy and repetitive chunk of code:
bool comma = false;
if (reasons & RF_UNUSED) {
GetPIPNSSBundleString("CertDumpUnused", local);
text.Append(local);
comma = true;
}
if (reasons & RF_KEY_COMPROMISE) {
if (comma) text.AppendLiteral(", ");
GetPIPNSSBundleString("CertDumpKeyCompromise", local);
text.Append(local);
comma = true;
}
if (reasons & RF_CA_COMPROMISE) {
if (comma) text.AppendLiteral(", ");
GetPIPNSSBundleString("CertDumpCACompromise", local);
text.Append(local);
comma = true;
}
if (reasons & RF_AFFILIATION_CHANGED) {
if (comma) text.AppendLiteral(", ");
GetPIPNSSBundleString("CertDumpAffiliationChanged", local);
text.Append(local);
comma = true;
}
if (reasons & RF_SUPERSEDED) {
if (comma) text.AppendLiteral(", ");
GetPIPNSSBundleString("CertDumpSuperseded", local);
text.Append(local);
comma = true;
}
if (reasons & RF_CESSATION_OF_OPERATION) {
if (comma) text.AppendLiteral(", ");
GetPIPNSSBundleString("CertDumpCessation", local);
text.Append(local);
comma = true;
}
if (reasons & RF_CERTIFICATE_HOLD) {
if (comma) text.AppendLiteral(", ");
GetPIPNSSBundleString("CertDumpHold", local);
text.Append(local);
comma = true;
}
This should all be replaced with a loop to improve code readability and performance, and to make refactoring it easier in the future.
Assignee | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Assignee: nobody → alexhenrie24
Status: NEW → ASSIGNED
Updated•5 years ago
|
Component: Security → Security: PSM
Updated•5 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
Updated•5 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•