(define-module (metznet packages tpm2) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (gnu packages autotools) #:use-module (gnu packages curl) #:use-module (gnu packages gettext) #:use-module (gnu packages haskell-xyz) #:use-module (gnu packages linux) #:use-module (gnu packages pkg-config) #:use-module (gnu packages textutils) #:use-module (gnu packages tls) #:use-module (gnu packages web) #:export (metznet-tpm2-tss metznet-tpm2-tools)) ;; Guix's own tpm2-tss (3.0.3, released 2020-11-25) predates upstream's ;; OpenSSL 3.0 compatibility fix (EVP_PKEY_new_raw_private_key instead of ;; the now-broken EVP_PKEY_new_mac_key, landed upstream 2021-07/08) -- ;; every hierarchy/HMAC-authenticated command (tpm2_createprimary and ;; friends) fails against Guix's current default openssl (3.5.x) with ;; "Esys_CreatePrimary(0x70001) ... EVP_PKEY_new_mac_key". Rather than ;; pin an EOL openssl as a workaround, track a current upstream release ;; that already has the real fix (same approach as openldap-slapd/ ;; mit-krb5-ldap elsewhere in this channel: maintain our own version when ;; upstream Guix's is unsuitable). (define-public metznet-tpm2-tss (package (name "tpm2-tss") (version "4.2.0") (source (origin (method url-fetch) (uri (string-append "https://github.com/tpm2-software/tpm2-tss" "/releases/download/" version "/tpm2-tss-" version ".tar.gz")) (sha256 (base32 "0951zsqss3ndx904dg69h2imqwlgd2lhqh8sf02pzqaciif0qgxm")))) (build-system gnu-build-system) (native-inputs (list pkg-config)) (inputs (list curl json-c openssl `(,util-linux "lib"))) (home-page "https://tpm2-software.github.io/") (synopsis "OSS Implementation of the TCG TPM2 Software Stack (TSS2)") (description "This package provides the @acronym{TCG, Trusted Computing Group} @acronym{TSS2, TPM2 Software Stack}. The stack contains libtss2-fapi, libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm and libtss2-tcti-mssim.") (license license:bsd-2))) (define-public metznet-tpm2-tools (package (name "tpm2-tools") (version "5.8") (source (origin (method url-fetch) (uri (string-append "https://github.com/tpm2-software/tpm2-tools/" "releases/download/" version "/" "tpm2-tools-" version ".tar.gz")) (sha256 (base32 "0wzg9gwfv4pxl5b42pvp92phyr1dchi0nbbwbkhv8578ra2k3dqw")))) (build-system gnu-build-system) (native-inputs (list autoconf automake curl libtool gettext-minimal openssl pandoc pkg-config metznet-tpm2-tss)) (home-page "https://github.com/tpm2-software/tpm2-tools") (synopsis "Tools for the Trusted Platform Module (TPM 2.0)") (description "This package provides user tools for the Trusted Computing Group's (TCG) TPM2 Software Stack (TSS). These programs help with common tasks such as key management, attestation, encryption, and signing.") (license license:bsd-3)))