RE: C++ compatability

2007-09-12 Thread Phillips, Justin - ACD
The error is on the header file asn1.h.  I have commented out the call
to HMAC so the only related code is the include which at this point
looks like.

extern C {
#include openssl/hmac.h
}

Here is the error...

In file included from
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/objects.h:9
60,
 from
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/evp.h:94,
 from
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/hmac.h:67,
 from StateFill.cpp:36:
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:905:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:915:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:920:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:933:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:938:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:985:
invalid
   conversion from `void (*)()' to `void*'


I also notice warnings that are related to these same lines...

/opt/hardhat/devkit/arm/xscale_le/target/usr/include/c++/3.2.1/bits/stl_
queue.h: At
   top level:
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:905
: warning: `
   void*__ASN1_dup' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:915
: warning: `
   void*__ASN1_d2i_fp' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:920
: warning: `
   void*__ASN1_i2d_fp' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:933
: warning: `
   void*__ASN1_d2i_bio' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:938
: warning: `
   void*__ASN1_i2d_bio' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:985
: warning: `
   void*__ASN1_pack_string' defined but not used


When I remove the include to openssl/hmac.h I can compile successfully.
I am wondering if there is a patch that I need to install to remove
these lines from the header file?


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Saju Paul
Sent: Tuesday, September 11, 2007 3:23 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability

is the compile error on the header file (asn1.h) or at the call ? 
copy and paste the error include any necessary code.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Tuesday, September 11, 2007 2:55 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability


I have the following code but I still get the compile errors described
below.  There are no other openssl includes or function calls other than
what is shown below.

extern C {
   #include openssl/hmac.h
}
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Saju Paul
Sent: Tuesday, September 11, 2007 2:37 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability

extern C {
   // defn...
}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Tuesday, September 11, 2007 2:20 PM
To: openssl-users@openssl.org
Subject: C++ compatability



 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.

Justin
*
This e-mail and any files transmitted with it may be proprietary and are
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this e-mail in error please notify the
sender. Please note that any views or opinions presented in this e-mail
are solely those of the author and do not necessarily represent those of
ITT Corporation. The recipient should check this e-mail and any
attachments for the presence of viruses. ITT accepts no liability for
any damage caused by any virus transmitted by this e-mail.
***
 __
OpenSSL Project http://www.openssl.org
User

RE: C++ compatability

2007-09-12 Thread Saju Paul
first: the extern C around the hmac.h is not necessary. get rid of it.
second: the errors are make no sense at all; these header files you are
referencing are Unix/Linux files are they not ? meaning they are not files
built in a Windows environment (i hope not)
third: a rebuild of openssl is something that I might try next.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Wednesday, September 12, 2007 9:07 AM
To: openssl-users@openssl.org
Subject: RE: C++ compatability


The error is on the header file asn1.h.  I have commented out the call
to HMAC so the only related code is the include which at this point
looks like.

extern C {
#include openssl/hmac.h
}

Here is the error...

In file included from
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/objects.h:9
60,
 from
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/evp.h:94,
 from
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/hmac.h:67,
 from StateFill.cpp:36:
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:905:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:915:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:920:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:933:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:938:
invalid
   conversion from `void (*)()' to `void*'
/opt/hardhat/devkit/arm/xscale_le/target/usr/include/openssl/asn1.h:985:
invalid
   conversion from `void (*)()' to `void*'


I also notice warnings that are related to these same lines...

/opt/hardhat/devkit/arm/xscale_le/target/usr/include/c++/3.2.1/bits/stl_
queue.h: At
   top level:
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:905
: warning: `
   void*__ASN1_dup' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:915
: warning: `
   void*__ASN1_d2i_fp' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:920
: warning: `
   void*__ASN1_i2d_fp' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:933
: warning: `
   void*__ASN1_d2i_bio' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:938
: warning: `
   void*__ASN1_i2d_bio' defined but not used
/opt/hardhat/devkit/arm/xscale_le/target2/usr/include/openssl/asn1.h:985
: warning: `
   void*__ASN1_pack_string' defined but not used


When I remove the include to openssl/hmac.h I can compile successfully.
I am wondering if there is a patch that I need to install to remove
these lines from the header file?


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Saju Paul
Sent: Tuesday, September 11, 2007 3:23 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability

is the compile error on the header file (asn1.h) or at the call ?
copy and paste the error include any necessary code.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Tuesday, September 11, 2007 2:55 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability


