Skip to content

Commit

Permalink
Removed several unused targets from security_all
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Nov 13, 2023
1 parent 5170f80 commit 0a0f930
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 94 deletions.
Expand Up @@ -70,7 +70,7 @@
<antcall target="deploy-war-common"/>
</target>

<target name="run" depends="init-common,init-security-util">
<target name="run" depends="init-common">
<java classname="devtests.security.WebSSLClient">
<sysproperty key="javax.net.debug1" value="ssl,handshake,data,trustmanager" />
<sysproperty key="sun.security.ssl.allowUnsafeRenegotiation" value="true" />
Expand All @@ -96,7 +96,6 @@
</target>

<target name="setup" depends="init-common,prepare-store-common">
<antcall target="env-check" />
<copy file="${assemble.dir}/test-${appname}.jar"
todir="${env.S1AS_HOME}/lib"/>
<copy file="${admin.domain.dir}/${admin.domain}/config/login.conf"
Expand Down
87 changes: 4 additions & 83 deletions appserver/tests/appserv-tests/devtests/security/common.xml
Expand Up @@ -27,17 +27,6 @@
<isset property="env.WSIMPORT_OPTS" />
</condition>

<target name="init-security-util" depends="gethostname">
<!-- <ant dir="${env.APS_HOME}/devtests/security/util" target="all"/>
<taskdef name="s1asCN" classname="devtests.security.util.S1ASCN" classpath="${env.APS_HOME}/devtests/security/util/build:${env.S1AS_HOME}/lib/appserv-rt.jar"/>
<s1asCN/>
<echo message="s1as CN = ${s1asCN}"/> -->
</target>
<target name="gethostname">
<exec executable="hostname" osfamily="unix" failifexecutionfails="false" outputproperty="env.COMPUTERNAME"/>
<property name="s1asCN" value="${env.COMPUTERNAME}" />
<echo message="s1as CN = ${s1asCN}"/>
</target>
<!-- Create auth realm -->
<target name="create-auth-realm" depends="init-common">
<echo message="Creating auth realm ${realmname} ..."/>
Expand Down Expand Up @@ -81,23 +70,8 @@
</antcall>
</target>

<target name="env-check" depends="init-common">
<!--
Determine if we need to use the certutil or the keytool command to
access the certificate truststore
-->
<property name="nss.db.dir" location="${admin.domain.dir}/${admin.domain}/config"/>
<condition property="isNSS">
<and>
<available file="${nss.db.dir}/cert8.db"/>
<available file="${nss.db.dir}/key3.db"/>
<available file="${nss.db.dir}/secmod.db"/>
</and>
</condition>
</target>

<!-- this target parpare stores with client and server have different keys -->
<target name="prepare-store-common" depends="env-check">
<target name="prepare-store-common">
<property name="cert.rfc.file" location="${build.base.dir}/${cert.nickname}.rfc"/>
<property name="keycert.rfc.file" location="${build.base.dir}/ssltest.rfc"/>
<delete quiet="true" file="${mytruststore.db.file}"/>
Expand All @@ -106,46 +80,9 @@
<delete quiet="true" file="${keycert.rfc.file}"/>

<mkdir dir="${build.base.dir}"/>
<antcall target="prepare-store-certutil-common"/>
<antcall target="prepare-store-keytool-common"/>
</target>

<target name="prepare-store-certutil-common" depends="init-common" if="isNSS">
<exec executable="${env.S1AS_HOME}/lib/certutil" failonerror="true" output="${cert.rfc.file}">
<!--
LD_LIBRARY_PATH is needed on Unix platforms and should have no
effect on Windows
-->
<env key="LD_LIBRARY_PATH" path="${env.S1AS_HOME}/lib"/>
<arg line="-L -n '${cert.nickname}' -a"/>
<arg value="-d"/>
<arg file="${nss.db.dir}"/>
</exec>
<antcall target="import-cert-jks">
<param name="cert.alias" value="${cert.nickname}"/>
<param name="keystore.file" value="${mytruststore.db.file}"/>
<param name="cert.file" value="${cert.rfc.file}"/>
</antcall>

<antcall target="generate-jks-key"/>
<exec executable="${java.home}/bin/keytool" failonerror="true">
<arg line="-export -rfc -alias ssltest -file ${keycert.rfc.file} -keystore ${mykeystore.db.file} -storepass ${ssl.password}"/>
</exec>

<exec executable="${env.S1AS_HOME}/lib/certutil" failonerror="true">
<!--
LD_LIBRARY_PATH is needed on Unix platforms and should have no
effect on Windows
-->
<env key="LD_LIBRARY_PATH" path="${env.S1AS_HOME}/lib"/>
<arg line="-A -n ssltest -i ${keycert.rfc.file} -a"/>
<arg value="-t"/>
<arg value="P,p,p"/>
<arg value="-d"/>
<arg file="${nss.db.dir}"/>
</exec>
</target>

<target name="prepare-store-keytool-common" depends="init-common" unless="isNSS">
<copy file="${admin.domain.dir}/${admin.domain}/config/cacerts.jks" tofile="${mytruststore.db.file}"/>
<antcall target="generate-jks-key"/>
Expand Down Expand Up @@ -180,29 +117,13 @@
</exec>
</target>

