push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,176 @@
{
stdenv,
lib,
fetchFromGitHub,
autoreconfHook,
autoconf-archive,
pkg-config,
doxygen,
perl,
openssl,
json_c,
curl,
libgcrypt,
cmocka,
uthash,
swtpm,
iproute2,
procps,
which,
libuuid,
libtpms,
}:
let
# Avoid a circular dependency on Linux systems (systemd depends on tpm2-tss,
# tpm2-tss tests depend on procps, procps depends on systemd by default). This
# needs to be conditional based on isLinux because procps for other systems
# might not support the withSystemd option.
procpsWithoutSystemd = procps.override { withSystemd = false; };
procps_pkg = if stdenv.hostPlatform.isLinux then procpsWithoutSystemd else procps;
in
stdenv.mkDerivation (finalAttrs: {
pname = "tpm2-tss";
version = "4.1.3";
src = fetchFromGitHub {
owner = "tpm2-software";
repo = finalAttrs.pname;
rev = finalAttrs.version;
hash = "sha256-BP28utEUI9g1VNv3lCXuiKrDtEImFQxxZfIjLiE3Wr8=";
};
outputs = [
"out"
"man"
"dev"
];
nativeBuildInputs = [
autoreconfHook
autoconf-archive
pkg-config
doxygen
perl
];
buildInputs = [
openssl
json_c
curl
libgcrypt
uthash
libuuid
libtpms
]
# cmocka is checked in the configure script
# when unit and/or integration testing is enabled
# cmocka doesn't build with pkgsStatic, and we don't need it anyway
# when tests are not run
++ lib.optional finalAttrs.doInstallCheck cmocka;
nativeInstallCheckInputs = lib.optionals finalAttrs.doInstallCheck [
cmocka
which
openssl
procps_pkg
iproute2
swtpm
];
strictDeps = true;
preAutoreconf = "./bootstrap";
enableParallelBuilding = true;
patches = [
# Do not rely on dynamic loader path
# TCTI loader relies on dlopen(), this patch prefixes all calls with the output directory
./no-dynamic-loader-path.patch
# Configure script expects tools from shadow (e.g. useradd) but they are
# actually optional (and we cant use them in Nix sandbox anyway). Make the
# check in configure.ac a warning instead of an error so that we can run
# configure phase on platforms that dont have shadow package (e.g. macOS).
# Note that *on platforms* does not mean *for platform* i.e. this is for
# cross-compilation, tpm2-tss does not support macOS, see upstream issue:
# https://github.com/tpm2-software/tpm2-tss/issues/2629
# See also
# https://github.com/tpm2-software/tpm2-tss/blob/6c46325b466f35d40c2ed1043bfdfcfb8a367a34/Makefile.am#L880-L898
./no-shadow.patch
];
postPatch = ''
patchShebangs script
substituteInPlace src/tss2-tcti/tctildr-dl.c \
--replace-fail '@PREFIX@' $out/lib/
substituteInPlace ./test/unit/tctildr-dl.c \
--replace-fail '@PREFIX@' $out/lib/
substituteInPlace ./bootstrap \
--replace-fail 'git describe --tags --always --dirty' 'echo "${finalAttrs.version}"'
for src in src/tss2-tcti/tcti-libtpms.c test/unit/tcti-libtpms.c; do
substituteInPlace "$src" \
--replace-fail '"libtpms.so"' '"${libtpms.out}/lib/libtpms.so"' \
--replace-fail '"libtpms.so.0"' '"${libtpms.out}/lib/libtpms.so.0"'
done
substituteInPlace src/tss2-fapi/ifapi_config.c \
--replace-fail 'SYSCONFDIR' '"/etc"'
''
# tcti tests rely on mocking function calls, which appears not to be supported
# on clang
+ lib.optionalString stdenv.cc.isClang ''
sed -i '/TESTS_UNIT / {
/test\/unit\/tcti-swtpm/d;
/test\/unit\/tcti-mssim/d;
/test\/unit\/tcti-device/d
}' Makefile-test.am
'';
configureFlags =
lib.optionals finalAttrs.doInstallCheck [
"--enable-unit"
"--enable-integration"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# sys/prctl.h required
"--disable-tcti-cmd"
# uchar.h required
"--disable-fapi"
"--disable-policy"
# uses fallocate
"--disable-tcti-libtpms"
];
postInstall = ''
# Do not install the upstream udev rules, they rely on specific
# users/groups which aren't guaranteed to exist on the system.
rm -R $out/lib/udev
# write fapi-config suitable for testing
cat > $out/etc/tpm2-tss/fapi-config-test.json <<EOF
{
"profile_dir": "${placeholder "out"}/etc/tpm2-tss/fapi-profiles/",
"system_pcrs" : []
}
EOF
'';
doCheck = false;
doInstallCheck =
stdenv.buildPlatform.canExecute stdenv.hostPlatform
&& !stdenv.hostPlatform.isDarwin
# Tests rely on mocking, which can't work with static libs.
&& !stdenv.hostPlatform.isStatic;
# Since we rewrote the load path in the dynamic loader for the TCTI
# The various tcti implementation should be placed in their target directory
# before we could run tests, so we make turn checkPhase into installCheckPhase
installCheckTarget = "check";
meta = with lib; {
description = "OSS implementation of the TCG TPM2 Software Stack (TSS2)";
homepage = "https://github.com/tpm2-software/tpm2-tss";
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = with maintainers; [ baloo ];
};
})