I have the following code but I still get the compile errors described
below.  There are no other openssl includes or function calls other than
what is shown below.

extern C {
   #include openssl/hmac.h
}


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Saju Paul
Sent: Tuesday, September 11, 2007 2:37 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability

extern C {
   // defn...
}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Tuesday, September 11, 2007 2:20 PM
To: openssl-users@openssl.org
Subject: C++ compatability



 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.

Justin
*
This e-mail and any files transmitted with it may be proprietary and are
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this e-mail in error please notify the
sender. Please

C++ compatability

2007-09-11 Thread Phillips, Justin - ACD

 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.

Justin
*
This e-mail and any files transmitted with it may be proprietary 
and are intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this e-mail in 
error please notify the sender. Please note that any views or
opinions presented in this e-mail are solely those of the author 
and do not necessarily represent those of ITT Corporation. The 
recipient should check this e-mail and any attachments for the 
presence of viruses. ITT accepts no liability for any damage 
caused by any virus transmitted by this e-mail.
***

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: C++ compatability

2007-09-11 Thread Phillips, Justin - ACD
I have the following code but I still get the compile errors described
below.  There are no other openssl includes or function calls other than
what is shown below.

extern C {
   #include openssl/hmac.h
}
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Saju Paul
Sent: Tuesday, September 11, 2007 2:37 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability

extern C {
   // defn...
}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Tuesday, September 11, 2007 2:20 PM
To: openssl-users@openssl.org
Subject: C++ compatability



 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.

Justin
*
This e-mail and any files transmitted with it may be proprietary and are
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this e-mail in error please notify the
sender. Please note that any views or opinions presented in this e-mail
are solely those of the author and do not necessarily represent those of
ITT Corporation. The recipient should check this e-mail and any
attachments for the presence of viruses. ITT accepts no liability for
any damage caused by any virus transmitted by this e-mail.
***
 __
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]
*
This e-mail and any files transmitted with it may be proprietary 
and are intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this e-mail in 
error please notify the sender. Please note that any views or
opinions presented in this e-mail are solely those of the author 
and do not necessarily represent those of ITT Corporation. The 
recipient should check this e-mail and any attachments for the 
presence of viruses. ITT accepts no liability for any damage 
caused by any virus transmitted by this e-mail.
***

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: C++ compatability

2007-09-11 Thread Saju Paul
is the compile error on the header file (asn1.h) or at the call ? 
copy and paste the error include any necessary code.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Tuesday, September 11, 2007 2:55 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability


I have the following code but I still get the compile errors described
below.  There are no other openssl includes or function calls other than
what is shown below.

extern C {
   #include openssl/hmac.h
}
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Saju Paul
Sent: Tuesday, September 11, 2007 2:37 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability

extern C {
   // defn...
}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Tuesday, September 11, 2007 2:20 PM
To: openssl-users@openssl.org
Subject: C++ compatability



 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.

Justin
*
This e-mail and any files transmitted with it may be proprietary and are
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this e-mail in error please notify the
sender. Please note that any views or opinions presented in this e-mail
are solely those of the author and do not necessarily represent those of
ITT Corporation. The recipient should check this e-mail and any
attachments for the presence of viruses. ITT accepts no liability for
any damage caused by any virus transmitted by this e-mail.
***
 __
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]
*
This e-mail and any files transmitted with it may be proprietary 
and are intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this e-mail in 
error please notify the sender. Please note that any views or
opinions presented in this e-mail are solely those of the author 
and do not necessarily represent those of ITT Corporation. The 
recipient should check this e-mail and any attachments for the 
presence of viruses. ITT accepts no liability for any damage 
caused by any virus transmitted by this e-mail.
***
 __
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: C++ compatability

2007-09-11 Thread Thomas J. Hruska

Saju Paul wrote:
is the compile error on the header file (asn1.h) or at the call ? 
copy and paste the error include any necessary code.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Tuesday, September 11, 2007 2:55 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability


I have the following code but I still get the compile errors described
below.  There are no other openssl includes or function calls other than
what is shown below.

extern C {
   #include openssl/hmac.h
}
 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Saju Paul
Sent: Tuesday, September 11, 2007 2:37 PM
To: openssl-users@openssl.org
Subject: RE: C++ compatability

extern C {
   // defn...
}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
ACD
Sent: Tuesday, September 11, 2007 2:20 PM
To: openssl-users@openssl.org
Subject: C++ compatability



 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.

Justin


