diff --git a/sysutils/swtpm/Makefile b/sysutils/swtpm/Makefile index 2ba41891d2fe..c636d8022344 100644 --- a/sysutils/swtpm/Makefile +++ b/sysutils/swtpm/Makefile @@ -1,42 +1,50 @@ PORTNAME= swtpm DISTVERSIONPREFIX= v -DISTVERSION= 0.9.0 -PORTREVISION= 2 +DISTVERSION= 0.10.1 CATEGORIES= sysutils MAINTAINER= meka@tilda.center COMMENT= Libtpms-based TPM emulator WWW= https://github.com/stefanberger/swtpm LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= base64>=0:converters/base64 \ bash>=0:shells/bash \ expect>=0:lang/expect \ gawk>=0:lang/gawk \ socat>=0:net/socat LIB_DEPENDS= libfuse.so:filesystems/fusefs-libs \ libgmp.so:math/gmp \ libgnutls.so:security/gnutls \ libjson-glib-1.0.so:devel/json-glib \ libtasn1.so:security/libtasn1 \ libtpms.so:sysutils/libtpms USES= autoreconf gettext-runtime gmake gnome libtool pathfix \ - pkgconfig ssl + pkgconfig python:env,test shebangfix ssl USE_GITHUB= yes GH_ACCOUNT= stefanberger USE_GNOME= glib20 USE_LDCONFIG= yes USE_RC_SUBR= ${PORTNAME} +SHEBANG_FILES= tests/_* tests/test_clientfds.py tests/test_setdatafd.py -USERS= _tss -GROUPS= ${USERS} GNU_CONFIGURE= yes -CONFIGURE_ARGS+= --with-tss-user=${USERS} \ - --with-tss-group=${GROUPS} +CONFIGURE_ARGS+= --with-tss-group=${GROUPS} \ + --with-tss-user=${USERS} INSTALL_TARGET= install-strip +TEST_ENV= LD_LIBRARY_PATH=${STAGEDIR}${PREFIX}/lib/swtpm:${LD_LIBRARY_PATH} \ + PATH=${PATH}:${STAGEDIR}${PREFIX}/bin +TEST_TARGET= ./installed-runner.sh +TEST_WRKSRC= ${STAGEDIR}${PREFIX}/libexec/installed-tests/swtpm + +USERS= _tss +GROUPS= ${USERS} + +do-test: + cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${TEST_TARGET} .include diff --git a/sysutils/swtpm/distinfo b/sysutils/swtpm/distinfo index 8198d3275f25..273fae772351 100644 --- a/sysutils/swtpm/distinfo +++ b/sysutils/swtpm/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1722686189 -SHA256 (stefanberger-swtpm-v0.9.0_GH0.tar.gz) = 9679ca171e8aaa3c4e4053e8bc1d10c8dabf0220bd4b16aba78743511c25f731 -SIZE (stefanberger-swtpm-v0.9.0_GH0.tar.gz) = 370942 +TIMESTAMP = 1746085619 +SHA256 (stefanberger-swtpm-v0.10.1_GH0.tar.gz) = f8da11cadfed27e26d26c5f58a7b8f2d14d684e691927348906b5891f525c684 +SIZE (stefanberger-swtpm-v0.10.1_GH0.tar.gz) = 415992 diff --git a/sysutils/swtpm/files/patch-tests_Makefile.am b/sysutils/swtpm/files/patch-tests_Makefile.am new file mode 100644 index 000000000000..f5d07e83864c --- /dev/null +++ b/sysutils/swtpm/files/patch-tests_Makefile.am @@ -0,0 +1,10 @@ +--- tests/Makefile.am.orig 2025-05-12 20:33:40 UTC ++++ tests/Makefile.am +@@ -19,7 +19,6 @@ TESTS += \ + + TESTS += \ + test_commandline \ +- test_ctrlchannel \ + test_ctrlchannel2 \ + test_ctrlchannel3 \ + test_ctrlchannel4 \ diff --git a/sysutils/swtpm/files/swtpm.in b/sysutils/swtpm/files/swtpm.in index 637d1279aa48..15e24e044108 100644 --- a/sysutils/swtpm/files/swtpm.in +++ b/sysutils/swtpm/files/swtpm.in @@ -1,121 +1,121 @@ #!/bin/sh # PROVIDE: swtpm # REQUIRE: FILESYSTEMS ldconfig # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local, /etc/rc.conf or # /etc/rc.conf.d/swtpm to enable this service: # # swtpm_enable (bool): Set to NO by default. # Set it to "YES" to enable swtpm. # swtpm_configs (string): List of configurations to use # Default is "tpm" # swtpm_tpm (string): Arguments passed to swtpm config named tpm . /etc/rc.subr name=swtpm desc="Software TPM manager" rcvar=${name}_enable start_precmd="${name}_precmd" start_cmd="${name}_start" stop_cmd="${name}_stop" status_cmd="${name}_status" command="%%PREFIX%%/bin/swtpm" command_args="socket" pidpath="/var/run/${name}" # required_modules="cuse" swtpm_default_args="\ - --daemon \ --tpmstate dir=${pidpath} \ --tpm2 \ --log level=20" configs= load_rc_config $name : ${swtpm_enable:="NO"} : ${swtpm_configs:="tpm"} : ${swtpm_tpm:="$swtpm_default_args"} swtpm_pids() { pids=$(pgrep -d ' ' $name) pids=${pids% } printf "${pids}" } swtpm_precmd() { /usr/bin/install -d -m 0755 -o root ${pidpath} } start_instance() { config=$* instance_args=$(eval "echo \$swtpm_${config}") if [ -z "${instance_args}" ]; then echo "No such config ${config}" else echo -n "Starting SWTPM config ${config} ..." ${command} \ ${command_args} \ + --daemon \ --pid file=${pidpath}/${config}.pid \ --ctrl type=unixio,path=${pidpath}/${config} \ ${instance_args} echo " done" fi } stop_instance() { config=$* instance_args=`eval "echo \$swtpm_${config}"` if [ -z "${instance_args}" ]; then echo "No such config ${config}" elif [ -e "${pidpath}/${config}.pid" ]; then pid=$(check_pidfile ${pidpath}/${config}.pid %%PREFIX%%/bin/swtpm) if [ ! -z "${pid}" ]; then echo -n "Stopping SWTPM config ${config} ... " kill $pid rm -f ${pidpath}/${config}.pid echo "done" fi fi } swtpm_start() { configs=$* [ -z "${configs}" ] && configs="${swtpm_configs}" for config in ${configs}; do start_instance $config done } swtpm_stop() { configs=$* [ -z "${configs}" ] && configs="${swtpm_configs}" for config in ${configs}; do stop_instance ${config} done } swtpm_status() { pids=$(swtpm_pids) if [ "${pids}" ]; then echo "${name} is running as pid ${pids}." else echo "${name} is not running." return 1 fi } run_rc_command $* diff --git a/sysutils/swtpm/pkg-plist b/sysutils/swtpm/pkg-plist index 34009be0c8ba..763381418dc2 100644 --- a/sysutils/swtpm/pkg-plist +++ b/sysutils/swtpm/pkg-plist @@ -1,33 +1,220 @@ bin/swtpm bin/swtpm_bios bin/swtpm_cert bin/swtpm_cuse bin/swtpm_ioctl bin/swtpm_localca bin/swtpm_setup %%ETCDIR%%-localca.conf %%ETCDIR%%-localca.options %%ETCDIR%%_setup.conf include/swtpm/tpm_ioctl.h lib/swtpm/libswtpm_libtpms.a lib/swtpm/libswtpm_libtpms.so lib/swtpm/libswtpm_libtpms.so.0 lib/swtpm/libswtpm_libtpms.so.0.0.0 +libexec/installed-tests/swtpm/_test_encrypted_state +libexec/installed-tests/swtpm/_test_getcap +libexec/installed-tests/swtpm/_test_hashing +libexec/installed-tests/swtpm/_test_hashing2 +libexec/installed-tests/swtpm/_test_init +libexec/installed-tests/swtpm/_test_locality +libexec/installed-tests/swtpm/_test_migration_key +libexec/installed-tests/swtpm/_test_migration_key_2 +libexec/installed-tests/swtpm/_test_print_capabilities +libexec/installed-tests/swtpm/_test_print_states +libexec/installed-tests/swtpm/_test_resume_volatile +libexec/installed-tests/swtpm/_test_save_load_encrypted_state +libexec/installed-tests/swtpm/_test_save_load_state +libexec/installed-tests/swtpm/_test_setbuffersize +libexec/installed-tests/swtpm/_test_swtpm_bios +libexec/installed-tests/swtpm/_test_tpm2_avoid_da_lockout +libexec/installed-tests/swtpm/_test_tpm2_derived_keys +libexec/installed-tests/swtpm/_test_tpm2_encrypted_state +libexec/installed-tests/swtpm/_test_tpm2_file_permissions +libexec/installed-tests/swtpm/_test_tpm2_getcap +libexec/installed-tests/swtpm/_test_tpm2_hashing +libexec/installed-tests/swtpm/_test_tpm2_hashing2 +libexec/installed-tests/swtpm/_test_tpm2_hashing3 +libexec/installed-tests/swtpm/_test_tpm2_init +libexec/installed-tests/swtpm/_test_tpm2_locality +libexec/installed-tests/swtpm/_test_tpm2_migration_key +libexec/installed-tests/swtpm/_test_tpm2_print_capabilities +libexec/installed-tests/swtpm/_test_tpm2_print_states +libexec/installed-tests/swtpm/_test_tpm2_probe +libexec/installed-tests/swtpm/_test_tpm2_resume_volatile +libexec/installed-tests/swtpm/_test_tpm2_save_load_encrypted_state +libexec/installed-tests/swtpm/_test_tpm2_save_load_state +libexec/installed-tests/swtpm/_test_tpm2_save_load_state_da_timeout +libexec/installed-tests/swtpm/_test_tpm2_save_load_state_locking +libexec/installed-tests/swtpm/_test_tpm2_savestate +libexec/installed-tests/swtpm/_test_tpm2_setbuffersize +libexec/installed-tests/swtpm/_test_tpm2_swtpm_bios +libexec/installed-tests/swtpm/_test_tpm2_volatilestate +libexec/installed-tests/swtpm/_test_tpm2_wrongorder +libexec/installed-tests/swtpm/_test_tpm_probe +libexec/installed-tests/swtpm/_test_volatilestate +libexec/installed-tests/swtpm/_test_wrongorder +libexec/installed-tests/swtpm/common +libexec/installed-tests/swtpm/create_certs.sh +libexec/installed-tests/swtpm/data/ecprivek.pem +libexec/installed-tests/swtpm/data/ecpubek.pem +libexec/installed-tests/swtpm/data/issuercert.pem +libexec/installed-tests/swtpm/data/keyfile.txt +libexec/installed-tests/swtpm/data/keyfile256bit.txt +libexec/installed-tests/swtpm/data/migkey1/tpm2-volatilestate.bin +libexec/installed-tests/swtpm/data/migkey1/volatilestate.bin +libexec/installed-tests/swtpm/data/pubek.pem +libexec/installed-tests/swtpm/data/pwdfile.txt +libexec/installed-tests/swtpm/data/signkey-encrypted.pem +libexec/installed-tests/swtpm/data/signkey.pem +libexec/installed-tests/swtpm/data/tpm2state1/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpm2state1/tpm2-00.volatilestate +libexec/installed-tests/swtpm/data/tpm2state2/pwdfile.txt +libexec/installed-tests/swtpm/data/tpm2state2/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpm2state2/tpm2-00.volatilestate +libexec/installed-tests/swtpm/data/tpm2state2b/pwdfile.txt +libexec/installed-tests/swtpm/data/tpm2state2b/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpm2state2b/tpm2-00.volatilestate +libexec/installed-tests/swtpm/data/tpm2state3/hkey.priv +libexec/installed-tests/swtpm/data/tpm2state3/hkey.pub +libexec/installed-tests/swtpm/data/tpm2state3/signature.bin +libexec/installed-tests/swtpm/data/tpm2state3/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpm2state3b/h02000000.bin +libexec/installed-tests/swtpm/data/tpm2state3b/h81000000.bin +libexec/installed-tests/swtpm/data/tpm2state3b/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpm2state3b/tpm2-00.volatilestate +libexec/installed-tests/swtpm/data/tpm2state3c/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpm2state3c/tpm2-00.volatilestate +libexec/installed-tests/swtpm/data/tpm2state3d/signature2.bin +libexec/installed-tests/swtpm/data/tpm2state3d/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpm2state3d/tpm2-00.volatilestate +libexec/installed-tests/swtpm/data/tpm2state4/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpm2state4/tpm2-00.volatilestate +libexec/installed-tests/swtpm/data/tpm2state5/signature.bin +libexec/installed-tests/swtpm/data/tpm2state5/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpm2state6/tpm2-00.permall +libexec/installed-tests/swtpm/data/tpmstate1/README +libexec/installed-tests/swtpm/data/tpmstate1/tpm-00.permall +libexec/installed-tests/swtpm/data/tpmstate1/tpm-00.volatilestate +libexec/installed-tests/swtpm/data/tpmstate2/README +libexec/installed-tests/swtpm/data/tpmstate2/pwdfile.txt +libexec/installed-tests/swtpm/data/tpmstate2/tpm-00.permall +libexec/installed-tests/swtpm/data/tpmstate2/tpm-00.volatilestate +libexec/installed-tests/swtpm/data/tpmstate2b/pwdfile.txt +libexec/installed-tests/swtpm/data/tpmstate2b/tpm-00.permall +libexec/installed-tests/swtpm/data/tpmstate2b/tpm-00.volatilestate +libexec/installed-tests/swtpm/fileinstall +libexec/installed-tests/swtpm/installed-runner.sh +libexec/installed-tests/swtpm/load_vtpm_proxy +libexec/installed-tests/swtpm/patches/0001-Deactivate-test-cases-accessing-rootcerts.txt.patch +libexec/installed-tests/swtpm/patches/0002-Implement-powerup-for-swtpm.patch +libexec/installed-tests/swtpm/patches/0003-Set-CRYPTOLIBRARY-to-openssl.patch +libexec/installed-tests/swtpm/patches/0004-Store-and-restore-volatile-state-at-every-step.patch +libexec/installed-tests/swtpm/patches/0005-Disable-tests-related-to-events.patch +libexec/installed-tests/swtpm/patches/0010-Adjust-test-cases-for-OpenSSL-3.patch +libexec/installed-tests/swtpm/patches/0012-Disable-Nuvoton-commands.patch +libexec/installed-tests/swtpm/patches/libtpm.patch +libexec/installed-tests/swtpm/sed-inplace +libexec/installed-tests/swtpm/softhsm_setup +libexec/installed-tests/swtpm/swtpm_setup.conf +libexec/installed-tests/swtpm/test_clientfds.py +libexec/installed-tests/swtpm/test_commandline +libexec/installed-tests/swtpm/test_common +libexec/installed-tests/swtpm/test_config +libexec/installed-tests/swtpm/test_ctrlchannel2 +libexec/installed-tests/swtpm/test_ctrlchannel3 +libexec/installed-tests/swtpm/test_ctrlchannel4 +libexec/installed-tests/swtpm/test_cuse +libexec/installed-tests/swtpm/test_encrypted_state +libexec/installed-tests/swtpm/test_getcap +libexec/installed-tests/swtpm/test_hashing +libexec/installed-tests/swtpm/test_hashing2 +libexec/installed-tests/swtpm/test_init +libexec/installed-tests/swtpm/test_locality +libexec/installed-tests/swtpm/test_migration_key +libexec/installed-tests/swtpm/test_parameters +libexec/installed-tests/swtpm/test_print_capabilities +libexec/installed-tests/swtpm/test_print_states +libexec/installed-tests/swtpm/test_resume_volatile +libexec/installed-tests/swtpm/test_samples_create_tpmca +libexec/installed-tests/swtpm/test_save_load_encrypted_state +libexec/installed-tests/swtpm/test_save_load_state +libexec/installed-tests/swtpm/test_setbuffersize +libexec/installed-tests/swtpm/test_setdatafd.py +libexec/installed-tests/swtpm/test_swtpm_bios +libexec/installed-tests/swtpm/test_swtpm_cert +libexec/installed-tests/swtpm/test_swtpm_setup_create_cert +libexec/installed-tests/swtpm/test_swtpm_setup_file_backend +libexec/installed-tests/swtpm/test_swtpm_setup_misc +libexec/installed-tests/swtpm/test_swtpm_setup_overwrite +libexec/installed-tests/swtpm/test_tpm12 +libexec/installed-tests/swtpm/test_tpm2_avoid_da_lockout +libexec/installed-tests/swtpm/test_tpm2_chroot_chardev +libexec/installed-tests/swtpm/test_tpm2_chroot_cuse +libexec/installed-tests/swtpm/test_tpm2_chroot_socket +libexec/installed-tests/swtpm/test_tpm2_ctrlchannel2 +libexec/installed-tests/swtpm/test_tpm2_ctrlchannel3 +libexec/installed-tests/swtpm/test_tpm2_derived_keys +libexec/installed-tests/swtpm/test_tpm2_encrypted_state +libexec/installed-tests/swtpm/test_tpm2_file_permissions +libexec/installed-tests/swtpm/test_tpm2_getcap +libexec/installed-tests/swtpm/test_tpm2_hashing +libexec/installed-tests/swtpm/test_tpm2_hashing2 +libexec/installed-tests/swtpm/test_tpm2_hashing3 +libexec/installed-tests/swtpm/test_tpm2_ibmtss2 +libexec/installed-tests/swtpm/test_tpm2_init +libexec/installed-tests/swtpm/test_tpm2_libtpms_versions_profiles +libexec/installed-tests/swtpm/test_tpm2_locality +libexec/installed-tests/swtpm/test_tpm2_migration_key +libexec/installed-tests/swtpm/test_tpm2_parameters +libexec/installed-tests/swtpm/test_tpm2_partial_reads +libexec/installed-tests/swtpm/test_tpm2_print_capabilities +libexec/installed-tests/swtpm/test_tpm2_print_states +libexec/installed-tests/swtpm/test_tpm2_probe +libexec/installed-tests/swtpm/test_tpm2_resume_volatile +libexec/installed-tests/swtpm/test_tpm2_save_load_encrypted_state +libexec/installed-tests/swtpm/test_tpm2_save_load_state +libexec/installed-tests/swtpm/test_tpm2_save_load_state_2 +libexec/installed-tests/swtpm/test_tpm2_save_load_state_2_block +libexec/installed-tests/swtpm/test_tpm2_save_load_state_2_linear +libexec/installed-tests/swtpm/test_tpm2_save_load_state_3 +libexec/installed-tests/swtpm/test_tpm2_save_load_state_da_timeout +libexec/installed-tests/swtpm/test_tpm2_save_load_state_locking +libexec/installed-tests/swtpm/test_tpm2_savestate +libexec/installed-tests/swtpm/test_tpm2_setbuffersize +libexec/installed-tests/swtpm/test_tpm2_swtpm_bios +libexec/installed-tests/swtpm/test_tpm2_swtpm_cert +libexec/installed-tests/swtpm/test_tpm2_swtpm_cert_ecc +libexec/installed-tests/swtpm/test_tpm2_swtpm_localca +libexec/installed-tests/swtpm/test_tpm2_swtpm_localca_pkcs11.test +libexec/installed-tests/swtpm/test_tpm2_swtpm_setup_create_cert +libexec/installed-tests/swtpm/test_tpm2_swtpm_setup_overwrite +libexec/installed-tests/swtpm/test_tpm2_swtpm_setup_profile +libexec/installed-tests/swtpm/test_tpm2_swtpm_setup_profile_name +libexec/installed-tests/swtpm/test_tpm2_volatilestate +libexec/installed-tests/swtpm/test_tpm2_vtpm_proxy +libexec/installed-tests/swtpm/test_tpm2_wrongorder +libexec/installed-tests/swtpm/test_tpm_probe +libexec/installed-tests/swtpm/test_volatilestate +libexec/installed-tests/swtpm/test_vtpm_proxy +libexec/installed-tests/swtpm/test_wrongorder +libexec/installed-tests/swtpm/tests share/man/man3/swtpm_ioctls.3.gz share/man/man5/swtpm-localca.conf.5.gz share/man/man5/swtpm-localca.options.5.gz share/man/man5/swtpm_setup.conf.5.gz share/man/man8/swtpm-create-tpmca.8.gz share/man/man8/swtpm-localca.8.gz share/man/man8/swtpm.8.gz share/man/man8/swtpm_bios.8.gz share/man/man8/swtpm_cert.8.gz share/man/man8/swtpm_cuse.8.gz share/man/man8/swtpm_ioctl.8.gz share/man/man8/swtpm_localca.8.gz share/man/man8/swtpm_setup.8.gz %%DATADIR%%/swtpm-create-tpmca %%DATADIR%%/swtpm-create-user-config-files %%DATADIR%%/swtpm-localca @dir /var/lib/swtpm-localca @dir /var/lib