<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="auto"><div dir="auto"><div>Hello Andreas,</div><div><br></div><div>I used smth like<br>=======</div><div dir="auto">RSA_METHOD my_rsa_method = {</div><div dir="auto">    "My RSA method",</div><div dir="auto">    0,                          /* pub_enc */</div><div dir="auto">    0,                          /* pub_dec */</div><div dir="auto">    0,          /* priv_enc */</div><div dir="auto">    my_priv_dec,          /* priv_dec */</div><div dir="auto">    0,                          /* rsa_mod_exp */</div><div dir="auto">    0,                          /* bn_mod_exp */</div><div dir="auto">    0,                          /* init */</div><div dir="auto">    0,              /* finish */</div><div dir="auto">    RSA_METHOD_FLAG_NO_CHECK|RSA_FLAG_SIGN_VER,          /* flags */</div><div dir="auto">    NULL,                       /* app_data */</div><div dir="auto">    my_rsa_sign,              /* rsa_sign */</div><div dir="auto">    0                           /* rsa_verify */</div><div dir="auto">};</div><div dir="auto"><br></div><div dir="auto">static int my_priv_dec (int flen, const unsigned char *from,</div><div dir="auto">    unsigned char *to, RSA *rsa, int padding)</div><div dir="auto">{</div><div dir="auto">  const RSA_METHOD *def_meth = RSA_PKCS1_SSLeay();</div><div dir="auto">  if ((rsa->meth == &my_rsa_method) && RSA_get_ex_data(rsa, my_key_pos))</div><div dir="auto">  {</div><div dir="auto">    return my_op_rsa_decrypt(flen, from, to, rsa, padding);</div><div dir="auto">  }</div><div dir="auto"><br></div><div dir="auto">  return def_meth->rsa_priv_dec(flen, from, to, rsa, padding);</div><div dir="auto">}</div><div>==============</div><div>But this code worked for 1.0.* branch</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 19 марта 2019 г., 19:52 Fuchs, Andreas <<a href="mailto:andreas.fuchs@sit.fraunhofer.de" rel="noreferrer" target="_blank">andreas.fuchs@sit.fraunhofer.de</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Following scenario:<br>
<br>
I have an engine that implements e.g. RSA decryption.<br>
That engine links against a library that links against libcrypto to perform RSA decryption.<br>
<br>
Now if I have an application that sets the default library to be my engine, won't I end up in an infinite loop ?<br>
<br>
Or the other way around:<br>
- Is there a way to change the default engine from within my engine before calling out to the library ?<br>
- Can the library itself select "software-only" as an engine ?<br>
<br>
I guess I don't have a concrete problem in my specific case, since I have app_data attached to any key and<br>
if my engine receives a key without app_data, it will just call SSLeay() functions.<br>
<br>
But what if that was not the case ?<br>
<br>
Thanks a lot for any help,<br>
Andreas</blockquote></div></div>
</div></div></div>