Instead of just STACK, use STACK_OF(ASN1_OBJECT).