Closed Bug 161215 Opened 23 years ago Closed 23 years ago

Implement quick DER decoder

Categories

(NSS :: Libraries, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julien.pierre, Assigned: julien.pierre)

References

Details

Attachments

(3 files, 1 obsolete file)

The ASN.1 DER decoder was shown to perform too many memory allocations which made performance unbearably slow. Bug # 149816 has more details.
Priority: -- → P1
Target Milestone: --- → 3.6
Updated after Wan-Teh's review This still needs to be reviewed for functional correctness by someone knowledgeable of ASN.1 and our templates, in particular MatchItemType and DecodeItem .
Blocks: 149816
Checked in the new decoder to the NSS 3.6 tip . Checking in manifest.mn; /cvsroot/mozilla/security/nss/lib/util/manifest.mn,v <-- manifest.mn new revision: 1.8; previous revision: 1.7 done RCS file: /cvsroot/mozilla/security/nss/lib/util/quickder.c,v done Checking in quickder.c; /cvsroot/mozilla/security/nss/lib/util/quickder.c,v <-- quickder.c initial revision: 1.1 done RCS file: /cvsroot/mozilla/security/nss/lib/util/quickder.h,v done Checking in quickder.h; /cvsroot/mozilla/security/nss/lib/util/quickder.h,v <-- quickder.h initial revision: 1.1 done Checking in secasn1t.h; /cvsroot/mozilla/security/nss/lib/util/secasn1t.h,v <-- secasn1t.h new revision: 1.6; previous revision: 1.5 done Checking in secerr.h; /cvsroot/mozilla/security/nss/lib/util/secerr.h,v <-- secerr.h new revision: 1.5; previous revision: 1.4 done Checking in nss.def; /cvsroot/mozilla/security/nss/lib/nss/nss.def,v <-- nss.def new revision: 1.75; previous revision: 1.74 done
1) fixed handling of handling of SEC_ASN1_CHOICE, thanks to Terry 2) fixed handling of implicit tagging 3) optimized the two allocations for the array and items in DecodeGroup into a single one 4) add type checking for SEC_ASN1_INLINE | SEC_ASN1_OPTIONAL as well as SEC_ASN1_POINTER | SEC_ASN1_OPTIONAL 5) add type checking for SEC_ASN1_CHOICE even when not decoding, in particular if the parent is SEC_ASN1_OPTIONAL (see 4), so that choices can be optional and/or skipped
Attachment #94121 - Attachment is obsolete: true
It might be a good idea to just declare SEC_QuickDERDecodeItem in the existing secasn1.h header and do away with the quickder.h header.
Assignee: wtc → jpierre
Many thanks to Terry for the extensive code review. I have incorporated the feedback into the source tree. Closing this bug.
Status: NEW → RESOLVED
Closed: 23 years ago
Depends on: 83247
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: