<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Btw i have verified that in openssl command line tool if i switch order from the one that worked for me:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
OpenSSL> engine dynamic -pre SO_PATH:/usr/lib/engines-1.1/libpkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/libckteec.so<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
to the one that was in the code:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
OpenSSL> engine dynamic -pre SO_PATH:/usr/lib/engines-1.1/libpkcs11.so -pre MODULE_PATH:/usr/lib/libckteec.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
the error is the same as for me in the C# code. So the question is if you are telling me that the proper order is like that:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
dynamic --> set SO_PATH --> LOAD and then set all parameters of
<div>the engine that SO_PATH implements.</div>
<div><br>
</div>
does the order which i used is also correct one?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
BR</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Piotr</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Od:</b> openssl-users <openssl-users-bounces@openssl.org> w imieniu użytkownika Piotr Lobacz <piotr.lobacz@softgent.com><br>
<b>Wysłane:</b> środa, 26 maja 2021 22:32<br>
<b>Do:</b> Selva Nair <selva.nair@gmail.com><br>
<b>DW:</b> openssl-users@openssl.org <openssl-users@openssl.org><br>
<b>Temat:</b> ODP: dynamic engine load</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Yeah,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
that is what i have figured it out and written it in my previous message:] but big thx for help.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
BR</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Piotr Lobacz</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Od:</b> Selva Nair <selva.nair@gmail.com><br>
<b>Wysłane:</b> środa, 26 maja 2021 15:52<br>
<b>Do:</b> Piotr Lobacz <piotr.lobacz@softgent.com><br>
<b>DW:</b> openssl-users@openssl.org <openssl-users@openssl.org><br>
<b>Temat:</b> Re: dynamic engine load</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_PlainText">Hi,<br>
<br>
On Wed, May 26, 2021 at 9:25 AM Piotr Lobacz <piotr.lobacz@softgent.com> wrote:<br>
><br>
> Hi all,<br>
> I am trying to write a function which will load dynamic engine for pkcs11. What i intendt to do is not to use engine id pkcs11 but dynamic. The problem is that i get an error for ENGINE_ctrl_cmd_string with MODULE_PATH parameter. My function currently looks
 like this:<br>
><br>
>         public void Initialize()<br>
>         {<br>
>             if (null == engine)<br>
>             {<br>
>                 engine = SafeNativeMethods.ENGINE_by_id("dynamic");<br>
>                 if (engine.IsInvalid)<br>
>                 {<br>
>                     throw new InvalidOperationException($"Unable to load dynamic engine");<br>
>                 }<br>
><br>
>                 if (!File.Exists(EnginePath))<br>
>                 {<br>
>                     throw new InvalidOperationException($"Unable to find engine library path");<br>
>                 }<br>
><br>
>                 if (1 != SafeNativeMethods.ENGINE_ctrl_cmd_string(engine, "SO_PATH", EnginePath, 0))<br>
>                 {<br>
>                     throw new InvalidOperationException("dynamic: setting so_path <= '{EnginePath}'");<br>
>                 }<br>
<br>
At this point you should do the "LOAD" control to get the dynamic<br>
engine shell replaced by pkcs11. Then set the ID and the MODULE_PATH.<br>
<br>
So its dynamic --> set SO_PATH --> LOAD and then set all parameters of<br>
the engine that SO_PATH implements.<br>
<br>
Selva<br>
<br>
<br>
Selva<br>
</div>
</span></font></div>
<a href="https://www.softgent.com" target="_blank"><img width="150" height="50" src="https://softgent.com/wp-content/uploads/2020/01/Zasob-14.png"></a>
<p style="color:gray; display:block; font-size:9px; text-transform:uppercase; margin:0; margin-top:10px">
<b>Softgent Sp. z o.o.</b>, Budowlanych 31d, 80-298 Gdansk, POLAND</p>
<p style="color:gray; display:block; font-size:9px; text-transform:uppercase; margin:0">
KRS: 0000674406, NIP: 9581679801, REGON: 367090912</p>
<p style="color:gray; display:block; font-size:9px; text-transform:uppercase; margin:0">
www.softgent.com</p>
<p style="color:gray; display:block; font-size:9px; text-transform:uppercase; margin:0; margin-top:10px">
Sąd Rejonowy Gdańsk-Północ w Gdańsku, VII Wydział Gospodarczy Krajowego Rejestru Sądowego</p>
<p style="color:gray; display:block; font-size:9px; text-transform:uppercase; margin:0">
KRS 0000674406, Kapitał zakładowy: 25 000,00 zł wpłacony w całości.</p>
</div>
</body>
</html>