Re: Problem to compile static void *KDF1_SHA1

2006-12-22 Thread shakal
yeah, I've tried before and It hasn't worked. And now, I did it again
using g++ command instead gcc and it worked.
Thank you!
Shakal
 [EMAIL PROTECTED] wrote:
 Hi all,

 I've created a method to generate ECDH Key, based on ecdhtest.c,
 available
 at /openssl/test directory.
 But I'm facing some trouble to compile it.
 I've inserted the following code in the begining of the file, acording
 ecdhtest.c,
 static const int KDF1_SHA1_len = 20;
 static void *KDF1_SHA1(const void *in, size_t inlen, void *out, size_t
 *outlen)
 {
 #ifndef OPENSSL_NO_SHA
 if (*outlen  SHA_DIGEST_LENGTH)
  return NULL;
 else
  *outlen = SHA_DIGEST_LENGTH;
 return SHA1(in, inlen, out);
 #else
 return NULL;
 #endif
 }
 in order to use the ECDH method:
 out=ECDH_compute_key(buf,len,EC_KEY_get0_public_key(public_key),ec_key,KDF1_SHA1);
 When I compile it, the following messages appear.
 aodv/aodv.cc: In function ‘void* KDF1_SHA1(const void*, size_t,
 void*,
 size_t*)’:
 aodv/aodv.cc:52: error: invalid conversion from ‘const void*’ to
 ‘const
 unsigned char*’
 aodv/aodv.cc:52: error:   initializing argument 1 of ‘unsigned char*
 SHA1(const unsigned char*, size_t, unsigned char*)’
 aodv/aodv.cc:52: error: invalid conversion from ‘void*’ to
 ‘unsigned char*’
 aodv/aodv.cc:52: error:   initializing argument 3 of ‘unsigned char*
 SHA1(const unsigned char*, size_t, unsigned char*)

 I've already looked for the SHA1 constructor, and I don't know what is
 going wrong.

 Has anybody already faced this problem?
 if not, could you give me some tips in order to solve this problem?

 it looks like your compiler doesn't like the implicit conversion
 from const void * to const unsigned char * ... Did you try to
 use a cast ?

 Cheers,
 Nils
 __
 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]


Problem to compile static void *KDF1_SHA1

2006-12-21 Thread shakal
Hi all,

I've created a method to generate ECDH Key, based on ecdhtest.c, available
at /openssl/test directory.
But I'm facing some trouble to compile it.
I've inserted the following code in the begining of the file, acording
ecdhtest.c,
static const int KDF1_SHA1_len = 20;
static void *KDF1_SHA1(const void *in, size_t inlen, void *out, size_t
*outlen)
{
#ifndef OPENSSL_NO_SHA
 if (*outlen  SHA_DIGEST_LENGTH)
  return NULL;
 else
  *outlen = SHA_DIGEST_LENGTH;
 return SHA1(in, inlen, out);
#else
 return NULL;
#endif
}
in order to use the ECDH method:
out=ECDH_compute_key(buf,len,EC_KEY_get0_public_key(public_key),ec_key,KDF1_SHA1);
When I compile it, the following messages appear.
aodv/aodv.cc: In function ‘void* KDF1_SHA1(const void*, size_t, void*,
size_t*)’:
aodv/aodv.cc:52: error: invalid conversion from ‘const void*’ to ‘const
unsigned char*’
aodv/aodv.cc:52: error:   initializing argument 1 of ‘unsigned char*
SHA1(const unsigned char*, size_t, unsigned char*)’
aodv/aodv.cc:52: error: invalid conversion from ‘void*’ to ‘unsigned char*’
aodv/aodv.cc:52: error:   initializing argument 3 of ‘unsigned char*
SHA1(const unsigned char*, size_t, unsigned char*)

I've already looked for the SHA1 constructor, and I don't know what is
going wrong.

Has anybody already faced this problem?
if not, could you give me some tips in order to solve this problem?

Thanks.
Alexandre Gava Menezes
NPD/UFSC

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


Re: Problem to compile static void *KDF1_SHA1

2006-12-21 Thread Nils Larsch

[EMAIL PROTECTED] wrote:

Hi all,

I've created a method to generate ECDH Key, based on ecdhtest.c, available
at /openssl/test directory.
But I'm facing some trouble to compile it.
I've inserted the following code in the begining of the file, acording
ecdhtest.c,

static const int KDF1_SHA1_len = 20;
static void *KDF1_SHA1(const void *in, size_t inlen, void *out, size_t

*outlen)

{
#ifndef OPENSSL_NO_SHA
if (*outlen  SHA_DIGEST_LENGTH)
 return NULL;
else
 *outlen = SHA_DIGEST_LENGTH;
return SHA1(in, inlen, out);
#else
return NULL;
#endif
}

in order to use the ECDH method:

out=ECDH_compute_key(buf,len,EC_KEY_get0_public_key(public_key),ec_key,KDF1_SHA1);

When I compile it, the following messages appear.

aodv/aodv.cc: In function ‘void* KDF1_SHA1(const void*, size_t, void*,

size_t*)’:

aodv/aodv.cc:52: error: invalid conversion from ‘const void*’ to ‘const

unsigned char*’

aodv/aodv.cc:52: error:   initializing argument 1 of ‘unsigned char*

SHA1(const unsigned char*, size_t, unsigned char*)’

aodv/aodv.cc:52: error: invalid conversion from ‘void*’ to ‘unsigned char*’
aodv/aodv.cc:52: error:   initializing argument 3 of ‘unsigned char*

SHA1(const unsigned char*, size_t, unsigned char*)

I've already looked for the SHA1 constructor, and I don't know what is
going wrong.

Has anybody already faced this problem?
if not, could you give me some tips in order to solve this problem?


it looks like your compiler doesn't like the implicit conversion
from const void * to const unsigned char * ... Did you try to
use a cast ?

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