Linking problems with 0.9.8 on FC3

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Linking problems with 0.9.8 on FC3

Richard Barnes-2
Hi folks,

I'm having a little trouble with openssl-0.9.8 on Fedora Core 3.  I
downloaded the source and installed with the following:

./config --prefix=/usr
make test
make install

Then, for good measure, I rebooted (init 6).  I had thought that at
this point, I would be able to make calls to the new Elliptic Curve
(EC_*) functions, but when I wrote a little test program (appended
below), and compiled with "gcc -lcrypto main.c", the linker says all
of the EC_ symbols are undefined (full error appended below).

Any idea why this is happening?  Does libcrypto in 0.9.8 not contain
the EC functions?

Thanks a lot,

p.s. Sorry if this is going out twice.  I wasn't sure if it sent
successfully last time.

----- BEGIN main.c -----
#include <stdio.h>
#include <openssl/ec.h>
#include <openssl/bn.h>
#include <openssl/objects.h>

int main()
       EC_KEY* eckey;
       BIGNUM* privkey;

       eckey = EC_KEY_new();
       privkey = EC_KEY_get0_private_key(eckey);

       if (!privkey)
               printf("Private key not found or not set. \n");
               printf("Private key: [%s] \n ", BN_bn2hex(privkey) );

       return 0;
----- END main.c -----

----- BEGIN gcc output -----
main.c: In function `main':
main.c:14: warning: assignment discards qualifiers from pointer target type
/tmp/ccnAOmb9.o(.text+0x2b): In function `main':
: undefined reference to `EC_KEY_new'
/tmp/ccnAOmb9.o(.text+0x39): In function `main':
: undefined reference to `EC_KEY_get0_private_key'
collect2: ld returned 1 exit status
----- END gcc output -----
OpenSSL Project                       
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]