PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx)
{
    STACK_OF(PKCS7_RECIP_INFO) *rsk;
    PKCS7_RECIP_INFO *ri;
    int i;
    i = OBJ_obj2nid(p7->type);
    if (i != NID_pkcs7_signedAndEnveloped)
        return NULL;
    if (p7->d.signed_and_enveloped == NULL)
        return NULL;
    rsk = p7->d.signed_and_enveloped->recipientinfo;
    if (rsk == NULL)
        return NULL;
    if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx)
        return (NULL);
    ri = sk_PKCS7_RECIP_INFO_value(rsk, idx);
    return (ri->issuer_and_serial);
}
['PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx)\n{\n    STACK_OF(PKCS7_RECIP_INFO) *rsk;\n    PKCS7_RECIP_INFO *ri;\n    int i;\n    i = OBJ_obj2nid(p7->type);\n    if (i != NID_pkcs7_signedAndEnveloped)\n        return NULL;\n    if (p7->d.signed_and_enveloped == NULL)\n        return NULL;\n    rsk = p7->d.signed_and_enveloped->recipientinfo;\n    if (rsk == NULL)\n        return NULL;\n    if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx)\n        return (NULL);\n    ri = sk_PKCS7_RECIP_INFO_value(rsk, idx);\n    return (ri->issuer_and_serial);\n}', 'int OBJ_obj2nid(const ASN1_OBJECT *a)\n{\n    const unsigned int *op;\n    ADDED_OBJ ad, *adp;\n    if (a == NULL)\n        return (NID_undef);\n    if (a->nid != 0)\n        return (a->nid);\n    if (a->length == 0)\n        return NID_undef;\n    if (added != NULL) {\n        ad.type = ADDED_DATA;\n        ad.obj = (ASN1_OBJECT *)a;\n        adp = lh_ADDED_OBJ_retrieve(added, &ad);\n        if (adp != NULL)\n            return (adp->obj->nid);\n    }\n    op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);\n    if (op == NULL)\n        return (NID_undef);\n    return (nid_objs[*op].nid);\n}', 'void *lh_retrieve(_LHASH *lh, const void *data)\n{\n    unsigned long hash;\n    LHASH_NODE **rn;\n    void *ret;\n    lh->error = 0;\n    rn = getrn(lh, data, &hash);\n    if (*rn == NULL) {\n        lh->num_retrieve_miss++;\n        return (NULL);\n    } else {\n        ret = (*rn)->data;\n        lh->num_retrieve++;\n    }\n    return (ret);\n}', 'int sk_num(const _STACK *st)\n{\n    if (st == NULL)\n        return -1;\n    return st->num;\n}', 'void *sk_value(const _STACK *st, int i)\n{\n    if (!st || (i < 0) || (i >= st->num))\n        return NULL;\n    return st->data[i];\n}']