diff --git a/src/swtpm/capabilities.c b/src/swtpm/capabilities.c index 74ef770bb..40157e877 100644 --- a/src/swtpm/capabilities.c +++ b/src/swtpm/capabilities.c @@ -245,9 +245,7 @@ int capabilities_print_json(bool cusetpm, TPMLIB_TPMVersion tpmversion) char *keysizecaps = NULL; const char *nvram_backend_dir = "\"nvram-backend-dir\", "; const char *nvram_backend_file = "\"nvram-backend-file\""; - const char *cmdarg_profile = "\"cmdarg-profile\""; g_autofree gchar *profiles = NULL; - bool comma1; /* ignore errors */ TPMLIB_ChooseTPMVersion(tpmversion); @@ -267,13 +265,11 @@ int capabilities_print_json(bool cusetpm, TPMLIB_TPMVersion tpmversion) if (TPMLIB_ChooseTPMVersion(TPMLIB_TPM_VERSION_2) == TPM_SUCCESS) with_tpm2 = "\"tpm-2.0\", "; - comma1 = cmdarg_profile || profiles; - n = asprintf(&string, "{ " "\"type\": \"swtpm\", " "\"features\": [ " - "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s" + "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s" " ], " "\"profiles\": { %s}, " "\"version\": \"" VERSION "\" " @@ -293,8 +289,7 @@ int capabilities_print_json(bool cusetpm, TPMLIB_TPMVersion tpmversion) nvram_backend_dir, nvram_backend_file, keysizecaps ? keysizecaps : "", - comma1 ? ", " : "", - cmdarg_profile ? cmdarg_profile : "", + true ? ", \"cmdarg-profile\"" : "", profiles ? profiles : "" );