From d6d47d9abe44b669a2a5d44dd1127734ac80351d Mon Sep 17 00:00:00 2001 From: Cyrus <24922493+cyrus-dev@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:11:24 -0500 Subject: [PATCH] This last push updates unit tests that are not prepped to handle the new code. --- .../validation/CredentialValidator.java | 5 + .../SupplyChainCredentialValidatorTest.java | 418 +++++++++--------- 2 files changed, 214 insertions(+), 209 deletions(-) diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/validation/CredentialValidator.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/validation/CredentialValidator.java index c0e80809..72d7f544 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/validation/CredentialValidator.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/validation/CredentialValidator.java @@ -268,6 +268,11 @@ public class CredentialValidator extends SupplyChainCredentialValidator { } } + if (componentInfos.isEmpty()) { + message = baseErrorMessage + "a list of device components"; + return new AppraisalStatus(FAIL, message); + } + // parse out the provided delta and its specific chain. List origPcComponents = componentResultRepository .findByCertificateSerialNumberAndBoardSerialNumber( diff --git a/HIRS_AttestationCA/src/test/java/hirs/attestationca/persist/validation/SupplyChainCredentialValidatorTest.java b/HIRS_AttestationCA/src/test/java/hirs/attestationca/persist/validation/SupplyChainCredentialValidatorTest.java index d726c43f..55dea930 100644 --- a/HIRS_AttestationCA/src/test/java/hirs/attestationca/persist/validation/SupplyChainCredentialValidatorTest.java +++ b/HIRS_AttestationCA/src/test/java/hirs/attestationca/persist/validation/SupplyChainCredentialValidatorTest.java @@ -1774,124 +1774,124 @@ public class SupplyChainCredentialValidatorTest { // @Test public final void testValidateDeltaPlatformCredentialAttributes() throws IOException, URISyntaxException { - DeviceInfoReport deviceInfoReport = setupDeviceInfoReportWithComponents( - SAMPLE_PACCOR_OUTPUT_TXT); +// DeviceInfoReport deviceInfoReport = setupDeviceInfoReportWithComponents( +// SAMPLE_PACCOR_OUTPUT_TXT); - PlatformCredential base = mock(PlatformCredential.class); - PlatformCredential delta1 = mock(PlatformCredential.class); - PlatformCredential delta2 = mock(PlatformCredential.class); - - ComponentIdentifierV2 compId1 = new ComponentIdentifierV2( - new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() - .getResource(JSON_FILE)).toURI()), "0x00010002"), - new DERUTF8String("Intel"), - new DERUTF8String("Core i7"), new DERUTF8String("Not Specified"), - new DERUTF8String("Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz"), null, - ASN1Boolean.TRUE, new ArrayList<>(0), null, null, - null); - ComponentIdentifierV2 compId2 = new ComponentIdentifierV2( - new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() - .getResource(JSON_FILE)).toURI()), "0x00050004"), - new DERUTF8String("Intel Corporation"), - new DERUTF8String("Ethernet Connection I217-V-faulty"), - new DERUTF8String("23:94:17:ba:86:5e"), new DERUTF8String("00"), null, - ASN1Boolean.FALSE, new ArrayList<>(0), null, null, - null); - ComponentIdentifierV2 compId3 = new ComponentIdentifierV2( - new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() - .getResource(JSON_FILE)).toURI()), "0x00090002"), - new DERUTF8String("Intel Corporation"), - new DERUTF8String("82580 Gigabit Network Connection-faulty"), - new DERUTF8String("90:e2:ba:31:83:10"), new DERUTF8String(""), null, - ASN1Boolean.FALSE, new ArrayList<>(0), null, null, - null); - ComponentIdentifierV2 deltaCompId2 = new ComponentIdentifierV2( - new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() - .getResource(JSON_FILE)).toURI()), "0x00050004"), - new DERUTF8String("Intel Corporation"), - new DERUTF8String("Ethernet Connection I217-V"), - new DERUTF8String("23:94:17:ba:86:5e"), new DERUTF8String("00"), null, - ASN1Boolean.FALSE, new ArrayList<>(0), null, null, - AttributeStatus.ADDED); - ComponentIdentifierV2 deltaCompId3 = new ComponentIdentifierV2( - new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() - .getResource(JSON_FILE)).toURI()), "0x00090002"), - new DERUTF8String("Intel Corporation"), - new DERUTF8String("82580 Gigabit Network Connection"), - new DERUTF8String("90:e2:ba:31:83:10"), new DERUTF8String(""), null, - ASN1Boolean.FALSE, new ArrayList<>(0), null, null, - AttributeStatus.ADDED); - - ComponentIdentifierV2 ciV21Faulty = new ComponentIdentifierV2(); - ComponentIdentifierV2 ciV22Faulty = new ComponentIdentifierV2(); - ciV21Faulty.setComponentManufacturer(compId2.getComponentManufacturer()); - ciV21Faulty.setComponentClass(compId2.getComponentClass()); - ciV21Faulty.setComponentModel(compId2.getComponentModel()); - ciV21Faulty.setComponentSerial(compId2.getComponentSerial()); - ciV21Faulty.setComponentRevision(compId2.getComponentRevision()); - ciV21Faulty.setComponentManufacturerId(compId2.getComponentManufacturerId()); - ciV21Faulty.setFieldReplaceable(compId2.getFieldReplaceable()); - ciV21Faulty.setComponentAddress(compId2.getComponentAddress()); - ciV21Faulty.setAttributeStatus(AttributeStatus.REMOVED); - ciV22Faulty.setComponentManufacturer(compId3.getComponentManufacturer()); - ciV22Faulty.setComponentClass(compId3.getComponentClass()); - ciV22Faulty.setComponentModel(compId3.getComponentModel()); - ciV22Faulty.setComponentSerial(compId3.getComponentSerial()); - ciV22Faulty.setComponentRevision(compId3.getComponentRevision()); - ciV22Faulty.setComponentManufacturerId(compId3.getComponentManufacturerId()); - ciV22Faulty.setFieldReplaceable(compId3.getFieldReplaceable()); - ciV22Faulty.setComponentAddress(compId3.getComponentAddress()); - ciV22Faulty.setAttributeStatus(AttributeStatus.REMOVED); - - List compList = new ArrayList<>(3); - compList.add(compId1); - compList.add(compId2); - compList.add(compId3); - - List delta1List = new ArrayList<>(2); - delta1List.add(ciV21Faulty); - delta1List.add(deltaCompId2); - List delta2List = new ArrayList<>(2); - delta1List.add(ciV22Faulty); - delta1List.add(deltaCompId3); - - when(base.isPlatformBase()).thenReturn(true); - when(delta1.isPlatformBase()).thenReturn(false); - when(delta2.isPlatformBase()).thenReturn(false); - when(base.getManufacturer()).thenReturn("innotek GmbH"); - when(base.getModel()).thenReturn("VirtualBox"); - when(base.getVersion()).thenReturn("1.2"); - when(base.getPlatformSerial()).thenReturn("62UIAE5"); - when(delta1.getPlatformSerial()).thenReturn("62UIAE5"); - when(delta2.getPlatformSerial()).thenReturn("62UIAE5"); - when(base.getPlatformChainType()).thenReturn("base"); - when(delta1.getPlatformChainType()).thenReturn("delta"); - when(delta2.getPlatformChainType()).thenReturn("delta"); - when(base.getSerialNumber()).thenReturn(BigInteger.valueOf(01)); - when(delta1.getSerialNumber()).thenReturn(BigInteger.valueOf(39821)); - when(delta2.getSerialNumber()).thenReturn(BigInteger.valueOf(39822)); - when(delta1.getHolderSerialNumber()).thenReturn(BigInteger.valueOf(02)); - when(delta2.getHolderSerialNumber()).thenReturn(BigInteger.valueOf(39821)); - when(base.getComponentIdentifiers()).thenReturn(compList); - when(delta1.getComponentIdentifiers()).thenReturn(delta1List); - when(delta2.getComponentIdentifiers()).thenReturn(delta2List); - - Map chainCredentials = new HashMap<>(0); - List certsUsed = new ArrayList<>(); - certsUsed.add(base); - chainCredentials.put(base, new SupplyChainValidation( - SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, - AppraisalStatus.Status.PASS, certsUsed, "")); - certsUsed.clear(); - certsUsed.add(delta1); - chainCredentials.put(delta1, new SupplyChainValidation( - SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, - AppraisalStatus.Status.PASS, certsUsed, "")); - certsUsed.clear(); - certsUsed.add(delta2); - chainCredentials.put(delta2, new SupplyChainValidation( - SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, - AppraisalStatus.Status.PASS, certsUsed, "")); +// PlatformCredential base = mock(PlatformCredential.class); +// PlatformCredential delta1 = mock(PlatformCredential.class); +// PlatformCredential delta2 = mock(PlatformCredential.class); +// +// ComponentIdentifierV2 compId1 = new ComponentIdentifierV2( +// new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() +// .getResource(JSON_FILE)).toURI()), "0x00010002"), +// new DERUTF8String("Intel"), +// new DERUTF8String("Core i7"), new DERUTF8String("Not Specified"), +// new DERUTF8String("Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz"), null, +// ASN1Boolean.TRUE, new ArrayList<>(0), null, null, +// null); +// ComponentIdentifierV2 compId2 = new ComponentIdentifierV2( +// new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() +// .getResource(JSON_FILE)).toURI()), "0x00050004"), +// new DERUTF8String("Intel Corporation"), +// new DERUTF8String("Ethernet Connection I217-V-faulty"), +// new DERUTF8String("23:94:17:ba:86:5e"), new DERUTF8String("00"), null, +// ASN1Boolean.FALSE, new ArrayList<>(0), null, null, +// null); +// ComponentIdentifierV2 compId3 = new ComponentIdentifierV2( +// new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() +// .getResource(JSON_FILE)).toURI()), "0x00090002"), +// new DERUTF8String("Intel Corporation"), +// new DERUTF8String("82580 Gigabit Network Connection-faulty"), +// new DERUTF8String("90:e2:ba:31:83:10"), new DERUTF8String(""), null, +// ASN1Boolean.FALSE, new ArrayList<>(0), null, null, +// null); +// ComponentIdentifierV2 deltaCompId2 = new ComponentIdentifierV2( +// new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() +// .getResource(JSON_FILE)).toURI()), "0x00050004"), +// new DERUTF8String("Intel Corporation"), +// new DERUTF8String("Ethernet Connection I217-V"), +// new DERUTF8String("23:94:17:ba:86:5e"), new DERUTF8String("00"), null, +// ASN1Boolean.FALSE, new ArrayList<>(0), null, null, +// AttributeStatus.ADDED); +// ComponentIdentifierV2 deltaCompId3 = new ComponentIdentifierV2( +// new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() +// .getResource(JSON_FILE)).toURI()), "0x00090002"), +// new DERUTF8String("Intel Corporation"), +// new DERUTF8String("82580 Gigabit Network Connection"), +// new DERUTF8String("90:e2:ba:31:83:10"), new DERUTF8String(""), null, +// ASN1Boolean.FALSE, new ArrayList<>(0), null, null, +// AttributeStatus.ADDED); +// +// ComponentIdentifierV2 ciV21Faulty = new ComponentIdentifierV2(); +// ComponentIdentifierV2 ciV22Faulty = new ComponentIdentifierV2(); +// ciV21Faulty.setComponentManufacturer(compId2.getComponentManufacturer()); +// ciV21Faulty.setComponentClass(compId2.getComponentClass()); +// ciV21Faulty.setComponentModel(compId2.getComponentModel()); +// ciV21Faulty.setComponentSerial(compId2.getComponentSerial()); +// ciV21Faulty.setComponentRevision(compId2.getComponentRevision()); +// ciV21Faulty.setComponentManufacturerId(compId2.getComponentManufacturerId()); +// ciV21Faulty.setFieldReplaceable(compId2.getFieldReplaceable()); +// ciV21Faulty.setComponentAddress(compId2.getComponentAddress()); +// ciV21Faulty.setAttributeStatus(AttributeStatus.REMOVED); +// ciV22Faulty.setComponentManufacturer(compId3.getComponentManufacturer()); +// ciV22Faulty.setComponentClass(compId3.getComponentClass()); +// ciV22Faulty.setComponentModel(compId3.getComponentModel()); +// ciV22Faulty.setComponentSerial(compId3.getComponentSerial()); +// ciV22Faulty.setComponentRevision(compId3.getComponentRevision()); +// ciV22Faulty.setComponentManufacturerId(compId3.getComponentManufacturerId()); +// ciV22Faulty.setFieldReplaceable(compId3.getFieldReplaceable()); +// ciV22Faulty.setComponentAddress(compId3.getComponentAddress()); +// ciV22Faulty.setAttributeStatus(AttributeStatus.REMOVED); +// +// List compList = new ArrayList<>(3); +// compList.add(compId1); +// compList.add(compId2); +// compList.add(compId3); +// +// List delta1List = new ArrayList<>(2); +// delta1List.add(ciV21Faulty); +// delta1List.add(deltaCompId2); +// List delta2List = new ArrayList<>(2); +// delta1List.add(ciV22Faulty); +// delta1List.add(deltaCompId3); +// +// when(base.isPlatformBase()).thenReturn(true); +// when(delta1.isPlatformBase()).thenReturn(false); +// when(delta2.isPlatformBase()).thenReturn(false); +// when(base.getManufacturer()).thenReturn("innotek GmbH"); +// when(base.getModel()).thenReturn("VirtualBox"); +// when(base.getVersion()).thenReturn("1.2"); +// when(base.getPlatformSerial()).thenReturn("62UIAE5"); +// when(delta1.getPlatformSerial()).thenReturn("62UIAE5"); +// when(delta2.getPlatformSerial()).thenReturn("62UIAE5"); +// when(base.getPlatformChainType()).thenReturn("base"); +// when(delta1.getPlatformChainType()).thenReturn("delta"); +// when(delta2.getPlatformChainType()).thenReturn("delta"); +// when(base.getSerialNumber()).thenReturn(BigInteger.valueOf(01)); +// when(delta1.getSerialNumber()).thenReturn(BigInteger.valueOf(39821)); +// when(delta2.getSerialNumber()).thenReturn(BigInteger.valueOf(39822)); +// when(delta1.getHolderSerialNumber()).thenReturn(BigInteger.valueOf(02)); +// when(delta2.getHolderSerialNumber()).thenReturn(BigInteger.valueOf(39821)); +// when(base.getComponentIdentifiers()).thenReturn(compList); +// when(delta1.getComponentIdentifiers()).thenReturn(delta1List); +// when(delta2.getComponentIdentifiers()).thenReturn(delta2List); +// +// Map chainCredentials = new HashMap<>(0); +// List certsUsed = new ArrayList<>(); +// certsUsed.add(base); +// chainCredentials.put(base, new SupplyChainValidation( +// SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, +// AppraisalStatus.Status.PASS, certsUsed, "")); +// certsUsed.clear(); +// certsUsed.add(delta1); +// chainCredentials.put(delta1, new SupplyChainValidation( +// SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, +// AppraisalStatus.Status.PASS, certsUsed, "")); +// certsUsed.clear(); +// certsUsed.add(delta2); +// chainCredentials.put(delta2, new SupplyChainValidation( +// SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, +// AppraisalStatus.Status.PASS, certsUsed, "")); // AppraisalStatus result = CredentialValidator // .validateDeltaPlatformCredentialAttributes(delta2, @@ -1910,99 +1910,99 @@ public class SupplyChainCredentialValidatorTest { // @Test public final void testValidateChainFailure() throws IOException, URISyntaxException { - DeviceInfoReport deviceInfoReport = setupDeviceInfoReportWithComponents( - SAMPLE_PACCOR_OUTPUT_TXT); +// DeviceInfoReport deviceInfoReport = setupDeviceInfoReportWithComponents( +// SAMPLE_PACCOR_OUTPUT_TXT); - PlatformCredential base = mock(PlatformCredential.class); - PlatformCredential delta1 = mock(PlatformCredential.class); - - ComponentIdentifierV2 compId1 = new ComponentIdentifierV2( - new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() - .getResource(JSON_FILE)).toURI()), "0x00010002"), - new DERUTF8String("Intel"), - new DERUTF8String("Core i7"), new DERUTF8String("Not Specified"), - new DERUTF8String("Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz"), null, - ASN1Boolean.TRUE, new ArrayList<>(0), null, null, - null); - ComponentIdentifierV2 compId2 = new ComponentIdentifierV2( - new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() - .getResource(JSON_FILE)).toURI()), "0x00050004"), - new DERUTF8String("Intel Corporation"), - new DERUTF8String("Ethernet Connection I217-V-faulty"), - new DERUTF8String("23:94:17:ba:86:5e"), new DERUTF8String("00"), null, - ASN1Boolean.FALSE, new ArrayList<>(0), null, null, - null); - ComponentIdentifierV2 compId3 = new ComponentIdentifierV2( - new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() - .getResource(JSON_FILE)).toURI()), "0x00090002"), - new DERUTF8String("Intel Corporation"), - new DERUTF8String("82580 Gigabit Network Connection-faulty"), - new DERUTF8String("90:e2:ba:31:83:10"), new DERUTF8String(""), null, - ASN1Boolean.FALSE, new ArrayList<>(0), null, null, - null); - ComponentIdentifierV2 deltaCompId2 = new ComponentIdentifierV2( - new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() - .getResource(JSON_FILE)).toURI()), "0x00050004"), - new DERUTF8String("Intel Corporation"), - new DERUTF8String("Ethernet Connection I217-V"), - new DERUTF8String("23:94:17:ba:86:5e"), new DERUTF8String("00"), null, - ASN1Boolean.FALSE, new ArrayList<>(0), null, null, - AttributeStatus.ADDED); - - ComponentIdentifierV2 ciV21Faulty = new ComponentIdentifierV2(); - ComponentIdentifierV2 ciV22Faulty = new ComponentIdentifierV2(); - ciV21Faulty.setComponentManufacturer(compId2.getComponentManufacturer()); - ciV21Faulty.setComponentModel(compId2.getComponentModel()); - ciV21Faulty.setComponentSerial(compId2.getComponentSerial()); - ciV21Faulty.setComponentRevision(compId2.getComponentRevision()); - ciV21Faulty.setComponentManufacturerId(compId2.getComponentManufacturerId()); - ciV21Faulty.setFieldReplaceable(compId2.getFieldReplaceable()); - ciV21Faulty.setComponentAddress(compId2.getComponentAddress()); - ciV21Faulty.setAttributeStatus(AttributeStatus.REMOVED); - ciV22Faulty.setComponentManufacturer(compId3.getComponentManufacturer()); - ciV22Faulty.setComponentModel(compId3.getComponentModel()); - ciV22Faulty.setComponentSerial(compId3.getComponentSerial()); - ciV22Faulty.setComponentRevision(compId3.getComponentRevision()); - ciV22Faulty.setComponentManufacturerId(compId3.getComponentManufacturerId()); - ciV22Faulty.setFieldReplaceable(compId3.getFieldReplaceable()); - ciV22Faulty.setComponentAddress(compId3.getComponentAddress()); - ciV22Faulty.setAttributeStatus(AttributeStatus.REMOVED); - - List compList = new ArrayList<>(3); - compList.add(compId1); - compList.add(compId2); - compList.add(compId3); - - List delta1List = new ArrayList<>(2); - delta1List.add(ciV21Faulty); - delta1List.add(deltaCompId2); - - when(base.isPlatformBase()).thenReturn(true); - when(delta1.isPlatformBase()).thenReturn(false); - when(base.getManufacturer()).thenReturn("innotek GmbH"); - when(base.getModel()).thenReturn("VirtualBox"); - when(base.getVersion()).thenReturn("1.2"); - when(base.getPlatformSerial()).thenReturn("0"); - when(delta1.getPlatformSerial()).thenReturn("0"); - when(base.getPlatformChainType()).thenReturn("base"); - when(delta1.getPlatformChainType()).thenReturn("delta"); - when(base.getSerialNumber()).thenReturn(BigInteger.ZERO); - when(delta1.getSerialNumber()).thenReturn(BigInteger.ONE); - when(delta1.getHolderSerialNumber()).thenReturn(BigInteger.ZERO); - when(base.getComponentIdentifiers()).thenReturn(compList); - when(delta1.getComponentIdentifiers()).thenReturn(delta1List); - - Map chainCredentials = new HashMap<>(0); - List certsUsed = new ArrayList<>(); - certsUsed.add(base); - chainCredentials.put(base, new SupplyChainValidation( - SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, - AppraisalStatus.Status.PASS, certsUsed, "")); - certsUsed.clear(); - certsUsed.add(delta1); - chainCredentials.put(delta1, new SupplyChainValidation( - SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, - AppraisalStatus.Status.PASS, certsUsed, "")); +// PlatformCredential base = mock(PlatformCredential.class); +// PlatformCredential delta1 = mock(PlatformCredential.class); +// +// ComponentIdentifierV2 compId1 = new ComponentIdentifierV2( +// new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() +// .getResource(JSON_FILE)).toURI()), "0x00010002"), +// new DERUTF8String("Intel"), +// new DERUTF8String("Core i7"), new DERUTF8String("Not Specified"), +// new DERUTF8String("Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz"), null, +// ASN1Boolean.TRUE, new ArrayList<>(0), null, null, +// null); +// ComponentIdentifierV2 compId2 = new ComponentIdentifierV2( +// new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() +// .getResource(JSON_FILE)).toURI()), "0x00050004"), +// new DERUTF8String("Intel Corporation"), +// new DERUTF8String("Ethernet Connection I217-V-faulty"), +// new DERUTF8String("23:94:17:ba:86:5e"), new DERUTF8String("00"), null, +// ASN1Boolean.FALSE, new ArrayList<>(0), null, null, +// null); +// ComponentIdentifierV2 compId3 = new ComponentIdentifierV2( +// new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() +// .getResource(JSON_FILE)).toURI()), "0x00090002"), +// new DERUTF8String("Intel Corporation"), +// new DERUTF8String("82580 Gigabit Network Connection-faulty"), +// new DERUTF8String("90:e2:ba:31:83:10"), new DERUTF8String(""), null, +// ASN1Boolean.FALSE, new ArrayList<>(0), null, null, +// null); +// ComponentIdentifierV2 deltaCompId2 = new ComponentIdentifierV2( +// new ComponentClass(Paths.get(Objects.requireNonNull(this.getClass() +// .getResource(JSON_FILE)).toURI()), "0x00050004"), +// new DERUTF8String("Intel Corporation"), +// new DERUTF8String("Ethernet Connection I217-V"), +// new DERUTF8String("23:94:17:ba:86:5e"), new DERUTF8String("00"), null, +// ASN1Boolean.FALSE, new ArrayList<>(0), null, null, +// AttributeStatus.ADDED); +// +// ComponentIdentifierV2 ciV21Faulty = new ComponentIdentifierV2(); +// ComponentIdentifierV2 ciV22Faulty = new ComponentIdentifierV2(); +// ciV21Faulty.setComponentManufacturer(compId2.getComponentManufacturer()); +// ciV21Faulty.setComponentModel(compId2.getComponentModel()); +// ciV21Faulty.setComponentSerial(compId2.getComponentSerial()); +// ciV21Faulty.setComponentRevision(compId2.getComponentRevision()); +// ciV21Faulty.setComponentManufacturerId(compId2.getComponentManufacturerId()); +// ciV21Faulty.setFieldReplaceable(compId2.getFieldReplaceable()); +// ciV21Faulty.setComponentAddress(compId2.getComponentAddress()); +// ciV21Faulty.setAttributeStatus(AttributeStatus.REMOVED); +// ciV22Faulty.setComponentManufacturer(compId3.getComponentManufacturer()); +// ciV22Faulty.setComponentModel(compId3.getComponentModel()); +// ciV22Faulty.setComponentSerial(compId3.getComponentSerial()); +// ciV22Faulty.setComponentRevision(compId3.getComponentRevision()); +// ciV22Faulty.setComponentManufacturerId(compId3.getComponentManufacturerId()); +// ciV22Faulty.setFieldReplaceable(compId3.getFieldReplaceable()); +// ciV22Faulty.setComponentAddress(compId3.getComponentAddress()); +// ciV22Faulty.setAttributeStatus(AttributeStatus.REMOVED); +// +// List compList = new ArrayList<>(3); +// compList.add(compId1); +// compList.add(compId2); +// compList.add(compId3); +// +// List delta1List = new ArrayList<>(2); +// delta1List.add(ciV21Faulty); +// delta1List.add(deltaCompId2); +// +// when(base.isPlatformBase()).thenReturn(true); +// when(delta1.isPlatformBase()).thenReturn(false); +// when(base.getManufacturer()).thenReturn("innotek GmbH"); +// when(base.getModel()).thenReturn("VirtualBox"); +// when(base.getVersion()).thenReturn("1.2"); +// when(base.getPlatformSerial()).thenReturn("0"); +// when(delta1.getPlatformSerial()).thenReturn("0"); +// when(base.getPlatformChainType()).thenReturn("base"); +// when(delta1.getPlatformChainType()).thenReturn("delta"); +// when(base.getSerialNumber()).thenReturn(BigInteger.ZERO); +// when(delta1.getSerialNumber()).thenReturn(BigInteger.ONE); +// when(delta1.getHolderSerialNumber()).thenReturn(BigInteger.ZERO); +// when(base.getComponentIdentifiers()).thenReturn(compList); +// when(delta1.getComponentIdentifiers()).thenReturn(delta1List); +// +// Map chainCredentials = new HashMap<>(0); +// List certsUsed = new ArrayList<>(); +// certsUsed.add(base); +// chainCredentials.put(base, new SupplyChainValidation( +// SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, +// AppraisalStatus.Status.PASS, certsUsed, "")); +// certsUsed.clear(); +// certsUsed.add(delta1); +// chainCredentials.put(delta1, new SupplyChainValidation( +// SupplyChainValidation.ValidationType.PLATFORM_CREDENTIAL, +// AppraisalStatus.Status.PASS, certsUsed, "")); // AppraisalStatus result = CredentialValidator // .validateDeltaPlatformCredentialAttributes(delta1,