Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinuxTpmDevice constructor fails on Docker image : DllImport libtss2-tcti-tabrmd.so on Linux #193

Open
Degarollo opened this issue Apr 19, 2024 · 0 comments

Comments

@Degarollo
Copy link

[DllImport("libtss2-tcti-tabrmd.so", CallingConvention = CallingConvention.Cdecl)]

On what I understand, it doesn't seems to be usefull to add "lib" before the library name (as it is a standard naming convensions on linux for library files).

When running on Linux or macOS, the runtime will try prepending lib and appending the canonical shared library extension. On these OSes, library name variations are tried in the following order
Source : Library name variations

It can result in having this error message with a double "liblib" (liblibtss2-tcti-tabrmd.so) when the exact file is not found (for example if the library file is libtss2-tcti-tabrmd.so.0, or libtss2-tcti-tabrmd.so.0.0.0):

Exception while loading tpm2-abrmd: System.DllNotFoundException: Unable to load shared library 'libtss2-tcti-tabrmd.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibtss2-tcti-tabrmd.so: cannot open shared object file: No such file or directory

My quickfix is to :

  • apt-get install -y libtss2-tcti-tabrmd0 will create libtss2-tcti-tabrmd.so.0 (that is not found with this dll import and gives the message above).
  • cp /usr/lib/x86_64-linux-gnu/libtss2-tcti-tabrmd.so.0 /usr/lib/x86_64-linux-gnu/libtss2-tcti-tabrmd.so or cp /usr/lib/x86_64-linux-gnu/libtss2-tcti-tabrmd.so.0 /usr/lib/x86_64-linux-gnu/liblibtss2-tcti-tabrmd.so

Is there a better workaround?

Thank you in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant