<div dir="ltr">Dear Mahendra,<div><br></div><div>Take a look at the load_key function in the apps/apps.c as a referent example.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 2:34 PM Mahendra SP <<a href="mailto:mahendra.sp@gmail.com">mahendra.sp@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>While writing the engine implementation for private key encryption and decryption, I need to get the private key from external source. </div><div><div>ENGINE_set_load_privkey_function(e, load_tpm_private_key)<br></div><div>Above API is success.<br></div><div><br></div><div></div></div><div></div><div>RSA structure is as below.</div><div>RSA_METHOD my_rsa_struct =<br>{<br> "MY RSA method",<br> NULL,<br> NULL,<br> MyRSAPrivEnc,<br> MyRSAPrivDec,<br> NULL, <br> NULL,<br> NULL, <br> NULL,<br> 0, <br> NULL,<br> NULL,<br> NULL,<br> NULL<br>};<br></div><div><br></div><div>However, the routine
load_tpm_private_key does not get invoked during private key encryption and decryption.<br></div><div>Private key encryption and decryption gets routed to the above overloaded routines namely "
MyRSAPrivEnc
" and "
MyRSAPrivDec". But
load_tpm_private_key never gets invoked. </div><div><br></div><div>Is there a flag to force the same ? I have tried it using openssl 1.0.2 version. All other engine calls work as expected, but not this one. </div><div><br></div><div>I have also tried to debug in ENGINE_load_private_key in eng_pkey.c file. I dont see this function getting invoked. In this function, the private key callback set above gets invoked.</div><div> </div><div>Please suggest if I am missing something here.</div><div><br></div><div>Thanks</div><div>Mahendra</div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">SY, Dmitry Belyavsky</div>