Re: ASN1 & Recursive Structures definition

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

 



In message <d1eeba62-f25f-c984-dc77-94a150cf73c1@xxxxxxxxxx> on Fri, 1 Dec 2017 20:22:09 -0700, "Dr. Pala" <madwolf@xxxxxxxxxx> said:

madwolf> Hi Richard,
madwolf> 
madwolf> thanks :D That worked. I have a new challenge for you now. Here's what
madwolf> I am trying to do:
madwolf> 
madwolf> ASN1_SEQUENCE(TEST);
madwolf> ASN1_SEQUENCE(TBS_TEST) = {
madwolf>     ASN1_SIMPLE(TBS_TEST, version, ASN1_INTEGER),
madwolf>     ASN1_EXP_SEQUENCE_OF_OPT(TBS_TEST, otherTests, TEST, 0)
madwolf> } ASN1_SEQUENCE_END(TEST)
madwolf> 
madwolf> IMPLEMENT_ASN1_FUNCTIONS(TBS_TEST) [**]
madwolf> 
madwolf> ASN1_SEQUENCE(TEST) = {
madwolf>     ASN1_SIMPLE(TEST, tbsTest, ASN1_INTEGER),
madwolf>     ASN1_EXP_OPT(TEST, optionalSignature, TEST_SIGNATURE, 0)
madwolf> } ASN1_SEQUENCE_END(TEST)
madwolf> 
madwolf> IMPLEMENT_ASN1_FUNCTIONS(TEST) [**]
madwolf> 
madwolf> In this case, the difference is that TBS_TEST has, inside the
madwolf> otherTests that are of type TEST. The TEST is built out of a tbsTest
madwolf> and an optionalSignature - but it is defined after TBS_TEST.
madwolf> 
madwolf> What to do in this case ?

It seems to me that you need to do some kind of forward declaration of
TEST_SIGNATURE as well, before the construction of TEST.  (also, to be
picky, you need to make sure that ASN1_SEQUENCE(TBS_TEST) is ended
with ASN1_SEQUENCE_END(TBS_TEST), not ASN1_SEQUENCE_END(TEST))

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