[java-identity-provider] 02/04: IDP-2136, IDP-2140 Windows Installer support
Rod Widdowson
rdw at steadingsoftware.com
Tue Jul 11 15:59:06 UTC 2023
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=3b53136eae1f9e80d862df03e577d2a91c2fee1f
commit 3b53136eae1f9e80d862df03e577d2a91c2fee1f
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Jul 6 10:56:40 2023 +0100
IDP-2136, IDP-2140 Windows Installer support
https://shibboleth.atlassian.net/browse/IDP-2136
https://shibboleth.atlassian.net/browse/IDP-2140
We generate a backchannel keystore (although the IdP actually doesn't
use it). Squirrel away the (probably generated) password into
the secrets.properties file in credentials.
---
.../idp/installer/impl/InstallerProperties.java | 2 --
.../shibboleth/idp/installer/impl/V5Install.java | 29 +++++++++++++---------
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java
index 668bb3659..570e765ce 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/InstallerProperties.java
@@ -25,8 +25,6 @@ import java.net.NetworkInterface;
import java.net.SocketException;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java
index ee7dd27f8..17825cc9a 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/V5Install.java
@@ -123,7 +123,7 @@ public class V5Install {
checkPreConditions();
enableCoreModules();
keyManager.execute();
- populatePropertyFiles(keyManager.isCreatedSealer());
+ populatePropertyFiles();
checkWebXml(installerProps.getTargetDir().resolve("edit-webapp").resolve("WEB-INF").resolve("web.xml"));
enableModules();
deleteSpuriousFiles();
@@ -195,7 +195,7 @@ public class V5Install {
* @param sealerCreated have we just created a sealer
* @return what we need to replace
*/
- private Properties getIdPReplacements(final boolean sealerCreated) {
+ private Properties getIdPReplacements() {
final Properties result = new Properties();
result.setProperty("idp.entityID", installerProps.getEntityID());
result.setProperty("idp.scope", installerProps.getScope());
@@ -203,11 +203,10 @@ public class V5Install {
}
/** Modify the idp.properties and ldap.properties, then create secrets.properties.
- * @param sealerCreated have we just created a sealer
* @throws BuildException if badness occurs
*/
// CheckStyle: CyclomaticComplexity|MethodLength OFF
- protected void populatePropertyFiles(final boolean sealerCreated) throws BuildException {
+ protected void populatePropertyFiles() throws BuildException {
@Nonnull final Set<String> doNotReplaceList = CollectionSupport.setOf(
"idp.sealer.storePassword",
@@ -237,7 +236,7 @@ public class V5Install {
replacements.load(stream);
}
} else {
- replacements = getIdPReplacements(sealerCreated);
+ replacements = getIdPReplacements();
log.debug("Updating {} from {}", target, replacements.keySet());
}
try (final FileInputStream stream = new FileInputStream(target.toFile())) {
@@ -296,31 +295,38 @@ public class V5Install {
out.write("# Access to internal AES encryption key");
out.newLine();
final String password;
- if (sealerCreated) {
+ if (keyManager.isCreatedSealer()) {
password = installerProps.getSealerPassword();
} else {
password = "password";
}
- out.write("idp.sealer.storePassword = " + password);
+ out.write("idp.sealer.storePassword =" + password);
out.newLine();
- out.write("idp.sealer.keyPassword = " + password);
+ out.write("idp.sealer.keyPassword =" + password);
out.newLine();
out.newLine();
+ if (keyManager.isCreatedBackchannel()) {
+ out.write("# Password for idp-backchannel.p12 ");
+ out.newLine();
+ out.write("idp.backchannel.keyStorePassword =" + installerProps.getKeyStorePassword());
+ out.newLine();
+ out.newLine();
+ }
String ldapPassword = installerProps.getLDAPPassword();
if (null == ldapPassword) {
ldapPassword = "myServicePassword";
}
out.write("# Default access to LDAP authn and attribute stores. ");
out.newLine();
- out.write("idp.authn.LDAP.bindDNCredential = " + ldapPassword);
+ out.write("idp.authn.LDAP.bindDNCredential =" + ldapPassword);
out.newLine();
out.write("idp.attribute.resolver.LDAP.bindDNCredential " +
- "= %{idp.authn.LDAP.bindDNCredential:undefined}");
+ "=%{idp.authn.LDAP.bindDNCredential:undefined}");
out.newLine();
out.newLine();
out.write("# Salt used to generate persistent/pairwise IDs, must be kept secret");
out.newLine();
- out.write("#idp.persistentId.salt = changethistosomethingrandom");
+ out.write("#idp.persistentId.salt =changethistosomethingrandom");
out.newLine();
} catch (final IOException e) {
throw new BuildException("Failed to generate secrets.properties", e);
@@ -695,7 +701,6 @@ public class V5Install {
/** Did we create idp-backchannel.*?
* @return whether we did
*/
- @SuppressWarnings("unused")
public boolean isCreatedBackchannel() {
return createdBackchannel;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list