Closed Bug 1653029 Opened 5 years ago Closed 5 years ago

avoid passing NSS types to RootCABinNumber

Categories

(Core :: Security: PSM, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: keeler, Assigned: keeler)

References

(Blocks 1 open bug)

Details

(Whiteboard: [psm-assigned])

Attachments

(1 file)

To avoid using NSS types unnecessarily in PSM, we should use Span<uint8_t> instead of SECItem and PK11_FindEncodedCertInSlot instead of passing a PK11SlotInfo (which would require having a CERTCertificate).

PSM internals are currently tightly-copuled with NSS data types. In many cases
this is unnecessary, because PSM often needs only a sequence of bytes (in the
case of certificates, for example). This tight coupling can also have
performance and architectural impacts. For example, thread contention for NSS
resources has caused performance issues in the past. This patch starts the
process of avoiding using these types as much as possible in PSM.

More specifically, RootCABinNumber can take a Span<uint8_t> instead of a
SECItem. Instead of taking a PK11SlotInfo (which essentially requires having a
CERTCertificate), we can use PK11_FindEncodedCertInSlot to see if the
certificate exists on a small number of specific slots to achieve the same
effect as before. Doing this should eventually allow us to avoid creating a
CERTCertificate, which implicitly involves searching all slots on all modules.

Pushed by dkeeler@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5ecde4077049 pass a span of bytes to RootCABinNumber instead of NSS types r=rmf,kjacobs
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
Blocks: 1664048
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: