diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/entity/userdefined/certificate/EndorsementCredential.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/entity/userdefined/certificate/EndorsementCredential.java index 257e466e..8c12e05b 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/entity/userdefined/certificate/EndorsementCredential.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/entity/userdefined/certificate/EndorsementCredential.java @@ -13,7 +13,6 @@ import lombok.NoArgsConstructor; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; -import org.bouncycastle.asn1.ASN1ApplicationSpecific; import org.bouncycastle.asn1.ASN1BitString; import org.bouncycastle.asn1.ASN1Boolean; import org.bouncycastle.asn1.ASN1Encodable; @@ -55,7 +54,7 @@ import java.util.Set; /** * - * This class persists Certificate Authority credentials by extending the base Certificate + * This class persists an Endorsement Credential by extending the base Certificate * class with fields unique to Endorsement credentials, as defined in the Trusted * Computing Group Credential Profiles, specification v.1.2. * @@ -529,10 +528,6 @@ public class EndorsementCredential extends DeviceAssociatedCertificate { e.printStackTrace(); } } - - } else if (component instanceof ASN1ApplicationSpecific) { - parseSingle(((ASN1ApplicationSpecific) component).getObject(), addToMapping, key); - } else if (component instanceof DERBMPString) { if (addToMapping) { String bmpStr = ((DERBMPString) component).getString(); diff --git a/HIRS_Utils/src/test/java/hirs/utils/BouncyCastleUtilsTest.java b/HIRS_Utils/src/test/java/hirs/utils/BouncyCastleUtilsTest.java index 8c706f23..14116536 100644 --- a/HIRS_Utils/src/test/java/hirs/utils/BouncyCastleUtilsTest.java +++ b/HIRS_Utils/src/test/java/hirs/utils/BouncyCastleUtilsTest.java @@ -1,6 +1,5 @@ package hirs.utils; -import lombok.extern.log4j.Log4j2; import org.apache.logging.log4j.util.Strings; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -9,7 +8,6 @@ import static org.junit.jupiter.api.Assertions.assertFalse; /** * Tests methods in the (@link BouncyCastleUtils) utility class. */ -@Log4j2 public class BouncyCastleUtilsTest { private static final String VALID_RDN_STRING = "OU=PCTest,O=example.com,C=US"; @@ -28,6 +26,7 @@ public class BouncyCastleUtilsTest { VALID_RDN_STRING, VALID_RDN_STRING_SWITCHED)); assertTrue(BouncyCastleUtils.x500NameCompare( VALID_RDN_STRING, VALID_RDN_STRING_UPPERCASE)); + assertTrue(BouncyCastleUtils.x500NameCompare(Strings.EMPTY, Strings.EMPTY)); } /** @@ -40,7 +39,6 @@ public class BouncyCastleUtilsTest { // Error that aren't thrown but logged assertFalse(BouncyCastleUtils.x500NameCompare(VALID_RDN_STRING, Strings.EMPTY)); assertFalse(BouncyCastleUtils.x500NameCompare(Strings.EMPTY, VALID_RDN_STRING)); - assertFalse(BouncyCastleUtils.x500NameCompare(Strings.EMPTY, Strings.EMPTY)); assertFalse(BouncyCastleUtils.x500NameCompare( VALID_RDN_STRING, MALFORMED_RDN_STRING)); assertFalse(BouncyCastleUtils.x500NameCompare(