]> git.proxmox.com Git - swtpm.git/commitdiff
swtpm: Add "nvram-backend-linear" capability
authorStefan Reiter <stefan@pimaker.at>
Thu, 5 Aug 2021 12:22:46 +0000 (14:22 +0200)
committerStefan Berger <stefanb@us.ibm.com>
Tue, 5 Oct 2021 13:01:30 +0000 (09:01 -0400)
Signed-off-by: Stefan Reiter <stefan@pimaker.at>
man/man8/swtpm.pod
src/swtpm/capabilities.c
tests/_test_print_capabilities
tests/_test_tpm2_print_capabilities

index f82fd5ca68ac500763169150f1a19fa35dc81bae..abdae004d7ecc11ce956addabcb05cd0be296f49 100644 (file)
@@ -305,6 +305,7 @@ may contain the following:
         "cmdarg-key-fd",
         "cmdarg-pwd-fd",
         "nvram-backend-dir",
+        "nvram-backend-file",
         "tpm-send-command-header",
         "flags-opt-startup",
         "rsa-keysize-1024",
index 5e8f718f863a74ce8c54b0063f28c9b93f63f870..0a80f93f0a9d4ece5c333090335bfdbeb869b438 100644 (file)
@@ -127,7 +127,8 @@ int capabilities_print_json(bool cusetpm)
     const char *with_tpm1 = "";
     const char *with_tpm2 = "";
     char *keysizecaps = NULL;
-    const char *nvram_backend_dir = "\"nvram-backend-dir\"";
+    const char *nvram_backend_dir = "\"nvram-backend-dir\", ";
+    const char *nvram_backend_file = "\"nvram-backend-file\"";
 
     ret = get_rsa_keysize_caps(&keysizecaps);
     if (ret < 0)
@@ -142,7 +143,7 @@ int capabilities_print_json(bool cusetpm)
          "{ "
          "\"type\": \"swtpm\", "
          "\"features\": [ "
-             "%s%s%s%s%s%s%s%s%s"
+             "%s%s%s%s%s%s%s%s%s%s"
           " ], "
          "\"version\": \"" VERSION "\" "
          "}",
@@ -154,6 +155,7 @@ int capabilities_print_json(bool cusetpm)
          true         ? "\"cmdarg-key-fd\", "          : "",
          true         ? "\"cmdarg-pwd-fd\", "          : "",
          nvram_backend_dir,
+         nvram_backend_file,
          keysizecaps  ? keysizecaps                    : ""
     );
 
index 170eb94c5ae6a0ae83c1c3e1829a14a387508062..4e3d9bf84a9fbe822b3d6ef13d29d13d3a606f6c 100755 (executable)
@@ -25,7 +25,7 @@ if [ "${SWTPM_IFACE}" != "cuse" ]; then
        noncuse='"tpm-send-command-header", "flags-opt-startup", '
 fi
 
-exp='\{ "type": "swtpm", "features": \[ "tpm-1.2",( "tpm-2.0",)? '${noncuse}${seccomp}'"cmdarg-key-fd", "cmdarg-pwd-fd", "nvram-backend-dir" \], "version": "[^"]*" \}'
+exp='\{ "type": "swtpm", "features": \[ "tpm-1.2",( "tpm-2.0",)? '${noncuse}${seccomp}'"cmdarg-key-fd", "cmdarg-pwd-fd", "nvram-backend-dir", "nvram-backend-file" \], "version": "[^"]*" \}'
 if ! [[ ${msg} =~ ${exp} ]]; then
        echo "Unexpected response from ${SWTPM_IFACE} TPM to --print-capabilities:"
        echo "Actual   : ${msg}"
index eb1804547a2fd4d7d2226857dca6b7d599261a2b..3efb773017a152058237c32f78496bc5190b23b1 100755 (executable)
@@ -26,7 +26,7 @@ if [ "${SWTPM_IFACE}" != "cuse" ]; then
 fi
 
 # The rsa key size reporting is variable, so use a regex
-exp='\{ "type": "swtpm", "features": \[( "tpm-1.2",)? "tpm-2.0", '${noncuse}${seccomp}'"cmdarg-key-fd", "cmdarg-pwd-fd", "nvram-backend-dir"(, "rsa-keysize-1024")?(, "rsa-keysize-2048")?(, "rsa-keysize-3072")? \], "version": "[^"]*" \}'
+exp='\{ "type": "swtpm", "features": \[( "tpm-1.2",)? "tpm-2.0", '${noncuse}${seccomp}'"cmdarg-key-fd", "cmdarg-pwd-fd", "nvram-backend-dir", "nvram-backend-file"(, "rsa-keysize-1024")?(, "rsa-keysize-2048")?(, "rsa-keysize-3072")? \], "version": "[^"]*" \}'
 if ! [[ ${msg} =~ ${exp} ]]; then
        echo "Unexpected response from ${SWTPM_IFACE} TPM to --print-capabilities:"
        echo "Actual   : ${msg}"