Commit Graph

58 Commits

Author SHA1 Message Date
Markus Theil
86293d257e tpm2-tss: 4.1.3 -> 4.2.0
Bump due to security fixes:
https://github.com/tpm2-software/tpm2-tss/releases/tag/4.2.0

Adapted patches and removed already upstream ones.

Signed-off-by: Markus Theil <theil.markus@gmail.com>
2026-07-29 11:36:59 +02:00
K900
db6a864679 tpm2-tss: don't test on 32-bit
swtpm doesn't build on 32-bit targets so we can't run the tests.
2026-06-28 17:18:23 +03:00
John Soo
12979e3aca tpm2-tss: Fix build on darwin
Always ensure $out/etc/tpm2-tss exists lest writing
fapi-config-test.json fail (when fapi is disabled on darwin).
2026-03-09 16:55:33 -06:00
Marcin Serwin
21a6fe80c2 tpm2-tss: fix tests with cmocka 2
Related to: https://github.com/NixOS/nixpkgs/pull/467954
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2026-01-09 21:11:19 +01:00
Ihar Hrachyshka
567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
Scott Stephens
7f6efaf59c tpm2-tss: add scottstephens to maintainers 2025-10-15 11:13:12 -04:00
Scott Stephens
fa63c18d88 tpm2-tss: change default path of fapi config file
The default path is hard-coded at compile time. Previously it pointed to
a location inside the nix store, which made it necessary to use
environment variables to specify the path to a user-specified file.

The nature of the config file is such that it's not possible to specify
one that works for every system this package may be installed in, so
user-configuration is usually necessary.

The default is now /etc/tpm2-tss/fapi-config.json, which
is more compatible with non-nixos config conventions. NixOS
compatibility is now accomplished by linking from the well-known
location to a config file in the nix store.
2025-09-15 14:55:20 -04:00
Scott Stephens
40f65d3387 tpm2-tss: add FAPI config for testing 2025-09-15 14:55:20 -04:00
secufoe
5930fdcb6c tpm2-tss: use finalAttrs for overriding doInstallCheck 2025-08-04 12:35:40 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Fiona Behrens
e3c24c24fe tpm2-tss: disable tcti-libtpms on darwin
Add the `--disable-tcti-libtpms` config flag if build on darwin.
This was already done in a pr that also introduced darwin support for
tpm2-tss[0] but a earlier one was merged[1]

[0]: https://github.com/NixOS/nixpkgs/pull/370516
[1]: https://github.com/NixOS/nixpkgs/pull/365010
2025-05-18 14:56:54 +02:00
Winter
a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00
Pol Dellaiera
65a333600d treewide: replace rev with tag 2025-04-07 16:57:22 +02:00
Alyssa Ross
212aaa22fb tpm2-tss: disable tests for static builds 2025-02-06 12:09:31 +01:00
John Soo
890829e256 tpm2-tss: enable darwin builds
Some features are turned off, but this does allow compiling against
tpm2-tss as a library.
2024-12-14 09:39:30 -08:00
Silvan Mosberger
667d42c00d treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev 57b193d8dd
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:27:17 +01:00
Arthur Gautier
7b55da73c0 pkgsLLVM.tpm2-tss: fixup tests 2024-11-09 14:09:31 -08:00
Arthur Gautier
17dd29c926 tpm2-tss: adds support for libtpms backend 2024-10-26 13:10:25 -07:00
Peder Bergebakken Sundt
4b43b3c102 tpm2-tss: use stdenv.buildPlatform.canExecute 2024-10-21 11:47:20 +02:00
Artturin
f0e657f3b1 Merge branch 'master' into staging-next 2024-09-25 06:05:01 +03:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Markus Theil
7ceece975d tpm2-tss: test with better maintained swtpm
Switch tpm2-tss to swtpm, which is more widely used than the IBM one.
tpm2-tss contains tests for both TPM 2.0 emulators.

This fixes a failing test, with the updated IBM sw tpm version.

