Re: ASN1 & Recursive Structures definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In message <2c480bc2-3367-38e9-f4d8-3e7b37e42cb8@xxxxxxxxxx> on Fri, 1 Dec 2017 12:14:54 -0700, "Dr. Pala" <director@xxxxxxxxxx> said:

director> I am trying to define an ASN1 structure similar to this:
director> 
director> ASN1_SEQUENCE(TEST) = {
director>     ASN1_SIMPLE(TEST, version, ASN1_INTEGER),
director>     ASN1_EXP_SEQUENCE_OF_OPT(TEST, otherTests, TEST, 0)
director> } ASN1_SEQUENCE_END(TEST)
director> 
director> IMPLEMENT_ASN1_FUNCTIONS(TEST) [**]
director> 
director> what is the correct procedure for doing that ? The problem
director> is that the "otherTests" field should be a sequence of
director> "TEST" structures, but defined like that it won't work.
director> 
director> Is there a way to solve the issue ? Or shall we use
director> something like ASN1_ANY to avoid the circular reference ?

Nope...  all it takes is a forward declaration:

    ASN1_SEQUENCE(TEST);
    ASN1_SEQUENCE(TEST) = {
        ASN1_SIMPLE(TEST, version, ASN1_INTEGER),
        ASN1_EXP_SEQUENCE_OF_OPT(TEST, otherTests, TEST, 0)
    } ASN1_SEQUENCE_END(TEST)
    
    IMPLEMENT_ASN1_FUNCTIONS(TEST)

(I tested that just now)

Cheers,
Richard

-- 
Richard Levitte         levitte@xxxxxxxxxxx
OpenSSL Project         http://www.openssl.org/~levitte/
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux