aboutsummaryrefslogtreecommitdiff
path: root/id/server/stork2-saml-engine
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/stork2-saml-engine')
-rw-r--r--id/server/stork2-saml-engine/pom.xml37
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java35
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java36
3 files changed, 67 insertions, 41 deletions
diff --git a/id/server/stork2-saml-engine/pom.xml b/id/server/stork2-saml-engine/pom.xml
index 015697c5c..5a6621f12 100644
--- a/id/server/stork2-saml-engine/pom.xml
+++ b/id/server/stork2-saml-engine/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>MOA.id</groupId>
<artifactId>moa-id</artifactId>
- <version>2.0.1</version>
+ <version>2.x</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -49,6 +49,12 @@
<groupId>eu.stork</groupId>
<artifactId>Commons</artifactId>
<version>${commons.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk16</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -84,21 +90,21 @@
<artifactId>slf4j-api</artifactId>
<version>1.7.6</version>
</dependency>
- <dependency>
+<!-- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.6</version>
- </dependency>
+ </dependency> -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.6</version>
</dependency>
- <dependency>
+<!-- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.7.6</version>
- </dependency>
+ </dependency> -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
@@ -145,9 +151,30 @@
<skip>true</skip>
</configuration>
</plugin>
+
</plugins>
</pluginManagement>
<plugins>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>properties-maven-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <goals>
+ <goal>read-project-properties</goal>
+ </goals>
+ <configuration>
+ <files>
+ <file>${basedir}/../../../moa-id.properties</file>
+ </files>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java
index 6d9ac9ce3..06e80dc14 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java
@@ -41,7 +41,6 @@ import eu.stork.peps.auth.engine.X509PrincipalUtil;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.NotImplementedException;
import org.bouncycastle.jce.X509Principal;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.opensaml.Configuration;
import org.opensaml.common.SAMLObject;
import org.opensaml.common.SignableSAMLObject;
@@ -518,23 +517,23 @@ public final class SignP12 implements SAMLEngineSignI {
FileInputStream fisTrustStore = null;
try {
- // Dynamically register Bouncy Castle provider.
- boolean found = false;
- // Check if BouncyCastle is already registered as a provider
- final Provider[] providers = Security.getProviders();
- for (int i = 0; i < providers.length; i++) {
- if (providers[i].getName().equals(
- BouncyCastleProvider.PROVIDER_NAME)) {
- found = true;
- }
- }
-
- // Register only if the provider has not been previously registered
- if (!found) {
- LOG.debug("SAMLCore: Register Bouncy Castle provider.");
- Security.insertProviderAt(new BouncyCastleProvider(), Security
- .getProviders().length);
- }
+// // Dynamically register Bouncy Castle provider.
+// boolean found = false;
+// // Check if BouncyCastle is already registered as a provider
+// final Provider[] providers = Security.getProviders();
+// for (int i = 0; i < providers.length; i++) {
+// if (providers[i].getName().equals(
+// BouncyCastleProvider.PROVIDER_NAME)) {
+// found = true;
+// }
+// }
+//
+// // Register only if the provider has not been previously registered
+// if (!found) {
+// LOG.debug("SAMLCore: Register Bouncy Castle provider.");
+// Security.insertProviderAt(new BouncyCastleProvider(), Security
+// .getProviders().length);
+// }
p12Store = KeyStore.getInstance(properties
.getProperty("keystoreType"));
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java
index e31688069..39be750cd 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java
@@ -22,7 +22,7 @@ import eu.stork.peps.exceptions.SAMLEngineException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.NotImplementedException;
import org.bouncycastle.jce.X509Principal;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
+//import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.opensaml.Configuration;
import org.opensaml.common.SAMLObject;
import org.opensaml.common.SignableSAMLObject;
@@ -488,23 +488,23 @@ public class SignSW implements SAMLEngineSignI {
LOG.info("Load Cryptographic Service Provider");
FileInputStream fis = null;
try {
- // Dynamically register Bouncy Castle provider.
- boolean found = false;
- // Check if BouncyCastle is already registered as a provider
- final Provider[] providers = Security.getProviders();
- for (int i = 0; i < providers.length; i++) {
- if (providers[i].getName().equals(
- BouncyCastleProvider.PROVIDER_NAME)) {
- found = true;
- }
- }
-
- // Register only if the provider has not been previously registered
- if (!found) {
- LOG.info("SAMLCore: Register Bouncy Castle provider.");
- Security.insertProviderAt(new BouncyCastleProvider(), Security
- .getProviders().length);
- }
+// // Dynamically register Bouncy Castle provider.
+// boolean found = false;
+// // Check if BouncyCastle is already registered as a provider
+// final Provider[] providers = Security.getProviders();
+// for (int i = 0; i < providers.length; i++) {
+// if (providers[i].getName().equals(
+// BouncyCastleProvider.PROVIDER_NAME)) {
+// found = true;
+// }
+// }
+//
+// // Register only if the provider has not been previously registered
+// if (!found) {
+// LOG.info("SAMLCore: Register Bouncy Castle provider.");
+// Security.insertProviderAt(new BouncyCastleProvider(), Security
+// .getProviders().length);
+// }
storkOwnKeyStore = KeyStore.getInstance(properties
.getProperty(KEYSTORE_TYPE));