Skip to content

Commit a424cee

Browse files
authored
Accept CRLURI or NAME under DISTRIBUTIONNAME (#131)
1 parent b183e8b commit a424cee

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ plugins {
77
}
88

99
// version number
10-
def base_version = '1.5.0'
11-
def base_release = 'beta5'
10+
def base_version = '1.5.1'
11+
def base_release = '1'
1212
def archive_version = "${base_version}-${base_release}"
1313

1414
version = "${base_version}${base_release}"

src/main/java/json/OtherExtensionsJsonHelper.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public enum CrlJson {
3737
TYPE,
3838
NAME,
3939
REASON,
40-
ISSUER;
40+
ISSUER,
41+
CRLURI;
4142
}
4243

4344
public enum TargetInformationJson {
@@ -111,15 +112,20 @@ public static final CRLDistPoint crlFromJsonFile(final String filename) {
111112
final JsonNode issuerNode = crlNode.get(CrlJson.ISSUER.name());
112113

113114
DistributionPointName dpn = null;
114-
if (distNameNode.has(CrlJson.TYPE.name()) && distNameNode.has(CrlJson.NAME.name())) {
115+
String nameNodeText = null;
116+
if (distNameNode.has(CrlJson.NAME.name())) {
117+
nameNodeText = distNameNode.get(CrlJson.NAME.name()).asText();
118+
} else if (distNameNode.has(CrlJson.CRLURI.name())) {
119+
nameNodeText = distNameNode.get(CrlJson.CRLURI.name()).asText();
120+
}
121+
if (distNameNode.has(CrlJson.TYPE.name()) && nameNodeText != null) {
115122
final JsonNode typeNode = distNameNode.get(CrlJson.TYPE.name());
116-
final JsonNode nameNode = distNameNode.get(CrlJson.NAME.name());
117123

118124
// TYPE=0 (fullName): URI or DN; TYPE=1 (nameRelativeToCRLIssuer): always RDN
119125
if (typeNode.asInt() == 0) {
120-
dpn = new DistributionPointName(0, new GeneralNames(parseGeneralName(nameNode.asText())));
126+
dpn = new DistributionPointName(0, new GeneralNames(parseGeneralName(nameNodeText)));
121127
} else {
122-
dpn = new DistributionPointName(typeNode.asInt(), new GeneralNames(new GeneralName(new X500Name(nameNode.asText()))));
128+
dpn = new DistributionPointName(typeNode.asInt(), new GeneralNames(new GeneralName(new X500Name(nameNodeText))));
123129
}
124130
}
125131

src/test/resources/otherExt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"CRLDISTRIBUTION": {
2323
"DISTRIBUTIONNAME": {
2424
"TYPE": "0",
25-
"NAME": "http://crl.example.com/platform.crl"
25+
"CRLURI": "http://crl.example.com/platform.crl"
2626
},
2727
"REASON": "8",
2828
"ISSUER": "CN=MyApp ACES CA 2, OU=MyApp Public Sector, O=MyApp, C=US"

0 commit comments

Comments
 (0)