Title: Fault tolerance

Hi all,


I'd like to know the better way to be fault tolerant when using a cryto accelerator through an engine.

In fact, we want to redirect all crypto computations provided by our engine to soft ones when an error occured in our engine.
In our crypto function, i try:

        - catch the error
        - alert for crypto accelerator error
        - get first engine (should be openssl one)
        - set all pointer from our engine to openssl soft (openssl engine)
        - try again to perform the request operation (with openssl soft)
       
The only problem is when i want to set all the pointers from our engine to openssl soft. (i'd like to do it in the proper way)
I try:
        ENGINE *soft_openssl = ENGINE_get_first () ;
        ENGINE_set_default ( soft_openssl, ENGINE_METHOD_ALL ) ;

But this doesn't seems to work!

However something more bad codded works fine:  
        ENGINE *soft_openssl = ENGINE_get_first () ;
        engine_zencod = *soft_openssl ;

        /* engine_zencod is declared as follows
        static ENGINE engine_zencod = {
                "zencod",
                "ZENCOD hardware engine support",
                ...
        } ;
         */

Is there a better way?
Should i use the "ctrl" function?
I'm afraid, that the upper application will not take care of resulting error and retry it in soft!


Thanks in advance

fred

Reply via email to