Skip to content

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

@Degarollo

Description

@Degarollo

[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions