Closed Bug 1297357 Opened 3 years ago Closed 4 months ago

nsNSSCertificateDB::AddCert() unnecessarily Base64 encodes its input

Categories

(Core :: Security: PSM, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: Cykesiopka, Assigned: mbirghan)

References

()

Details

(Whiteboard: [psm-cleanup])

Attachments

(1 file)

nsNSSCertificateDB::AddCert() (the implementation of addCert() defined in nsIX509CertDB.idl) is supposed to "Add a cert to [the] cert DB from a binary [DER] string". Currently, AddCert() simply takes the given DER input, encodes it to Base64, then calls nsNSSCertificateDB::AddCertFromBase64() to do the remaining work.

While this works, it's not very logical since AddCertFromBase64() eventually decodes the given Base64 input back to DER.

The method should be updated to avoid this unnecessary work.
Assignee: nobody → mbirghan
Attachment #9077414 - Attachment description: Bug 1297357 - Switched work from nsNSSCertificateDB::AddCertFromBase64() to nsNSSCertificateDB::AddCert(). r=keeler → Bug 1297357 - Switch work from nsNSSCertificateDB::AddCertFromBase64() to nsNSSCertificateDB::AddCert(). r=keeler

Moritz - this is ready to land, but it looks like the commit doesn't have the authorship information set up correctly - see https://wiki.mozilla.org/Phabricator/FAQ#Lando for more details.

Flags: needinfo?(mbirghan)

I have edited my authorship information and resubmitted.

Flags: needinfo?(mbirghan)
Pushed by dkeeler@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d6ddac3b94da
Switch work from nsNSSCertificateDB::AddCertFromBase64() to nsNSSCertificateDB::AddCert(). r=keeler
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.