Skip to content

Commit

Permalink
Merge pull request #228 from brightsparklabs/feature/INS-494-update-d…
Browse files Browse the repository at this point in the history
…ependencies

INS-494: Updated bouncy castle version to match libjitsi dependencies.
  • Loading branch information
al-jeyapal authored Nov 5, 2024
2 parents e7b8a68 + e1326af commit c92e9a6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 35 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dependencies {
implementation(
"com.google.guava:guava:33.3.1-jre",
// Do not upgrade the following package unless you are updating the relevant Asanti parser classes.
"org.bouncycastle:bcprov-jdk15on:1.70",
"org.bouncycastle:bcprov-jdk18on:1.75",
"org.slf4j:slf4j-api:${versions.slf4j}",
"joda-time:joda-time:2.13.0",
"commons-cli:commons-cli:1.9.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,12 @@ public static ImmutableList<RawAsnData> read(ByteSource source, int maxPDUs)
private static void processDerObject(
ASN1Primitive derObject, String prefix, Map<String, byte[]> tagsToData, int index)
throws IOException {
if (derObject instanceof ASN1Sequence) {
processSequence((ASN1Sequence) derObject, prefix, tagsToData);
} else if (derObject instanceof ASN1Set) {
processSet((ASN1Set) derObject, prefix, tagsToData);
} else if (derObject instanceof ASN1TaggedObject) {
processTaggedObject((ASN1TaggedObject) derObject, prefix, tagsToData, index);
} else if (derObject instanceof DERApplicationSpecific) {
processApplicationSpecific(
(DERApplicationSpecific) derObject, prefix, tagsToData, index);
if (derObject instanceof ASN1Sequence sequence) {
processSequence(sequence, prefix, tagsToData);
} else if (derObject instanceof ASN1Set asn1Set) {
processSet(asn1Set, prefix, tagsToData);
} else if (derObject instanceof ASN1TaggedObject asn1TaggedObject) {
processTaggedObject(asn1TaggedObject, prefix, tagsToData, index);
} else {
processPrimitiveDerObject(derObject, prefix, tagsToData);
}
Expand Down Expand Up @@ -206,13 +203,18 @@ private static void processTaggedObject(
int index)
throws IOException {

ASN1Primitive obj = asnTaggedObject.getObject();
ASN1Primitive obj = asnTaggedObject.getBaseObject().toASN1Primitive();

prefix =
prefix
+ "/"
+ AsnSchemaTag.createRawTag(
index, String.valueOf(asnTaggedObject.getTagNo()));
if (asnTaggedObject.getTagClass() == BERTags.APPLICATION) {
// Process ASN.1 application objects.
prefix = prefix + "/" + asnTaggedObject.getTagNo();
} else {
prefix =
prefix
+ "/"
+ AsnSchemaTag.createRawTag(
index, String.valueOf(asnTaggedObject.getTagNo()));
}

int containingType = getType(asnTaggedObject);
if (isConstructedType(containingType)) {
Expand All @@ -233,25 +235,8 @@ private static void processTaggedObject(
prefix = prefix + "/" + AsnSchemaTag.createRawTagUniversal(index, number);
}

processDerObject(asnTaggedObject.getObject(), prefix, tagsToData, index);
}

/**
* Processes an ASN.1 'ApplicationSpecific' object and stores the tags/data found in it
*
* @param asnApplicationSpecific object to process
* @param prefix prefix to prepend to any tags found
* @param tagsToData storage for the tags/data found
* @throws IOException if any errors occur reading from the file
*/
private static void processApplicationSpecific(
DERApplicationSpecific asnApplicationSpecific,
String prefix,
Map<String, byte[]> tagsToData,
int index)
throws IOException {
prefix = prefix + "/" + asnApplicationSpecific.getApplicationTag();
processDerObject(asnApplicationSpecific.getObject(), prefix, tagsToData, index);
processDerObject(
asnTaggedObject.getBaseObject().toASN1Primitive(), prefix, tagsToData, index);
}

/**
Expand Down

0 comments on commit c92e9a6

Please sign in to comment.