Do not assign the default attributes file in the absence of a user-provided argument

This commit is contained in:
chubtub 2024-02-07 09:48:51 -05:00
parent c3aaba5eba
commit f0b8e89bab
3 changed files with 7 additions and 4 deletions

View File

@ -82,11 +82,14 @@ public class Main {
case "BASE":
if (!attributesFile.isEmpty()) {
gateway.setAttributesFile(attributesFile);
} else {
System.out.println("An attribute file is required.");
System.exit(1);
}
if (!rimEventLog.isEmpty()) {
gateway.setRimEventLog(rimEventLog);
} else {
System.out.println("Error: a support RIM is required!");
System.out.println("A support RIM is required.");
System.exit(1);
}
credValidator = new CredentialArgumentValidator("" ,

View File

@ -99,7 +99,7 @@ public class SwidTagGateway {
try {
JAXBContext jaxbContext = JAXBContext.newInstance(SwidTagConstants.SCHEMA_PACKAGE);
marshaller = jaxbContext.createMarshaller();
attributesFile = SwidTagConstants.DEFAULT_ATTRIBUTES_FILE;
attributesFile = "";
defaultCredentials = true;
pemCertificateFile = "";
embeddedCert = false;

View File

@ -24,7 +24,7 @@ public class Commander {
private boolean version = false;
@Parameter(names = {"-a", "--attributes <path>"}, order = 1,
description = "The configuration file holding attributes "
+ "to populate the base RIM with.")
+ "to populate the base RIM with. An example file can be found in /opt/rimtool/data.")
private String attributesFile = "";
@Parameter(names = {"-o", "--out <path>"}, order = 2,
description = "The file to write the RIM out to. "
@ -45,7 +45,7 @@ public class Commander {
description = "Embed the provided certificate in the signed swidtag.")
private boolean embedded = false;
@Parameter(names = {"-d", "--default-key"}, order = 8,
description = "Use default signing credentials.")
description = "Use the JKS keystore installed in /opt/rimtool/data.")
private boolean defaultKey = false;
@Parameter(names = {"-l", "--rimel <path>"}, order = 9,
description = "The TCG eventlog file to use as a support RIM.")