rv =  cert_check_crl_version (&crl->crl); if (rv != SECSuccess) {
rv =  cert_check_crl_version (&crl->crl); if (rv != SECSuccess) { extended->badExtensions = PR_TRUE; break; }  if (PR_TRUE == extended->partial) {  break; }  rv = cert_check_crl_entries(&crl->crl); if (rv != SECSuccess) {
CERT_DecodeDERCrlWithFlags(PRArenaPool *narena, SECItem *derSignedCrl,                          int type, PRInt32 options){    PRArenaPool *arena;    CERTSignedCrl *crl;    SECStatus rv;    OpaqueCRLFields* extended = NULL;    const SEC_ASN1Template* crlTemplate = cert_SignedCrlTemplate;    /* make a new arena */    if (narena == NULL) {    	arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);	if ( !arena ) {	    return NULL;	}    } else {	arena = narena;    }    /* allocate the CRL structure */    crl = (CERTSignedCrl *)PORT_ArenaZAlloc(arena, sizeof(CERTSignedCrl));    if ( !crl ) {        PORT_SetError(SEC_ERROR_NO_MEMORY);	goto loser;    }    crl->arena = arena;    /* allocate opaque fields */    crl->opaque = (void*)PORT_ArenaZAlloc(arena, sizeof(OpaqueCRLFields));    if ( !crl->opaque ) {	goto loser;    }    extended = (OpaqueCRLFields*) crl->opaque;    if (options & CRL_DECODE_DONT_COPY_DER) {        crl->derCrl = derSignedCrl; /* DER is not copied . The application                                       must keep derSignedCrl until it                                       destroys the CRL */    } else {        crl->derCrl = (SECItem *)PORT_ArenaZAlloc(arena,sizeof(SECItem));        if (crl->derCrl == NULL) {            goto loser;        }        rv = SECITEM_CopyItem(arena, crl->derCrl, derSignedCrl);        if (rv != SECSuccess) {            goto loser;        }    }    /* Save the arena in the inner crl for CRL extensions support */    crl->crl.arena = arena;    if (options & CRL_DECODE_SKIP_ENTRIES) {        crlTemplate = cert_SignedCrlTemplateNoEntries;        extended->partial = PR_TRUE;    }    /* decode the CRL info */    switch (type) {    case SEC_CRL_TYPE:        rv = SEC_QuickDERDecodeItem(arena, crl, crlTemplate, crl->derCrl);	if (rv != SECSuccess) {            extended->badDER = PR_TRUE;            break;        }        /* check for critical extentions */	rv =  cert_check_crl_version (&crl->crl);	if (rv != SECSuccess) {            extended->badExtensions = PR_TRUE;        }	break;    case SEC_KRL_TYPE:	rv = SEC_QuickDERDecodeItem	     (arena, crl, cert_SignedKrlTemplate, derSignedCrl);	break;    default:	rv = SECFailure;	break;    }    if (rv != SECSuccess) {	goto loser;    }    crl->referenceCount = 1;        return(crl);    loser:    if (options & CRL_DECODE_KEEP_BAD_CRL) {        extended->bad = PR_TRUE;        crl->referenceCount = 1;        return(crl);    }    if ((narena == NULL) && arena ) {	PORT_FreeArena(arena, PR_FALSE);    }        return(0);}