View File

@@ -0,0 +1,505 @@
diff --git a/src/tss2-tcti/tctildr-dl.c b/src/tss2-tcti/tctildr-dl.c
index d26219d2..92d2b6a3 100644
--- a/src/tss2-tcti/tctildr-dl.c
+++ b/src/tss2-tcti/tctildr-dl.c
@@ -88,14 +88,24 @@ handle_from_name(const char *file,
const char *formats[] = {
/* <name> */
"%s",
+ /* <name> */
+ "@PREFIX@" "%s",
/* libtss2-tcti-<name>.so.0 */
FMT_TCTI_PREFIX "%s" FMT_LIB_SUFFIX_0,
+ /* libtss2-tcti-<name>.so.0 */
+ "@PREFIX@" FMT_TCTI_PREFIX "%s" FMT_LIB_SUFFIX_0,
/* libtss2-tcti-<name>.so */
FMT_TCTI_PREFIX "%s" FMT_LIB_SUFFIX,
+ /* libtss2-tcti-<name>.so */
+ "@PREFIX@" FMT_TCTI_PREFIX "%s" FMT_LIB_SUFFIX,
/* libtss2-<name>.so.0 */
FMT_TSS_PREFIX "%s" FMT_LIB_SUFFIX_0,
+ /* libtss2-<name>.so.0 */
+ "@PREFIX@" FMT_TSS_PREFIX "%s" FMT_LIB_SUFFIX_0,
/* libtss2-<name>.so */
FMT_TSS_PREFIX "%s" FMT_LIB_SUFFIX,
+ /* libtss2-<name>.so */
+ "@PREFIX@" FMT_TSS_PREFIX "%s" FMT_LIB_SUFFIX,
};
if (handle == NULL) {
diff --git a/test/unit/tctildr-dl.c b/test/unit/tctildr-dl.c
index 135e1b14..7d654d1f 100644
--- a/test/unit/tctildr-dl.c
+++ b/test/unit/tctildr-dl.c
@@ -168,6 +168,10 @@ test_handle_from_name_second_dlopen_success (void **state)
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_A);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_B);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, TEST_HANDLE);
@@ -186,10 +190,18 @@ test_handle_from_name_third_dlopen_success (void **state)
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_A);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_B);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_B);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_C);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, TEST_HANDLE);
@@ -208,14 +220,26 @@ test_handle_from_name_fourth_dlopen_success (void **state)
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_A);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_B);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_B);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_C);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_C);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_D);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, TEST_HANDLE);
@@ -234,18 +258,34 @@ test_handle_from_name_fifth_dlopen_success (void **state)
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_A);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_B);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_B);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_C);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_C);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_D);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" TEST_TCTI_TRY_D);
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, TEST_TCTI_TRY_E);
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, TEST_HANDLE);
@@ -281,22 +321,42 @@ test_get_info_default_success (void **state)
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-default.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-default.so.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-default.so.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-default.so.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-default.so.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-default.so.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-default.so.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-default.so.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-default.so.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-tcti-tabrmd.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, HANDLE);
@@ -321,22 +381,42 @@ test_get_info_default_info_fail (void **state)
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-default.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-default.so.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-default.so.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-default.so.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-default.so.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-default.so.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-default.so.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-default.so.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-default.so.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
+
expect_string(__wrap_dlopen, filename, "libtss2-tcti-tabrmd.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, HANDLE);
@@ -483,120 +563,225 @@ test_tcti_fail_all (void **state)
expect_string(__wrap_dlopen, filename, "libtss2-tcti-default.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-default.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-default.so.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-default.so.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-default.so.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-default.so.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-default.so.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-default.so.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-default.so.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-default.so.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
/* Skip over libtss2-tcti-tabrmd.so */
expect_string(__wrap_dlopen, filename, "libtss2-tcti-tabrmd.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-tabrmd.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-tabrmd.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-tabrmd.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-tabrmd.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-tabrmd.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-tabrmd.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-tabrmd.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-tabrmd.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-tabrmd.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
/* Skip over libtss2-tcti-device.so, /dev/tpmrm0 */
expect_string(__wrap_dlopen, filename, "libtss2-tcti-device.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-device.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-device.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-device.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-device.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-device.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-device.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-device.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-device.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-device.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
/* Skip over libtss2-tcti-device.so, /dev/tpm0 */
expect_string(__wrap_dlopen, filename, "libtss2-tcti-device.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-device.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-device.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-device.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-device.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-device.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-device.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-device.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-device.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-device.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
/* Skip over libtss2-tcti-device.so, /dev/tcm0 */
expect_string(__wrap_dlopen, filename, "libtss2-tcti-device.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-device.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-device.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-device.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-device.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-device.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-device.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-device.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-device.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-device.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
/* Skip over libtss2-tcti-swtpm.so */
expect_string(__wrap_dlopen, filename, "libtss2-tcti-swtpm.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-swtpm.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-swtpm.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-swtpm.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-swtpm.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-swtpm.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-swtpm.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-swtpm.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-swtpm.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-swtpm.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
/* Skip over libtss2-tcti-mssim.so */
expect_string(__wrap_dlopen, filename, "libtss2-tcti-mssim.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-mssim.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-mssim.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-mssim.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-libtss2-tcti-mssim.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-libtss2-tcti-mssim.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-mssim.so.0.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-mssim.so.0.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-libtss2-tcti-mssim.so.0.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-libtss2-tcti-mssim.so.0.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
TSS2_RC r;
TSS2_TCTI_CONTEXT *tcti;
@@ -619,18 +804,33 @@ test_info_from_name_handle_fail (void **state)
expect_string(__wrap_dlopen, filename, "foo");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "foo");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-foo.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-foo.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-foo.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-foo.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-foo.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-foo.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-foo.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-foo.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
TSS2_RC rc = info_from_name ("foo", &info, &data);
assert_int_equal (rc, TSS2_TCTI_RC_NOT_SUPPORTED);
@@ -741,18 +941,33 @@ test_tctildr_get_info_from_name (void **state)
expect_string(__wrap_dlopen, filename, "foo");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "foo");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-foo.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-foo.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-tcti-foo.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-tcti-foo.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-foo.so.0");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-foo.so.0");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
expect_string(__wrap_dlopen, filename, "libtss2-foo.so");
expect_value(__wrap_dlopen, flags, RTLD_NOW);
will_return(__wrap_dlopen, NULL);
+ expect_string(__wrap_dlopen, filename, "@PREFIX@" "libtss2-foo.so");
+ expect_value(__wrap_dlopen, flags, RTLD_NOW);
+ will_return(__wrap_dlopen, NULL);
TSS2_RC rc = tctildr_get_info ("foo", &info, &data);
assert_int_equal (rc, TSS2_TCTI_RC_NOT_SUPPORTED);

View File

@@ -0,0 +1,16 @@
diff --git a/configure.ac b/configure.ac
index e2d579b8..0eac4ff3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -672,9 +672,9 @@ AS_IF([test "$HOSTOS" = "Linux" && test "x$systemd_sysusers" != "xyes"],
AC_CHECK_PROG(adduser, adduser, yes)
AC_CHECK_PROG(addgroup, addgroup, yes)
AS_IF([test "x$addgroup" != "xyes" && test "x$groupadd" != "xyes" ],
- [AC_MSG_ERROR([addgroup or groupadd are needed.])])
+ [AC_MSG_WARN([addgroup or groupadd are needed.])])
AS_IF([test "x$adduser" != "xyes" && test "x$useradd" != "xyes" ],
- [AC_MSG_ERROR([adduser or useradd are needed.])])])
+ [AC_MSG_WARN([adduser or useradd are needed.])])])
AC_SUBST([PATH])