AnsweredAssumed Answered

Using the A71CH/SE050 with multiple applications using the OpenSSL Engine

Question asked by Tobias Büning on May 28, 2020
Latest reply on May 29, 2020 by Kan_Li



right now we have the problem that only one application at a time can use the Secure Element. We are using the Legacy OpenSSL Engine for the A71CH that comes with the newest version of the Plug&Trust Middleware (02.14.00). Everything is fine when I just run 'openssl rand -hex 10':


But when I start two different processes in the background like this: 'openssl rand -hex 10 & openssl rand -hex 10 &' then the connection fails:

The Terminal freezes and I have to get out using 'Ctrl + C'.


I have looked at the code and discovered that there is a function 'CryptoIpc_mutexInit in the simw-top/hostlib/hostLib/embSeEngine/src/ax_cryptoIpc.c file (Ipc probably stands for inter process communication?). So it seems to me that there is already code which solves this problem, right?


My current understanding is that the function will immediately return zero since the TGT_A71CH symbol gets defined in the cmake_options.cmake file by default. Therefore I removed the definition of TGT_A71CH in the cmake_options.cmake file and re-compiled the engine but nothing changed. So my question is the following: How can we use this code? Is it even complete (there are some TODO comments in the ax_cryptoIpc.c file)? Our expectation would be that we can start two processes which are using the Engine one of them gets the Mutex Lock and the second process waits for the first process to finish. After that the second process will get the Mutex and can do its work.