<target name="remove-store-common" depends="env-check">
<target name="remove-store-common">
<property name="keycert.rfc.file" location="${build.base.dir}/ssltest.rfc"/>

<delete quiet="true" file="${mykeystore.db.file}"/>
<delete quiet="true" file="${keycert.rfc.file}"/>

<antcall target="remove-store-certutil-common"/>
<antcall target="remove-store-keytool-common"/>
</target>

<target name="remove-store-certutil-common" depends="init-common" if="isNSS">
<exec executable="${env.S1AS_HOME}/lib/certutil" failonerror="true">
<!--
LD_LIBRARY_PATH is needed on Unix platforms and should have no
effect on Windows
-->
<env key="LD_LIBRARY_PATH" path="${env.S1AS_HOME}/lib"/>
<arg line="-D -n ssltest "/>
<arg value="-d"/>
<arg file="${nss.db.dir}"/>
</exec>
</target>

<target name="remove-store-keytool-common" depends="init-common" unless="isNSS">
<exec executable="${java.home}/bin/keytool" failonerror="true">
<arg line="-delete -alias ssltest -storepass '${ssl.password}'"/>
Expand All @@ -211,8 +132,8 @@
</exec>
</target>

<!-- this target parpare stores with client and server have the same key -->
<target name="prepare-store-nickname-common" depends="env-check">
<!-- this target prepare stores with client and server have the same key -->
<target name="prepare-store-nickname-common">
<property name="cert.rfc.file" location="${build.base.dir}/${cert.nickname}.rfc"/>
<property name="keycert.rfc.file" location="${build.base.dir}/ssltest.rfc"/>
<delete quiet="true" file="${mytruststore.db.file}"/>
Expand Down
Expand Up @@ -88,7 +88,7 @@
<!-- =============================================== -->
<!-- Target to run the standalone client without ACC -->
<!-- =============================================== -->
<target name="run-standalone-client" depends="init-common,init-security-util">
<target name="run-standalone-client" depends="init-common">
<property name="jndi.name" value="SSLconverter"/>
<property name="provider.url" value="iiop://${s1asCN}:${orb.port}"/>
<property name="ctxfactory"
Expand Down
Expand Up @@ -65,7 +65,7 @@
<delete file="${env.S1AS_HOME}/lib/test-${appname}-provider.jar" failonerror="false"/>
</target>

<target name="build" depends="init-common, init-security-util">
<target name="build" depends="init-common">
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
</antcall>
Expand All @@ -91,7 +91,7 @@
<antcall target="undeploy-war-common"/>
</target>

<target name="run" depends="init-common, init-security-util">
<target name="run" depends="init-common">
<java classname="com.sun.s1asdev.security.jmac.https.WebSSLClient" fork="true">
<!--jvmarg value="-Djavax.net.debug=all" -->
<jvmarg value="-Djavax.net.ssl.keyStore=${mykeystore.db.file}"/>
Expand Down
Expand Up @@ -49,7 +49,7 @@
<antcall target="all-ssl"/>
</target>

<target name="all-reg" depends="init-common,env-check">
<target name="all-reg" depends="init-common">
<antcall target="setup"/>
<antcall target="build"/>
<antcall target="deploy"/>
Expand All @@ -58,7 +58,7 @@
<antcall target="unsetup"/>
</target>

<target name="all-ssl" depends="init-common,env-check">
<target name="all-ssl" depends="init-common">
<antcall target="setup-ssl"/>
<antcall target="build"/>
<antcall target="deploy"/>
Expand Down Expand Up @@ -272,12 +272,12 @@
</antcall>
</target>

<target name="setup-ssl" depends="init-common,env-check">
<target name="setup-ssl" depends="init-common">
<!-- <antcall target="import-ldap-server-cert"/>-->
<antcall target="create-auth-ldaprealm-ssl"/>
<antcall target="create-ldap-usrgrps"/>
</target>
<target name="unsetup-ssl" depends="init-common,env-check">
<target name="unsetup-ssl" depends="init-common">
<!-- <antcall target="delete-ldap-server-cert"/>-->
<antcall target="delete-auth-ldaprealm"/>
<antcall target="delete-ldap-usrgrps"/>
Expand Down
Expand Up @@ -67,7 +67,7 @@
<antcall target="deploy-war-common"/>
</target>

<target name="run" depends="init-common,init-security-util">
<target name="run" depends="init-common">
<!-- <property name="myhttps.host" value="localhost"/>
<property name="myhttps.port" value="8181"/> -->
<java classname="devtests.security.WebSSLClient">
Expand Down Expand Up @@ -95,7 +95,6 @@
</target>

<target name="setup" depends="init-common,prepare-store-common">
<antcall target="env-check" />
<antcall target="generate-ca-client-certs-pe" />
<antcall target="generate-ca-client-certs-ee" />
<antcall target="restart-server-instance-common"/>
Expand Down

0 comments on commit 0a0f930

Please sign in to comment.