Closed
Bug 51882
Opened 25 years ago
Closed 25 years ago
NSS_CMSSignedData_CreateCertsOnly not working as expected
Categories
(NSS :: Libraries, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
3.1
People
(Reporter: savri, Assigned: bugz)
References
Details
> I tried debugging the creating of 'certsonly'. If I don't set
> signer info, NSS_CMSSignedData_Encode_BeforeStart(NSSCMSSignedData *sigd)
> called by NSS_CMSMessage_Encoder_start, bails out while executing the
follwoing code :
> /* prepare all the SignerInfos */
> for (i = 0; signerinfos[i] != NULL; i++) {
> signerinfo = signerinfos[i];
>
> Since there is no signer info.
That's a bug. It should handle this gracefully. There should be an "if
(signerinfos)" around this code.
> However, if I set the signer info, NSS_CMSSignedData_Encode_AfterData,
> called by Encoder_Finish, bails out while trying to handle the digests
> because there are NO digests since there is no data.
>
> /* prepare all the SignerInfos */
> for (i = 0; signerinfos[i] != NULL; i++) {
> signerinfo = signerinfos[i];
>
> /* find correct digest for this signerinfo */
> digestalgtag = NSS_CMSSignerInfo_GetDigestAlgTag(signerinfo);
> n = NSS_CMSAlgArray_GetIndexByAlgTag(sigd->digestAlgorithms,
digestalgta
> g);
> if (n < 0 || sigd->digests == NULL || sigd->digests[n] == NULL) {
> /* oops - digest not found */
> PORT_SetError(SEC_ERROR_DIGEST_NOT_FOUND);
> goto loser;
> ------------ Executes the above lines -----------------
That's another bug. The code should handle these special cases.
Christian
*** Bug 51883 has been marked as a duplicate of this bug. ***
| Assignee | ||
Comment 2•25 years ago
|
||
changing to ASSIGNED so it shows up in my buglist
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
| Assignee | ||
Comment 3•25 years ago
|
||
Checked in change to cmssigdata.c that should fix bug. Asavari - since you have
your code set up, can you test this? I'm leaving it as new bug until you let me
know if it's okay.
| Assignee | ||
Updated•25 years ago
|
Target Milestone: --- → 3.2
| Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Target Milestone: 3.2 → 3.1
| Assignee | ||
Comment 4•25 years ago
|
||
this was fixed and became part of the NSS tests by 3.1.
You need to log in
before you can comment on or make changes to this bug.
Description
•