This is a cryptographically signed message in MIME format.

--------------ms050007010501040703020708
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Daniel Diaz Sanchez wrote:
> Hello to everybody,
> I have a problem when implementing a simple structure using OpenSSL
> Asn1. This is the problem:
>
> When I try to implement this data structure:
>
> A ::=3D SEQUENCE {
> b=20
> CHOICE {=09
> b1 INTEGER,
> b2 INTEGER},
> =20

The previous is ambiguous. use for example b2 [0] INTEGER
Also, the given syntax does not say whether you are in global
environment of EXPLICIT or IMPLICIT tagging. It seems
that you assume IMPLICIT


> a1 BOOLEAN,
> a2 INTEGER OPTIONAL,
> a3 [0] INTEGER OPTIONAL,
> a4 [1] INTEGER
> }
> =20
> I do it in the following way:
>
> /* .h */
> typedef struct B_st
> {
> int type ;
> union {
> ASN1_INTEGER *b1;
> ASN1_INTEGER *b2;
> }value;
> }B;
>
> typedef struct A_st
> {
> B *b;
> ASN1_BOOLEAN *a1;
> ASN1_INTEGER *a2;
> ASN1_INTEGER *a3;
> ASN1_INTEGER *a4;
> }A;
>
> DECLARE_ASN1_ITEM(B)
> DECLARE_ASN1_ITEM(A)
> DECLARE_ASN1_FUNCTIONS(B)
> DECLARE_ASN1_FUNCTIONS(A)
>
> /* .c */
> =09
> ASN1_CHOICE(B) =3D {
> ASN1_SIMPLE(B,value.b1,ASN1_INTEGER)
> =20

missing ,
> ASN1_SIMPLE(B,value.b2,ASN1_INTEGER) //(*1)
> =20

missing }

ASN1_IMP(A,value.b2,ASN1_INTEGER,0)


> }ASN1_CHOICE_END(B) //(*2)
>
> ASN1_SEQUENCE(A) =3D {
> ASN1_EXP(A,b,B) //choice
> =20

,
> ASN1_SIMPLE(A,a1,ASN1_BOOLEAN)
> =20

,
> ASN1_OPT(A,a2,ASN1_INTEGER)
> =20

,
> ASN1_IMP_OPT(A,a3,ASN1_INTEGER,0)
> =20

,
> ASN1_IMP(A,a4,ASN1_INTEGER,1)
> }ASN1_SEQUENCE_END(A)
>
> IMPLEMENT_ASN1_FUNCTION(A)
>
> But I obtain (using Visual Studio)
>
> error C2059: syntax error : '{' at line (*1) and=20
> error C2059: syntax error : '{' at line (*2)
>
> I'm doing it ok or there is something missing?.
>
> Thanks!,
>
> Regards,
> =09
> --
> Daniel Diaz Sanchez
> Telecommunication Engineer
> Researcher / Teaching Assistant
> =20
> Dep. Ing. Telem=E1tica
> Universidad Carlos III de Madrid
> Av. Universidad, 30
> 28911 Legan=E9s (Madrid/Spain)
> Tel: (+34) 91-624-8817, Fax: -8749
>
> Web: www.it.uc3m.es/dds
> web: http://www.it.uc3m.es/pervasive
> A toolkit for attribute certificates:
> http://www.it.uc3m.es/dds/swRelease/pmi/pmi.xml
>
> Mail: dds[at].it.uc3m.es
> Skype: dds.it.uc3m.es
>
>
>
> __________________________________________________ ____________________
> OpenSSL Project http://www.openssl.org
> User Support Mailing List openssl-users@openssl.org
> Automated List Manager majordomo@openssl.org
>
>
>
> =20



--=20
To verify the signature, see http://edelpki.edelweb.fr/=20
Cela vous permet de charger le certificat de l'autorit=E9;=20
die Liste mit zur=FCckgerufenen Zertifikaten finden Sie da auch.=20


--------------ms050007010501040703020708
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCS qGSIb3DQEHAQAAoIIOpDCC
BHIwggLfoAMCAQICBgoMz+gAPzANBgkqhkiG9w0BAQUFADBbMQ swCQYDVQQGEwJGUjEQMA4G
A1UEChMHRWRlbFdlYjEYMBYGA1UECxMPU2VydmljZSBFZGVsUE tJMSAwHgYDVQQDExdFZGVs
UEtJIEVkZWxXZWIgUGVyc0dFTjAeFw0wNTAxMDYxMjI3MTlaFw 0wNzAzMTcxMjI3MTlaMHAx
CzAJBgNVBAYTAkZSMRAwDgYDVQQKDAdFZGVsV2ViMRgwFgYDVQ QLDA9TZXJ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dlYjEY
MBYGA1UECxMPU2VydmljZSBFZGVsUEtJMSAwHgYDVQQDExdFZG VsUEtJIEVkZWxXZWIgUGVy
c0dFTgIGCgzP6AA/MHYGCyqGSIb3DQEJEAILMWegZTBbMQswCQYDVQQGEwJGUjEQMA 4GA1UE
ChMHRWRlbFdlYjEYMBYGA1UECxMPU2VydmljZSBFZGVsUEtJMS AwHgYDVQQDExdFZGVsUEtJ
IEVkZWxXZWIgUGVyc0dFTgIGCgzP6AA/MA0GCSqGSIb3DQEBAQUABIGAfiKa0jPW/YiUzYsm
5XzPtdP+Jn8KSayoWno42M5gXa1TBI9O0p0gBJu9ljUJ/3EvYnfO5Bqb1K2dyxvFlFCqhexM
P96tvOpTh+9br3W1rlEQ78vV5JfrtSz9fEjkJSF4aUsbkv8Pyj 7R1tbaHJ2tOCehTFGwK+rS
M1s5aUOQvfQAAAAAAAA=
--------------ms050007010501040703020708--
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majordomo@openssl.org