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 List openssl-users@openssl.org > Automated List Manager [EMAIL PROTECTED] >
______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]