<div dir="auto">Hi,<div dir="auto">Thanks for your reply.</div><div dir="auto">Openssl only passes (ctx,type,arg,ptr) in the case of header and (ctx,out,in,inl) in the case of message, these two are the only links to engine after the handshake process for the whole process. In my case, I am downloading a file from nginx root directory using a client program. How can I get a unique id, so that I can copy the respective Key and Iv everytime when a sslwrite request comes from a client with that id. Because I am trying to run 3 clients simultaneously for downloading a file. I am able to download only at one client ,the last connected one, and other two shows that tag verification failed. Because both those connections got the same key and Iv of the last connection. </div><div dir="auto">   So for every client connection, is there any way to get a unique id so that i can load respective Key and Iv. But the only link from openssl to the engine are the above mentioned two cases. Only what I am getting some other information is from <b>ctx</b>. Can I do something with that <b>ctx </b>get unique id. </div><div dir="auto"><br></div><div dir="auto">Thanks</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed 12 Dec, 2018, 7:56 PM Jakob Bohm via openssl-users <<a href="mailto:openssl-users@openssl.org">openssl-users@openssl.org</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 12/12/2018 12:54, ASHIQUE CK wrote:<br>
> Hi,<br>
> Any help on this ?<br>
><br>
> On Wed, Dec 12, 2018 at 3:03 PM ASHIQUE CK <<a href="mailto:ckashiquekvk@gmail.com" target="_blank" rel="noreferrer">ckashiquekvk@gmail.com</a> <br>
> <mailto:<a href="mailto:ckashiquekvk@gmail.com" target="_blank" rel="noreferrer">ckashiquekvk@gmail.com</a>>> wrote:<br>
><br>
>     Hi,<br>
>     We are using a Crypto Accelerator Engine to offload AESGCM and RSA<br>
>     parameters. Trying to connect multiple clients simultaneously with<br>
>     a single Nginx server, which is using this accelerator.  The Key<br>
>     and IV is passing only at handshake, and after handshake this set<br>
>     of key and IV is using for all encryption and decryption. So at<br>
>     Engine side, we are storing this Key and IV to a buffer and while<br>
>     encrypting/decrypting , this Key and IV is used from this buffer.<br>
>     But, while multiple client connects, the last saved Key/IV is<br>
>     getting for all clients.<br>
>             So, is there any way to get a unique ID foer each client<br>
>     connection ?<br>
><br>
><br>
The following assumes that the accelerator is accessed using an<br>
OpenSSL "engine" plugin, if instead you are inserting code in NGINX<br>
to hand over the complete SSL/TLS record processing to the hardware,<br>
then a different approach is needed.<br>
<br>
OpenSSL Crypto Engines are not limited to SSL/TLS but can be used<br>
for other tasks using the OpenSSL libcrypto library.<br>
<br>
Thus the way this works is that the SSL/TLS requests an EVP "handle"<br>
for each key that it wants to use, this handle then maps (indirectly)<br>
to a structure passed to the engine, which is unique to each key.<br>
<br>
A correctly implemented engine is supposed to use that structure to<br>
tell the difference between different keys stored in the actual<br>
hardware.<br>
<br>
For the case of GCM key/IV pairs, it may be that in some situations<br>
OpenSSL requests more than one EVP key instance for the same key,<br>
typically to allow each to have its own independent state (for GCM,<br>
this is the counter, for CBC it would be the IV chaining from block<br>
to block).  The simple solution is to just treat them as different<br>
keys, but if this uses too many hardware key storage locations, an<br>
engine may use some way to recognize the reused key, share the<br>
hardware object and keep count of how many "handles" point to that<br>
key.<br>
<br>
<br>
<br>
Enjoy<br>
<br>
Jakob<br>
-- <br>
Jakob Bohm, CIO, Partner, WiseMo A/S.  <a href="https://www.wisemo.com" rel="noreferrer noreferrer" target="_blank">https://www.wisemo.com</a><br>
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10<br>
This public discussion message is non-binding and may contain errors.<br>
WiseMo - Remote Service Management for PCs, Phones and Embedded<br>
<br>
-- <br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</blockquote></div>