PORT_Assert(poolp); PORT_Assert(sigd); if (!sigd || !poolp) { PORT_SetError(SEC_ERROR_LIBRARY_FAILURE); return SECFailure; }
NSS_CMSSignedData_AddDigest(PRArenaPool *poolp,				NSSCMSSignedData *sigd,				SECOidTag digestalgtag,				SECItem *digest){    SECAlgorithmID *digestalg;    void *mark;    mark = PORT_ArenaMark(poolp);    digestalg = PORT_ArenaZAlloc(poolp, sizeof(SECAlgorithmID));    if (digestalg == NULL)	goto loser;    if (SECOID_SetAlgorithmID (poolp, digestalg, digestalgtag, NULL) != SECSuccess) /* no params */	goto loser;    if (NSS_CMSArray_Add(poolp, (void ***)&(sigd->digestAlgorithms), (void *)digestalg) != SECSuccess ||	/* even if digest is NULL, add dummy to have same-size array */	NSS_CMSArray_Add(poolp, (void ***)&(sigd->digests), (void *)digest) != SECSuccess)    {	goto loser;    }    PORT_ArenaUnmark(poolp, mark);    return SECSuccess;loser:    PORT_ArenaRelease(poolp, mark);    return SECFailure;}