* Phillips, Justin - ACD wrote on Tue, Sep 11, 2007 at 14:20 -0400:
>  I am trying to call the HMAC function (openssl 0.9.8e) within my C++
> code.  When I include <openssl/hmac.h> I get compilation errors on the
> asn1.h file at lines 905, 915, 920, 933, 938, and 985 all saying
> "invalid conversion from 'void (*)() to 'void*'.  This makes sense
> because the libraries are compiled with gcc but I am compiling my
> software with g++ and in C++ this type of casting is not allowed.  So my
> question is how do you use openssl in C++ when the include files use C
> specific syntax such as this?  Thank you in advance for the help.

Hi,

surely you also already had this idea, but just in case: we use
wrappers often (in other projects, no openssl related) by having
a C module with a C/C++ interoperable header calling the func
one-to-one in its .c implementation. Maybe you'll use another MAC
later or so, in this case this could even help :-)

However, in most cases brutal unchecked `c style casts' help,
because things like "(const void*)myFunc" are also possible in
C++, just as in C; I'm not sure if
"reinterpret_cast<const void*>(myFunc)" would work here. However,
if .h does not even compile, this won't help at all, but of
course instead you could include a fixed prototype which invites
maintenance problems that can be excitingly expensive to detect
and fix (if the prototypes change). If asn1.h is automatically
generated by some asn1c or alike prototypes may be difficult to
fix...

oki,

Steffen
 
About Ingenico Throughout the world businesses rely on Ingenico for secure and 
expedient electronic transaction acceptance. Ingenico products leverage proven 
technology, established standards and unparalleled ergonomics to provide 
optimal reliability, versatility and usability. This comprehensive range of 
products is complemented by a global array of services and partnerships, 
enabling businesses in a number of vertical sectors to accept transactions 
anywhere their business takes them.
www.ingenico.com This message may contain confidential and/or privileged 
information. If you are not the addressee or authorized to receive this for the 
addressee, you must not use, copy, disclose or take any action based on this 
message or any information herein. If you have received this message in error, 
please advise the sender immediately by reply e-mail and delete this message. 
Thank you for your cooperation.
 
About Ingenico Throughout the world businesses rely on Ingenico for secure and 
expedient electronic transaction acceptance. Ingenico products leverage proven 
technology, established standards and unparalleled ergonomics to provide 
optimal reliability, versatility and usability. This comprehensive range of 
products is complemented by a global array of services and partnerships, 
enabling businesses in a number of vertical sectors to accept transactions 
anywhere their business takes them.
www.ingenico.com This message may contain confidential and/or privileged 
information. If you are not the addressee or authorized to receive this for the 
addressee, you must not use, copy, disclose or take any action based on this 
message or any information herein. If you have received this message in error, 
please advise the sender immediately by reply e-mail and delete this message. 
Thank you for your cooperation.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to