Dr Henson, The function pointer cast did the trick. All I did was add "(int (*)())" in front of the i2d_X509_EXTENSION.
I owe you a beer next time you are in San Francisco - let me know if you are coming to the RSA conference next week... Oily --- "Dr. Stephen Henson" <[EMAIL PROTECTED]> wrote: > On Thu, Feb 10, 2005, Oily Pakora wrote: > > > Friends, > > > > When compiling a program on Win32, the following line of code generates an > > error > message: > > > > *plLen = i2d_ASN1_SET_OF_X509_EXTENSION(exts, NULL, i2d_X509_EXTENSION, > > V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE); > > > > The error I get is: > > > > error C2664: 'i2d_ASN1_SET' : cannot convert parameter 3 from > > 'int (X509_EXTENSION *,unsigned char ** )' to 'int (__cdecl *)(void)' > > > > On UNIX systems, the code seems to compile fine. This is the first time I > > am trying > it > > on Win32. Any quick tip on how I might be calling this wrong? > > > > Are you using C++ by any chance? Coudl be a conflict between int func() which > can be interpreted as unspecified arguments in C and no arguments in C++. > You could use a function pointer cast. > > i2d_ASN1_SET_OF_<foo>() isn't the best way of doing that any more. The new > template code is preferred. Something like: > > typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; > > > ASN1_ITEM_TEMPLATE(X509_EXTENSIONS) = > ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, Extensions, > X509_EXTENSION) > ASN1_ITEM_TEMPLATE_END(X509_EXTENSIONS) > > IMPLEMENT_ASN1_FUNCTIONS(X509_EXTENSIONS) > > then use i2d_X509_EXTENSIONS(). > > Which reminds me.. we should really have a definition of X509_EXTENSIONS > in the core code. > > Steve. > -- > Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage > OpenSSL project core developer and freelance consultant. > Funding needed! Details on homepage. > Homepage: http://www.drh-consultancy.demon.co.uk > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List openssl-users@openssl.org > Automated List Manager [EMAIL PROTECTED] > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]