Skip to content

Commit a5cfc94

Browse files
authored
Merge pull request #27 from DirectProjectJavaRI/develop
Releasing config-service-jar 8.1.0
2 parents 36e923b + 1798179 commit a5cfc94

File tree

2 files changed

+46
-54
lines changed

2 files changed

+46
-54
lines changed

pom.xml

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.nhind</groupId>
55
<artifactId>config-service-jar</artifactId>
6-
<version>8.0.5</version>
6+
<version>8.1.0</version>
77
<packaging>jar</packaging>
88
<name>NHIN Direct Java RI config service jar</name>
99
<description>NHIN Direct Java RI config service jar.</description>
@@ -48,7 +48,6 @@
4848
<properties>
4949
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5050
<commons-net.version>3.8.0</commons-net.version>
51-
<bcprov-jdk15on.version>1.68</bcprov-jdk15on.version>
5251
</properties>
5352
<dependencies>
5453
<dependency>
@@ -58,28 +57,18 @@
5857
<dependency>
5958
<groupId>org.nhind</groupId>
6059
<artifactId>config-store</artifactId>
61-
<version>8.0.0</version>
62-
</dependency>
63-
<dependency>
64-
<groupId>org.nhind</groupId>
65-
<artifactId>config-model</artifactId>
66-
<version>8.0.0</version>
67-
</dependency>
60+
<version>8.1.0</version>
61+
</dependency>
6862
<dependency>
6963
<groupId>org.nhind</groupId>
7064
<artifactId>direct-common</artifactId>
71-
<version>8.0.0</version>
65+
<version>8.1.0</version>
7266
</dependency>
7367
<dependency>
7468
<groupId>commons-net</groupId>
7569
<artifactId>commons-net</artifactId>
7670
<version>${commons-net.version}</version>
77-
</dependency>
78-
<dependency>
79-
<groupId>org.bouncycastle</groupId>
80-
<artifactId>bcprov-jdk15on</artifactId>
81-
<version>${bcprov-jdk15on.version}</version>
82-
</dependency>
71+
</dependency>
8372
<dependency>
8473
<groupId>com.h2database</groupId>
8574
<artifactId>h2</artifactId>
@@ -190,6 +179,15 @@
190179
<version>3.0.1</version>
191180
</plugin>
192181
-->
182+
<plugin>
183+
<groupId>org.sonatype.central</groupId>
184+
<artifactId>central-publishing-maven-plugin</artifactId>
185+
<version>0.8.0</version>
186+
<extensions>true</extensions>
187+
<configuration>
188+
<publishingServerId>central</publishingServerId>
189+
</configuration>
190+
</plugin>
193191
</plugins>
194192
</build>
195193
<reporting>
@@ -249,24 +247,4 @@
249247
</plugin>
250248
</plugins>
251249
</reporting>
252-
<distributionManagement>
253-
<site>
254-
<id>nhind-site</id>
255-
<name>NHIN Direct API publication site</name>
256-
<url>sftp://api.nhindirect.org/x/www/api.nhindirect.org/java/site/config/config-service-jar/${project.version}</url>
257-
</site>
258-
<snapshotRepository>
259-
<id>sonatype-snapshot</id>
260-
<name>Sonatype OSS Maven SNAPSHOT Repository</name>
261-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
262-
<uniqueVersion>false</uniqueVersion>
263-
</snapshotRepository>
264-
<repository>
265-
<id>sonatype-release</id>
266-
<name>Sonatype OSS Maven Release Repositor</name>
267-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
268-
<uniqueVersion>false</uniqueVersion>
269-
</repository>
270-
</distributionManagement>
271-
272250
</project>

src/main/java/org/nhindirect/config/processor/impl/DefaultBundleRefreshProcessorImpl.java

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -292,28 +292,42 @@ public Mono<?> refreshBundle(TrustBundle bundle)
292292
protected Mono<Collection<X509Certificate>> convertRawBundleToAnchorCollection(byte[] rawBundle, final TrustBundle existingBundle,
293293
final LocalDateTime processAttempStart)
294294
{
295-
Collection<? extends Certificate> bundleCerts = null;
296-
InputStream inStream = null;
297-
// check to see if its an unsigned PKCS7 container
295+
296+
boolean isSigned = false;
297+
298298
try
299299
{
300-
inStream = new ByteArrayInputStream(rawBundle);
301-
bundleCerts = CertificateFactory.getInstance("X.509").generateCertificates(inStream);
302-
303-
// in Java 7, an invalid bundle may be returned as a null instead of throw an exception
304-
// if its null and has no anchors, then try again as a signed bundle
305-
if (bundleCerts != null && bundleCerts.size() == 0)
306-
bundleCerts = null;
307-
300+
final CMSSignedData signed = new CMSSignedData(rawBundle);
301+
if (signed.getSignerInfos().getSigners().size() > 0)
302+
isSigned = true;
308303
}
309-
catch (Exception e)
310-
{
311-
/* no-op for now.... this may not be a p7b, so try it as a signed message*/
312-
}
313-
finally
314-
{
315-
IOUtils.closeQuietly(inStream);
304+
catch (Exception e) {/*no-op*/}
305+
306+
Collection<? extends Certificate> bundleCerts = null;
307+
InputStream inStream = null;
308+
309+
if (!isSigned) {
310+
try
311+
{
312+
inStream = new ByteArrayInputStream(rawBundle);
313+
bundleCerts = CertificateFactory.getInstance("X.509").generateCertificates(inStream);
314+
315+
// in Java 7, an invalid bundle may be returned as a null instead of throw an exception
316+
// if its null and has no anchors, then try again as a signed bundle
317+
if (bundleCerts != null && bundleCerts.size() == 0)
318+
bundleCerts = null;
319+
320+
}
321+
catch (Exception e)
322+
{
323+
/* no-op for now.... this may not be a p7b, so try it as a signed message*/
324+
}
325+
finally
326+
{
327+
IOUtils.closeQuietly(inStream);
328+
}
316329
}
330+
317331

318332
// didnt work... try again as a CMS signed message
319333
if (bundleCerts == null)

0 commit comments

Comments
 (0)