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 fbf3de2517
commit 808e05b71c
3 changed files with 7 additions and 4 deletions

View File

@ -92,11 +92,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

@ -26,7 +26,7 @@ public class Commander {
private boolean version = false;
@Parameter(names = {"-a", "--attributes <path>"}, validateWith = FileArgumentValidator.class,
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. "
@ -51,7 +51,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>"}, validateWith = FileArgumentValidator.class,
description = "The TCG eventlog file to use as a support RIM.")