Update:  I noticed it was looking in the wrong path (/home/armckinn/...
etc).

I rebuilt the library without setting the --prefix in the ./config
command.

It then was looking for the shared library in
/usr/local/ssl/lib/engines/libubsec.so.
That directory didn't exist, so I created it and copied
/usr/lib/engines/*.so there.

Now the engine is found by this line of code:

   Engine = ENGINE_by_id ("ubsec");

But when I call this function:

   Return = ENGINE_set_default (Engine, ENGINE_METHOD_ALL);

I get an error similar to what I was seeing before; it can't find the
symbol
'ubsec_bytes_to_bits':

  error:2506406A:DSO support routines:DLFCN_BIND_FUNC:could not bind to
the requested symbol name (dso_dlfcn.c:261)
   -> symname(ubsec_bytes_to_bits):
/usr/local/ssl/lib/engines/libubsec.so: undefined symbol:
ubsec_bytes_to_bits  

error:2506C06A:DSO support routines:DSO_bind_func:could not bind to the
requested symbol name (dso_lib.c:294)  

error:80069067:ubsec engine:UBSEC_INIT:dso failure (e_ubsec.c:427)  

error:260B806D:engine routines:ENGINE_TABLE_REGISTER:init failed
(eng_table.c:161)

When I look in the library for that symbol, I get:

# nm /usr/local/ssl/lib/engines/libubsec.so | grep bytes
00004904 b p_UBSEC_ubsec_bits_to_bytes
000048fc b p_UBSEC_ubsec_bytes_to_bits

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin Del Vecchio
Sent: Thursday, October 27, 2005 2:34 PM
To: Geoff Thorpe; openssl-dev@openssl.org
Subject: RE: Problem using Broadcom uBSec engine in 0.9.8

You say "it should fall back to automatically searching the default path

to load the engine shared lib (libubsec.so)".  I guess this isn't
happening.

I found the uBSec shared library in /usr/lib/engines/libubsec.so.  I
added the following code to my test program to load it via the dynamic
engine:

   Engine = ENGINE_by_id ("dynamic");
   Return = ENGINE_ctrl_cmd_string (Engine, "SO_PATH",
"/usr/lib/engines/libubsec.so", 0);
   Return = ENGINE_ctrl_cmd_string (Engine, "LOAD", NULL, 0);

All of those functions return success.  Then I call:

   Return = ENGINE_set_default (Engine, ENGINE_METHOD_ALL);

And I get an error.  The dump of errors says:

error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared
library (dso_dlfcn.c:162)   ->
filename(/home/armckinn/svn/os/tmp/usr/lib/engines/libubsec.so): 
/home/armckinn/svn/os/tmp/usr/lib/engines/libubsec.so: 
cannot open shared object file: 
No such file or directory  

error:25070067:DSO support routines:DSO_load:could not load the shared
library (dso_lib.c:244)  

error:260B6084:engine routines:DYNAMIC_LOAD:dso not found
(eng_dyn.c:450)  

error:2606A074:engine routines:ENGINE_by_id:no such engine
(eng_list.c:411)
   -> id=ubsec  

error:2506406A:DSO support routines:DLFCN_BIND_FUNC:could not bind to
the requested symbol name (dso_dlfcn.c:261)   
-> symname(ubsec_bytes_to_bits): /usr/lib/engines/libubsec.so: undefined
symbol: ubsec_bytes_to_bits  

error:2506C06A:DSO support routines:DSO_bind_func:could not bind to the
requested symbol name (dso_lib.c:294)  

error:80069067:ubsec engine:UBSEC_INIT:dso failure (e_ubsec.c:427)  

error:260B806D:engine routines:ENGINE_TABLE_REGISTER:init failed
(eng_table.c:161)

-----Original Message-----
From: Geoff Thorpe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 25, 2005 9:25 PM
To: openssl-dev@openssl.org
Cc: Martin Del Vecchio
Subject: Re: Problem using Broadcom uBSec engine in 0.9.8

On October 25, 2005 11:06 am, Martin Del Vecchio wrote:
> I'm still looking for help with this problem.
>
> The uBSec support works in 0.9.7g with static linking.
> The uBSec support works in 0.9.7g with shared libraries.
> The uBSec support works in 0.9.8  with static linking.
> The uBSec support fails in 0.9.8  with shared libraries.

[snip]

> Here is the command line I use to build the test program:
>
> gcc -o test test.c  -I include ./libssl.a ./libcrypto.a -ldl
>
> It feels like this is such a major bug that it can't possibly be real,

> and I must be doing something wrong.

The problem is that if you do a "shared" build, the engines are built as
shared-libraries too - that is, this is now the case but wasn't under
0.9.7. Your code is calling ENGINE_load_ubsec() which doesn't exist in
libcrypto, because when you call ENGINE_by_id("ubsec") it should fall
back to automatically searching the default path to load the engine
shared lib (libubsec.so). Let me know if this isn't the case, but from
an initial glance that seems to be what you're hitting.

Cheers,
Geoff

--
Geoff Thorpe
[EMAIL PROTECTED]
http://www.geoffthorpe.net/

Self-interest and materialistic desire are parts of who we are, but not
all. To base a social and economic system on these traits is dangerously
fundamentalist.
  -- Joel Bakan

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to