Initial Commit. This sets up the update bouncy castle for testing.

This commit is contained in:
Cyrus 2024-01-24 09:09:12 -05:00
parent b12f0654ea
commit ab4c608d8d
3 changed files with 11 additions and 13 deletions

View File

@ -324,8 +324,7 @@ public class EndorsementCredential extends DeviceAssociatedCertificate {
ASN1Integer ver;
// Parse Security Assertions Version
if (seq.getObjectAt(seqPosition) instanceof ASN1Integer) {
ver = (ASN1Integer) seq.getObjectAt(seqPosition);
seqPosition++;
ver = (ASN1Integer) seq.getObjectAt(seqPosition++);
} else {
// Default value of 1 if field not found
ver = new ASN1Integer(BigInteger.ONE);
@ -334,8 +333,7 @@ public class EndorsementCredential extends DeviceAssociatedCertificate {
ASN1Boolean fieldUpgradeable;
// Parse Security Assertions Field Upgradeable
if (seq.getObjectAt(seqPosition) instanceof ASN1Boolean) {
fieldUpgradeable = (ASN1Boolean) seq.getObjectAt(seqPosition);
seqPosition++;
fieldUpgradeable = (ASN1Boolean) seq.getObjectAt(seqPosition++);
} else {
// Default value of false if field not found
fieldUpgradeable = ASN1Boolean.getInstance(false);

View File

@ -201,15 +201,15 @@ public class CommonCriteriaMeasures {
//Get all the mandatory values
int index = 0;
version = ASN1IA5String.getInstance(sequence.getObjectAt(index++));
ASN1Enumerated enumarated = ASN1Enumerated.getInstance(sequence.getObjectAt(index++));
ASN1Enumerated enumerated = ASN1Enumerated.getInstance(sequence.getObjectAt(index++));
//Throw exception when is not between 1 and 7
if (enumarated.getValue().intValue() <= 0
|| enumarated.getValue().intValue() > EvaluationAssuranceLevel.values().length) {
if (enumerated.getValue().intValue() <= 0
|| enumerated.getValue().intValue() > EvaluationAssuranceLevel.values().length) {
throw new IllegalArgumentException("Invalid assurance level.");
}
assuranceLevel = EvaluationAssuranceLevel.values()[enumarated.getValue().intValue() - 1];
enumarated = ASN1Enumerated.getInstance(sequence.getObjectAt(index++));
evaluationStatus = EvaluationStatus.values()[enumarated.getValue().intValue()];
assuranceLevel = EvaluationAssuranceLevel.values()[enumerated.getValue().intValue() - 1];
enumerated = ASN1Enumerated.getInstance(sequence.getObjectAt(index++));
evaluationStatus = EvaluationStatus.values()[enumerated.getValue().intValue()];
//Default plus value
plus = ASN1Boolean.FALSE;
@ -233,9 +233,9 @@ public class CommonCriteriaMeasures {
ASN1TaggedObject taggedObj = ASN1TaggedObject.getInstance(sequence.getObjectAt(index));
switch (taggedObj.getTagNo()) {
case STRENGTH_OF_FUNCTION:
enumarated = ASN1Enumerated.getInstance(taggedObj, false);
enumerated = ASN1Enumerated.getInstance(taggedObj, false);
strengthOfFunction
= StrengthOfFunction.values()[enumarated.getValue().intValue()];
= StrengthOfFunction.values()[enumerated.getValue().intValue()];
break;
case PROFILE_OID:
profileOid = ASN1ObjectIdentifier.getInstance(taggedObj, false);

View File

@ -15,7 +15,7 @@ dependencyResolutionManagement {
library('commons-codec', 'commons-codec:commons-codec:1.15')
library('commons_io', 'commons-io:commons-io:2.11.0')
library('commons-lang3', 'org.apache.commons:commons-lang3:3.13.0')
library('bouncycastle', 'org.bouncycastle:bcmail-jdk15on:1.70')
library('bouncycastle', 'org.bouncycastle:bcmail-jdk18on:1.77')
library('glassfish_json', 'org.glassfish:javax.json:1.1.4')
library('glassfish_jaxb_runtime', 'org.glassfish.jaxb:jaxb-runtime:2.3.1')
library('gson', 'com.google.code.gson:gson:2.10.1')