I not found documentation on the page of openssl about how to work with ASN1_ENUMERATED.
Using BERViewer to visualize the structure:
So I used:
ASN1_SEQUENCE_ANY *asn1SequenceAny = sk_ASN1_TYPE_new_null();
asn1SequenceAny = d2i_ASN1_SEQUENCE_ANY(&asn1SequenceAny, (const unsigned char**)&data,len);
ASN1_TYPE *asn1Type = NULL;
asn1Type = sk_ASN1_TYPE_pop(asn1SequenceAny);
if(asn1Type->type == V_ASN1_ENUMERATED)
{
asn1Type->value.enumerated->data; // How to get sequence inside [0] ?
}
Enumerated data on the disk "asn1Type->value.enumerated->data" looks like:
How to get the ASN1_SEQUENCE_ANY from [0]:
SEQUENCE
|__SEQUENCE
|__SEQUENCE
I tried: ASN1_ENUMERATED_get, return -1. Why not zero?
Articles are very welcome.