mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-04-15 15:06:47 +00:00
v3_issue_896: should fix issues with pc found on certain devices
Some checks are pending
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (ubuntu-20.04) (push) Waiting to run
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (windows-2022) (push) Waiting to run
Dotnet Provisioner Unit Tests / Evaluate Tests (push) Blocked by required conditions
HIRS Build and Unit Test / ACA_Provisioner_Unit_Tests (push) Waiting to run
HIRS System Tests / DockerTests (push) Waiting to run
Some checks are pending
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (ubuntu-20.04) (push) Waiting to run
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (windows-2022) (push) Waiting to run
Dotnet Provisioner Unit Tests / Evaluate Tests (push) Blocked by required conditions
HIRS Build and Unit Test / ACA_Provisioner_Unit_Tests (push) Waiting to run
HIRS System Tests / DockerTests (push) Waiting to run
This commit is contained in:
parent
d9c7f8ceed
commit
fdacd4df6e
@ -92,6 +92,13 @@ public class ComponentInfo extends ArchivableEntity {
|
||||
final String componentSerial,
|
||||
final String componentRevision) {
|
||||
|
||||
if (deviceName == null) {
|
||||
log.error("Component Info's device name cannot be null.");
|
||||
this.deviceName = "";
|
||||
} else {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
if (componentManufacturer == null) {
|
||||
log.error("Component Info's manufacturer cannot be null.");
|
||||
this.componentManufacturer = "";
|
||||
@ -106,8 +113,6 @@ public class ComponentInfo extends ArchivableEntity {
|
||||
this.componentModel = componentModel.trim();
|
||||
}
|
||||
|
||||
this.deviceName = deviceName;
|
||||
|
||||
if (componentSerial != null) {
|
||||
this.componentSerial = componentSerial.trim();
|
||||
} else {
|
||||
|
@ -195,11 +195,19 @@ public class AbstractProcessor {
|
||||
List<PlatformCredential> platformCredentials = new LinkedList<>();
|
||||
|
||||
if (identityClaim.getPlatformCredentialCount() > 0) {
|
||||
for (ByteString platformCredential : identityClaim.getPlatformCredentialList()) {
|
||||
|
||||
List<ByteString> platformCredentialList = identityClaim.getPlatformCredentialList();
|
||||
|
||||
for (ByteString platformCredential : platformCredentialList) {
|
||||
if (!platformCredential.isEmpty()) {
|
||||
platformCredentials.add(CredentialManagementHelper.storePlatformCredential(
|
||||
certificateRepository, platformCredential.toByteArray(),
|
||||
identityClaim.getDv().getNw().getHostname()));
|
||||
PlatformCredential storedPlatformCredential =
|
||||
CredentialManagementHelper.storePlatformCredential(
|
||||
certificateRepository, platformCredential.toByteArray(),
|
||||
identityClaim.getDv().getNw().getHostname());
|
||||
|
||||
if (storedPlatformCredential != null) {
|
||||
platformCredentials.add(storedPlatformCredential);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (endorsementCredential != null) {
|
||||
|
@ -90,14 +90,17 @@ public final class CredentialManagementHelper {
|
||||
final byte[] platformBytes, final String deviceName) {
|
||||
|
||||
if (certificateRepository == null) {
|
||||
log.error("The provided certificate repository is null.");
|
||||
throw new IllegalArgumentException("null certificate manager");
|
||||
}
|
||||
|
||||
if (platformBytes == null) {
|
||||
log.error("The provided platform credential byte array is null.");
|
||||
throw new IllegalArgumentException("null platform credential bytes");
|
||||
}
|
||||
|
||||
if (platformBytes.length == 0) {
|
||||
log.error("The provided platform credential byte array is null.");
|
||||
throw new IllegalArgumentException(
|
||||
"zero-length byte array given for platform credential"
|
||||
);
|
||||
@ -110,6 +113,7 @@ public final class CredentialManagementHelper {
|
||||
PlatformCredential.parseWithPossibleHeader(platformBytes);
|
||||
|
||||
if (platformCredential == null) {
|
||||
log.error("The platform credential that was parsed was null");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -147,7 +151,7 @@ public final class CredentialManagementHelper {
|
||||
|
||||
return existingCredential;
|
||||
} catch (DBManagerException dbEx) {
|
||||
log.error("Error retrieving or saving platform credential", dbEx);
|
||||
log.error("Error retrieving or saving platform credential to the database", dbEx);
|
||||
} catch (Exception e) {
|
||||
log.error("Error parsing platform credential", e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user