NSS_CMSSignedData_CreateCertsOnly doesn't work

VERIFIED DUPLICATE of bug 51882

Status

P3
major
VERIFIED DUPLICATE of bug 51882
18 years ago
18 years ago

People

(Reporter: savri, Assigned: bugz)

Tracking

Sun
Solaris

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
Asavari Ukidve wrote:
>    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

*** This bug has been marked as a duplicate of 51882 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → DUPLICATE

Comment 2

18 years ago
Verified dupe of bug 51882 (same bug, same reporter, same comments....)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.