Hi,

I'm trying to use an engine to compute the private and public key for RSA.
However the finish method of my implemented structure is never called. I use
SSL_connect() function with ssl_v3

static RSA_METHOD raw_rsa =    {
    "RAW RSA method",
    pub_enc, 
    pub_dec,
    priv_enc, 
    priv_dec,
    NULL, 
    NULL, 
    NULL,NULL,
    rsa_init,      /*init*/
    rsa_finish,      /*finish*/
    0,  
    NULL,  
    NULL, 
    NULL,  
    NULL     
};

I suspected the ssl_cert_dup() function which add a lock for private key:
                if (cert->pkeys[i].privatekey != NULL)
                        {
                        ret->pkeys[i].privatekey = cert->pkeys[i].privatekey;
                        CRYPTO_add(&ret->pkeys[i].privatekey->references, 1,
                                CRYPTO_LOCK_EVP_PKEY);
Indeed, by commenting the last line, I can access to the finish method when
I close my connection. But the saved (using RSA_set_ex_data) are removed
before(RSA_get_ex_data returns NULL).

I'm using openssl_1.0.1e. The same behavior was seen with 1.0.1c
Any suggestions or hint?

Regards
TheMoud




--
View this message in context: 
http://openssl.6102.n7.nabble.com/Engine-finish-method-for-RSA-engine-is-never-called-tp48408.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [email protected]

Reply via email to