FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* Pull informtation from the ASN.1 BER encoded item header */
Pull informtation from the ASN.1 BER encoded item header
Pull informtation from the ASN . 1 BER encoded item header
static int GetBerHeader(const byte* data, word32* idx, word32 maxIdx,
                        byte* pTag, word32* pLen, int* indef)
{
    int len = 0;
    byte tag;
    word32 i = *idx;
    *indef = 0;
    if (i + 2 > maxIdx) {
        return ASN_PARSE_E;
    }
    tag = data[i++];
    if (data[i] == 0x80) {
        if (((tag & 0xc0) == 0) && ((tag & ASN_CONSTRUCTED) == 0x00)) {
            return ASN_PARSE_E;
        }
        i++;
        *indef = 1;
    }
    else if (GetLength(data, &i, &len, maxIdx) < 0) {
        return ASN_PARSE_E;
    }
    *pTag = tag;
    *pLen = len;
    *idx = i;
    return 0;
}
static int GetBerHeader ( const byte * data , word32 * idx , word32 maxIdx , byte * pTag , word32 * pLen , int * indef ) { int len = 0 ; byte tag ; word32 i = * idx ; * indef = 0 ; if ( i + 2 > maxIdx ) { return ASN_PARSE_E ; } tag = data [ i ++ ] ; if ( data [ i ] == 0x80 ) { if ( ( ( tag & 0xc0 ) == 0 ) && ( ( tag & ASN_CONSTRUCTED ) == 0x00 ) ) { return ASN_PARSE_E ; } i ++ ; * indef = 1 ; } else if ( GetLength ( data , & i , & len , maxIdx ) < 0 ) { return ASN_PARSE_E ; } * pTag = tag ; * pLen = len ; * idx = i ; return 0 ; }
Pull informtation from the ASN.1 BER encoded item header
Pull informtation from the ASN . 1 BER encoded item header
/* Check there is enough data for a minimal header */ /* Retrieve tag */ /* Indefinite length handled specially */ /* Check valid tag for indefinite */ /* Return tag, length and index after BER item header */