While I'm finding this discussion on misinformation entertaining, I 
realize Justin probably has a job to do.  In general, all you ever need 
to include is:


#include openssl/ssl.h
#include openssl/err.h

After your other #include files.  Those will generally #include any 
other files you might need...including the HMAC routines.  I've never 
had any issues with VC++ or gcc/g++ when doing that.


--
Thomas Hruska
Shining Light Productions

Home of BMP2AVI, Nuclear Vision, ProtoNova, and Win32 OpenSSL.
http://www.slproweb.com/


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: C++ compatability

2007-09-11 Thread Saju Paul
It is very clear that you Thomas have never ever used the hmac routines !!
So how you entertain yourself is irrelevant to the problem being discussed.
thank you.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Thomas J. Hruska
Sent: Tuesday, September 11, 2007 3:38 PM
To: openssl-users@openssl.org
Subject: Re: C++ compatability


Saju Paul wrote:
 is the compile error on the header file (asn1.h) or at the call ?
 copy and paste the error include any necessary code.
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
 ACD
 Sent: Tuesday, September 11, 2007 2:55 PM
 To: openssl-users@openssl.org
 Subject: RE: C++ compatability


 I have the following code but I still get the compile errors described
 below.  There are no other openssl includes or function calls other than
 what is shown below.

 extern C {
#include openssl/hmac.h
 }


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Saju Paul
 Sent: Tuesday, September 11, 2007 2:37 PM
 To: openssl-users@openssl.org
 Subject: RE: C++ compatability

 extern C {
// defn...
 }

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Phillips, Justin -
 ACD
 Sent: Tuesday, September 11, 2007 2:20 PM
 To: openssl-users@openssl.org
 Subject: C++ compatability



  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.

 Justin

While I'm finding this discussion on misinformation entertaining, I
realize Justin probably has a job to do.  In general, all you ever need
to include is:

#include openssl/ssl.h
#include openssl/err.h

After your other #include files.  Those will generally #include any
other files you might need...including the HMAC routines.  I've never
had any issues with VC++ or gcc/g++ when doing that.

--
Thomas Hruska
Shining Light Productions

Home of BMP2AVI, Nuclear Vision, ProtoNova, and Win32 OpenSSL.
http://www.slproweb.com/


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: C++ compatability

2007-09-11 Thread Thomas J. Hruska

Saju Paul wrote:

It is very clear that you Thomas have never ever used the hmac routines !!


Oops.  And you're right.  I've never used them.  Just looked them up 
(lazy me).  Definitely requires the openssl/hmac.h file (but it never 
hurts to include the others - particularly the err.h file).  However, I 
did bother to Google for similar problems with g++:


http://www.cygwin.com/ml/cygwin/2003-10/msg00793.html

OP:  Check for a '-xc' flag (e.g. environment variables, command-line). 
 Causes the __cplusplus #define to not exist.  Kind of important. 
Although I'm not sure how the you compile C++ code in the first place 
without it.  You can make sure that the #define exists by doing:


#ifndef __cplusplus
#error Yikes!  No C++ support!
#endif

Somewhere at the top of the code.

--
Thomas Hruska
Shining Light Productions

Home of BMP2AVI, Nuclear Vision, ProtoNova, and Win32 OpenSSL.
http://www.slproweb.com/


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: C++ compatability

2007-09-11 Thread Steffen DETTMER
* 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_castconst 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 Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: C++ compatability

2007-09-11 Thread Bruce Stephens
Saju Paul [EMAIL PROTECTED] writes:

 It is very clear that you Thomas have never ever used the hmac routines !!
 So how you entertain yourself is irrelevant to the problem being discussed.
 thank you.

You'll need to give more information.  For me, the following C++
program compiles, links (needs to link against -lcrypto -lssl), and
runs (printing the unexciting md_len = 20).  This is using gcc (4.1)
on GNU/Linux, x86, with OpenSSL 0.9.8e.

#include openssl/ssl.h
#include openssl/hmac.h
#include strings.h
#include iostream

int
main(int, char *[])
{
SSL_library_init();
OpenSSL_add_all_algorithms();

const char key[] = hello;
const char data[] = some data to hash;
unsigned char md[EVP_MAX_MD_SIZE];
unsigned int md_len;

HMAC(EVP_sha1(), key, strlen(key), 
  reinterpret_castconst unsigned char*(data), strlen(data),
  md, md_len);
std::cout  md_len =   md_len  std::endl;
}
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]