FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* Get Revoked Cert list, 0 on success */
Get Revoked Cert list, 0 on success
Get Revoked Cert list 0 on success
static int GetRevoked(const byte* buff, word32* idx, DecodedCRL* dcrl,
                      int maxIdx)
{
    int    ret, len;
    word32 end;
    byte   b;
    RevokedCert* rc;
    WOLFSSL_ENTER("GetRevoked");
    if (GetSequence(buff, idx, &len, maxIdx) < 0)
        return ASN_PARSE_E;
    end = *idx + len;
    rc = (RevokedCert*)XMALLOC(sizeof(RevokedCert), dcrl->heap,
                                                          DYNAMIC_TYPE_REVOKED);
    if (rc == NULL) {
        WOLFSSL_MSG("Alloc Revoked Cert failed");
        return MEMORY_E;
    }
    if (GetSerialNumber(buff, idx, rc->serialNumber, &rc->serialSz,
                                                                maxIdx) < 0) {
        XFREE(rc, dcrl->heap, DYNAMIC_TYPE_REVOKED);
        return ASN_PARSE_E;
    }
    rc->next = dcrl->certs;
    dcrl->certs = rc;
    dcrl->totalCerts++;
    ret = GetDateInfo(buff, idx, NULL, &b, NULL, maxIdx);
    if (ret < 0) {
        WOLFSSL_MSG("Expecting Date");
        return ret;
    }
    *idx = end;
    return 0;
}
static int GetRevoked ( const byte * buff , word32 * idx , DecodedCRL * dcrl , int maxIdx ) { int ret , len ; word32 end ; byte b ; RevokedCert * rc ; WOLFSSL_ENTER ( " " ) ; if ( GetSequence ( buff , idx , & len , maxIdx ) < 0 ) return ASN_PARSE_E ; end = * idx + len ; rc = ( RevokedCert * ) XMALLOC ( sizeof ( RevokedCert ) , dcrl -> heap , DYNAMIC_TYPE_REVOKED ) ; if ( rc == NULL ) { WOLFSSL_MSG ( " " ) ; return MEMORY_E ; } if ( GetSerialNumber ( buff , idx , rc -> serialNumber , & rc -> serialSz , maxIdx ) < 0 ) { XFREE ( rc , dcrl -> heap , DYNAMIC_TYPE_REVOKED ) ; return ASN_PARSE_E ; } rc -> next = dcrl -> certs ; dcrl -> certs = rc ; dcrl -> totalCerts ++ ; ret = GetDateInfo ( buff , idx , NULL , & b , NULL , maxIdx ) ; if ( ret < 0 ) { WOLFSSL_MSG ( " " ) ; return ret ; } * idx = end ; return 0 ; }
Get Revoked Cert list, 0 on success
Get Revoked Cert list 0 on success
/* add to list */ /* get date */ /* skip extensions */