/* Decode an ASN1 item, this currently behaves just like a standard 'd2i' function. 'in' points to a buffer to read the data from, in future we will have more advanced versions that can input data a piece at a time and this will simply be a special case.  */
ASN1_VALUE* ASN1_item_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it)
/* Decode an ASN1 item, this currently behaves just like a standard 'd2i' function. 'in' points to a buffer to read the data from, in future we will have more advanced versions that can input data a piece at a time and this will simply be a special case.  */
ASN1_VALUE* ASN1_item_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it)
{
    ASN1_TLC c;
    ASN1_VALUE *ptmpval = NULL;
    if (!pval)
        pval = &ptmpval;
    asn1_tlc_clear_nc(&c);
    if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0)
        return *pval;
    return NULL;
}