Hi,
Currently I've an application that creates keys, certificate requests 
and certificates using NFast and openssl-0.9.5.
I've updated my code to use the openssl-engine.
Everything works perferctly with some modifications.
Now, I would like to use the ENGINE concept with my NFast.
I've already understood that the identifier of my ENGINE is chil and 
I've wrote some code to test if I can have a new pointer to a ENGINE 
structure.
What I would like to know is how to use this ENGINE pointer with my 
existing code, for example, what are the commands available for the 
NFAST. I've tried this little code but it doesn't work.

#include <openssl/engine.h>
#include <openssl/bio.h>

int main(int argc,char* argv[])
{
    ENGINE *e;
    BIO *err;
   
    ENGINE_load_builtin_engines();
    if ((e = ENGINE_by_id(argv[1])) == NULL)
    {
        fprintf(stderr,"Error for: %s\n",argv[1]);
        return -1;
    }
   
    err = BIO_new_fp(stderr,BIO_NOCLOSE);
    if(!ENGINE_set_default(e, ENGINE_METHOD_ALL))
            {
            BIO_printf(err,"can't use that engine\n");
            ERR_print_errors(err);
            ENGINE_free(e);
            return -1;
            }
    BIO_printf(err,"engine \"%s\" set.\n", ENGINE_get_id(e));


    if (ENGINE_ctrl_cmd_string(e,"get_passphrase","Password:",0) == 0)
            {
            ERR_print_errors(err);
            ENGINE_free(e);
            return -1;
            }

        /* Free our "structural" reference. */
    ENGINE_free(e);
   
    return 0;
}

The output is has follows:
engine "chil" set.
25983:error:260AC089:engine routines:func(172):reason(137):eng_ctrl.c:136:
25983:error:260AB089:engine routines:func(171):reason(137):eng_ctrl.c:314:

I need to ask passwords in order to have my NFast working.
How can I do that ?

Thanks

Michiels Olivier

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to