mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-29 15:44:14 +00:00
Passing -l <filepath> to -v will verify the payload hash with <filepath> instead of the <File name=filepath>
This commit is contained in:
parent
62edecd929
commit
7045fc9978
@ -21,8 +21,12 @@ public class Main {
|
||||
if (!commander.getVerifyFile().isEmpty()) {
|
||||
System.out.println(commander.toString());
|
||||
String verifyFile = commander.getVerifyFile();
|
||||
String rimel = commander.getRimEventLog();
|
||||
//String publicCertificate = commander.getPublicCertificate();
|
||||
if (!verifyFile.isEmpty()) {
|
||||
if (!rimel.isEmpty()) {
|
||||
gateway.setRimEventLog(rimel);
|
||||
}
|
||||
try {
|
||||
gateway.validateSwidTag(verifyFile);
|
||||
} catch (IOException e) {
|
||||
|
@ -437,7 +437,12 @@ public class SwidTagGateway {
|
||||
* This method validates a hirs.swid.xjc.File from an indirect payload
|
||||
*/
|
||||
private boolean validateFile(Element file) {
|
||||
String filepath = file.getAttribute(SwidTagConstants.NAME);
|
||||
String filepath;
|
||||
if (rimEventLog.isEmpty()) {
|
||||
filepath = file.getAttribute(SwidTagConstants.NAME);
|
||||
} else {
|
||||
filepath = rimEventLog;
|
||||
}
|
||||
System.out.println("Support rim found at " + filepath);
|
||||
if (HashSwid.get256Hash(filepath).equals(file.getAttribute(_SHA256_HASH.getPrefix() + ":" + _SHA256_HASH.getLocalPart()))) {
|
||||
System.out.println("Support RIM hash verified!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user