Signed-off-by: Markus Theil <theil.markus@gmail.com>
2024-09-16 09:44:41 +02:00
Ivan Trubach
79581b8279 tpm2-tss: remove shadow dependency
Fixes `tpm2-tss (cross-)build on macOS since shadow package is
Linux-specific and therefore cannot be used in nativeBuildInputs.
2024-08-02 18:03:01 +03:00
Arthur Gautier
ef3d271c3b tpm2-tss: 4.1.2 -> 4.1.3 (#313445) 2024-05-22 15:51:21 +00:00
Arthur Gautier
b24bf79b6c tpm2-tss: 4.1.1 -> 4.1.2 2024-05-15 09:39:21 -07:00
Arthur Gautier
ea42490910 tpm2-tss: 4.1.0 -> 4.1.1 2024-05-07 10:18:33 -07:00
Arthur Gautier
5a92d56689 tpm2-tss: 4.0.1 -> 4.1.0
Because upstream rewrote the loader for TCTI, the order for loading
backend got shuffled. This explains the noise in the patch.
2024-05-03 14:09:30 +02:00
Weijia Wang
e13bb62fb3 Merge pull request #243846 from arcnmx/tpm2-tss-patch-name
tpm2-tss: remove space from patch name
2023-09-07 03:07:51 +02:00
Jan Malakhovski
93831661f4 tpm2-tss: use installCheckPhase instead of checkPhase, cleanup 2023-08-12 09:22:17 +00:00
arcnmx
eccc4d3403 tpm2-tss: remove space from patch name 2023-07-16 12:37:19 -07:00
Martin Weinelt
c428554e67 Merge pull request #240156 from baloo/baloo/tpm2-tss/4.0.1
tpm2-tss: 3.2.0 -> 4.0.1
2023-06-30 12:47:37 +02:00
Arthur Gautier
2fc817946b tpm2-tss: add maintainer 2023-06-29 18:56:43 -07:00
Arthur Gautier
90acc83140 tpm2-tss: 3.2.0 -> 4.0.1
This fixes CVE-2023-22745
2023-06-27 09:27:24 -07:00
Sergei Trofimovich
5db6008a2d tpm2-tss: split headers to "dev" output (and "man" while at it) 2023-04-17 08:07:42 +01:00
Guillaume Girol
33afbf39f6 treewide: switch to nativeCheckInputs
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
2023-01-21 12:00:00 +00:00
ajs124
779cca1bd1 tpm2-tss: fix version detection
without this, the version field in the .pc files is empty
leading to tpm2-abrmd failing to build
2022-04-17 19:00:18 +01:00
ajs124
588663ae79 tpm2-tss: 3.0.3 -> 3.2.0 2022-04-09 00:30:48 +01:00
Rick van Schijndel
68b5339f09 tpm2-tss: fix cross-compilation, enable strictDeps
It appears some dependencies were listed in checkInputs, they're moved
to the proper place in buildInputs & nativeBuildInputs.

Since this library was added as dependency of systemd, it's needed for
lots of packages to get cross-compilation working properly.

Also fixes pkgsStatic build, which fails due to cmocka not building.
Since we don't need it anyway when tests are disabled, gate it behind a
test for stdenv.buildPlatform == stdenv.hostPlatform.
2021-09-18 15:16:37 +02:00
Andreas Rammhold
64556974b6 systemd: 247.6 -> 249.4
This updates systemd to version v249.4 from version v247.6.

Besides the many new features that can be found in the upstream
repository they also introduced a bunch of cleanup which ended up
requiring a few more patches on our side.

a) 0022-core-Handle-lookup-paths-being-symlinks.patch:
  The way symlinked units were handled was changed in such that the last
  name of a unit file within one of the unit directories
  (/run/systemd/system, /etc/systemd/system, ...) is used as the name
  for the unit. Unfortunately that code didn't take into account that
  the unit directories themselves could already be symlinks and thus
  caused all our units to be recognized slightly different.

  There is an upstream PR for this new patch:
    https://github.com/systemd/systemd/pull/20479

b) The way the APIVFS is setup has been changed in such a way that we
   now always have /run. This required a few changes to the
   confinement tests which did assert that they didn't exist. Instead of
   adding another patch we can just adopt the upstream behavior. An
   empty /run doesn't seem harmful.

   As part of this work I refactored the confinement test just a little
   bit to allow better debugging of test failures. Previously it would
   just fail at some point and it wasn't obvious which of the many
   commands failed or what the unexpected string was. This should now be
   more obvious.

c) Again related to the confinement tests the way a file was tested for
   being accessible was optimized. Previously systemd would in some
   situations open a file twice during that check. This was reduced to
   one operation but required the procfs to be mounted in a units
   namespace.

   An upstream bug was filed and fixed. We are now carrying the
   essential patch to fix that issue until it is backported to a new
   release (likely only version 250). The good part about this story is
   that upstream systemd now has a test case that looks very similar to
   one of our confinement tests. Hopefully that will lead to less
   friction in the long run.

   https://github.com/systemd/systemd/issues/20514
   https://github.com/systemd/systemd/pull/20515

d) Previously we could grep for dlopen( somewhat reliably but now
   upstream started using a wrapper around dlopen that is most of the
   time used with linebreaks. This makes using grep not ergonomic
   anymore.

   With this bump we are grepping for anything that looks like a
   dynamic library name (in contrast to a dlopen(3) call) and replace
   those instead. That seems more robust. Time will tell if this holds.

   I tried using coccinelle to patch all those call sites using its
   tooling but unfornately it does stumble upon the _cleanup_
   annotations that are very common in the systemd code.

e) We now have some machinery for libbpf support in our systemd build.
   That being said it doesn't actually work as generating some skeletons
   doesn't work just yet. It fails with the below error message and is
   disabled by default (in both minimal and the regular build).

   > FAILED: src/core/bpf/socket_bind/socket-bind.skel.h
   > /build/source/tools/build-bpf-skel.py --clang_exec /nix/store/x1bi2mkapk1m0zq2g02nr018qyjkdn7a-clang-wrapper-12.0.1/bin/clang --llvm_strip_exec /nix/store/zm0kqan9qc77x219yihmmisi9g3sg8ns-llvm-12.0.1/bin/llvm-strip --bpftool_exec /nix/store/l6dg8jlbh8qnqa58mshh3d8r6999dk0p-bpftools-5.13.11/bin/bpftool --arch x86_64 ../src/core/bpf/socket_bind/socket-bind.bpf.c src/core/bpf/socket_bind/socket-bind.skel.h
   > libbpf: elf: socket_bind_bpf is not a valid eBPF object file
   > Error: failed to open BPF object file: BPF object format invalid
   > Traceback (most recent call last):
   >   File "/build/source/tools/build-bpf-skel.py", line 128, in <module>
   >     bpf_build(args)
   >   File "/build/source/tools/build-bpf-skel.py", line 92, in bpf_build
   >     gen_bpf_skeleton(bpftool_exec=args.bpftool_exec,
   >   File "/build/source/tools/build-bpf-skel.py", line 63, in gen_bpf_skeleton
   >     skel = subprocess.check_output(bpftool_args, universal_newlines=True)
   >   File "/nix/store/81lwy2hfqj4c1943b1x8a0qsivjhdhw9-python3-3.9.6/lib/python3.9/subprocess.py", line 424, in check_output
   >     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
   >   File "/nix/store/81lwy2hfqj4c1943b1x8a0qsivjhdhw9-python3-3.9.6/lib/python3.9/subprocess.py", line 528, in run
   >     raise CalledProcessError(retcode, process.args,
   > subprocess.CalledProcessError: Command '['/nix/store/l6dg8jlbh8qnqa58mshh3d8r6999dk0p-bpftools-5.13.11/bin/bpftool', 'g', 's', '../src/core/bpf/socket_bind/socket-bind.bpf.o']' returned non-zero exit status 255.
   > [102/1457] Compiling C object src/journal/libjournal-core.a.p/journald-server.c.oapture output)put)ut)
   > ninja: build stopped: subcommand failed.

  f) We do now have support for TPM2 based disk encryption in our
     systemd build. The actual bits and pieces to make use of that are
     missing but there are various ongoing efforts in that direction.
     There is also the story about systemd in our initrd to enable this
     being used for root volumes. None of this will yet work out of the
     box but we can start improving on that front.

  g) FIDO2 support was added systemd and consequently we can now use
     that. Just with TPM2 there hasn't been any integration work with
     NixOS and instead this just adds that capability to work on that.

Co-Authored-By: Jörg Thalheim <joerg@thalheim.io>
2021-09-12 23:45:49 +02:00
Arthur Gautier
0d8df51c23 tpm2-tss: fix support for abrmd
When introduced in #114080, the full path dlopen lookup patch introduced
a regression which made it impossible to load tabrmd modules

see https://github.com/NixOS/nixpkgs/issues/133248
    https://github.com/NixOS/nixpkgs/pull/114080

Fixes #133248

Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-08-10 15:17:45 +00:00
Sandro Jäckel
9378fdf87e iproute: deprecate alias 2021-04-04 01:43:46 +02:00
Arthur Gautier
eea5575bd3 tpm-tss2: do not rely on a dynamic load path for tcti modules
Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-02-23 08:34:27 +00:00
R. RyanTM
c97d0d50e1 tpm2-tss: 3.0.2 -> 3.0.3 2020-11-26 23:23:59 +00:00
R. RyanTM
f9d14ca7b4 tpm2-tss: 3.0.1 -> 3.0.2 2020-11-22 14:16:36 +00:00
Pierre Bourdon
d134095d67 tpm2-tss: 2.4.1 -> 3.0.1 2020-09-24 20:16:16 +02:00
Leon Schuermann
ef9e6b3aa8 tpm2-tss: remove libgcrypt from explicit build inputs 2020-06-17 16:46:18 +02:00
Leon Schuermann
09791689df tpm2-tss: build from source instead of release tarball 2020-06-17 16:46:18 +02:00
Leon Schuermann
1ec50ac39e tpm2-tss: extract checkPhase dependencies into checkInputs 2020-06-17 16:46:18 +02:00
Leon Schuermann
de064be984 tpm2-tss: enable parallel building 2020-06-17 16:46:18 +02:00
Leon Schuermann
8e94e61aec tpm2-tss: 2.3.2 -> 2.4.1 2020-06-17 16:46:18 +02:00