Enable TPM by default with SetCredentialEncrypted

This commit is contained in:
Aidan Dang
2023-02-21 21:07:02 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 024951fb22
commit d59025698f
2 changed files with 17 additions and 7 deletions
+3
View File
@@ -211,7 +211,10 @@ fi
# Ensure that sandboxing doesn't stop creds from being accessible
echo "test" > /tmp/testdata
systemd-creds encrypt /tmp/testdata /tmp/testdata.encrypted --with-key=tpm2
# LoadCredentialEncrypted
systemd-run -p PrivateDevices=yes -p LoadCredentialEncrypted=testdata.encrypted:/tmp/testdata.encrypted --pipe --wait systemd-creds cat testdata.encrypted | cmp - /tmp/testdata
# SetCredentialEncrypted
systemd-run -p PrivateDevices=yes -p SetCredentialEncrypted=testdata.encrypted:"$(cat /tmp/testdata.encrypted)" --pipe --wait systemd-creds cat testdata.encrypted | cmp - /tmp/testdata
rm /tmp/testdata
echo OK >/testok