Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
OpenSSL undefined reference [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Geek2010
n00b
n00b


Joined: 25 Apr 2007
Posts: 5
Location: Aveiro / Tondela

PostPosted: Wed Nov 19, 2008 5:10 am    Post subject: OpenSSL undefined reference [Solved] Reply with quote

Hello,

I'm a Portuguese student and have one project where i use a Portuguese citizen card. I have to make a little program that use this card to authenticate the user.

I use libpteid and libpteidpkcs in my program but when compile with cc have this error:
$ cc -o auth auth.o -L /usr/local/lib -lpteid
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_set_flags@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_add_cert@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `RAND_pseudo_bytes@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BN_CTX_new@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `RSA_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `DES_set_key_unchecked@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `d2i_X509@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `sk_new_null@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `sk_value@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `RAND_add@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `EVP_PKEY_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `OBJ_create@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_get_pubkey@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BN_bin2bn@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `RSA_public_decrypt@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BIO_new_mem_buf@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `EVP_PKEY_get1_RSA@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `sk_push@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_verify@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `PKCS7_get_signer_info@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `sk_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `PKCS7_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `SHA1_Init@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BIO_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `SHA1_Update@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_CRL_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `RAND_bytes@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_new@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_CTX_get1_issuer@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BN_num_bits@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BN_bn2bin@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `sk_num@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `OPENSSL_add_all_algorithms_noconf@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BN_new@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `d2i_PKCS7_bio@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BN_mod_exp@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `DES_ede3_cbc_encrypt@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_CTX_init@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_cmp@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_add_crl@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_CTX_new@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `DES_ecb_encrypt@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BN_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_LOOKUP_file@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_CTX_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_STORE_add_lookup@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `BN_CTX_free@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `PKCS7_get_signed_attribute@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `SHA1_Final@OPENSSL_0.9.8'
/usr/local/lib/libpteid.so: undefined reference to `X509_LOOKUP_hash_dir@OPENSSL_0.9.8'
collect2: ld returned 1 exit status
make: *** [auth] Error 1

I have this warnings when i execute the proprietary software of the card:
$./pteidgui
pteidgui: /usr/lib/libcrypto.so.0.9.8: no version information available (required by pteidgui)
pteidgui: /usr/lib/libcrypto.so.0.9.8: no version information available (required by /usr/local/lib/libpteid.so.1)

$ ldd /usr/local/lib/libpteid.so.1.20.0
/usr/local/lib/libpteid.so.1.20.0: /usr/lib/libcrypto.so.0.9.8: no version information available (required by /usr/local/lib/libpteid.so.1.20.0)
linux-gate.so.1 => (0xffffe000)
libpteidlibopensc.so.1 => /usr/local/lib/libpteidlibopensc.so.1 (0xb7ebe000)
libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0xb7d77000)
libQtCore.so.4 => /usr/lib/qt4/libQtCore.so.4 (0xb7bdb000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7bc4000)
libstdc++.so.6 => /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6 (0xb7ada000)
libm.so.6 => /lib/libm.so.6 (0xb7ab4000)
libgcc_s.so.1 => /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgcc_s.so.1 (0xb7aa8000)
libc.so.6 => /lib/libc.so.6 (0xb7978000)
libpcsclite.so.1 => /usr/lib/libpcsclite.so.1 (0xb796e000)
libdl.so.2 => /lib/libdl.so.2 (0xb796a000)
libz.so.1 => /lib/libz.so.1 (0xb7956000)
librt.so.1 => /lib/librt.so.1 (0xb794d000)
/lib/ld-linux.so.2 (0xb7f33000)

Anybody can help me?


Last edited by Geek2010 on Thu Nov 20, 2008 3:04 am; edited 2 times in total
Back to top
View user's profile Send private message
Geek2010
n00b
n00b


Joined: 25 Apr 2007
Posts: 5
Location: Aveiro / Tondela

PostPosted: Thu Nov 20, 2008 3:03 am    Post subject: Reply with quote

well, I find one solution.
I apply one patch that find in official openssl forum:

--- openssl-0.9.8i/Configure
+++ openssl-0.9.8i/Configure
@@ -1329,6 +1329,8 @@
$shlib_minor=$2;
}

+$shared_ldflag .= " -Wl,--version-script=openssl.ld";
+
open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new";
open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n";
--- openssl-0.9.8i/openssl.ld
+++ openssl-0.9.8i/openssl.ld
@@ -0,0 +1,5 @@
+OPENSSL_0.9.8 {
+ global:
+ *;
+};
+
--- openssl-0.9.8i/engines/openssl.ld
+++ openssl-0.9.8i/engines/openssl.ld
@@ -0,0 +1,5 @@
+OPENSSL_0.9.8 {
+ global:
+ *;
+};
+

I will report this to bugzilla....
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 5577

PostPosted: Thu Nov 20, 2008 10:21 am    Post subject: Reply with quote

Please elaborate on 'official openssl forum' cause I couldn't find such.

BTW, this solution is, of course, completely wrong.
I'll wait for your answer before I'll put the correct (trivial) here.
Back to top
View user's profile Send private message
Geek2010
n00b
n00b


Joined: 25 Apr 2007
Posts: 5
Location: Aveiro / Tondela

PostPosted: Tue Dec 02, 2008 2:25 am    Post subject: Reply with quote

I'm based on this:
http://rt.openssl.org/Ticket/Display.html?id=1222&user=guest&pass=guest

well, isn't a "official openssl forum" but "OpenSSL Request Tracker".
I use this solution because is quick for I want (is mini project for university).

If you can put here the trivial and correct solution I appreciate.

tks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum