From 9c3e585ae89c20fb3bd6fe1c577d29d5937da36c Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Fri, 24 May 2013 02:34:13 -0400
Subject: [PATCH] Renamed CA_PORT into PKI_CA_PORT.

The CA_PORT variable has been renamed into PKI_CA_PORT for
consistency.
---
 base/ra/shared/conf/CS.cfg.in       | 2 +-
 base/server/config/pkislots.cfg     | 1 +
 base/server/etc/default.cfg         | 1 +
 base/server/src/engine/pkiparser.py | 2 ++
 base/tps/setup/create.pl            | 6 +++---
 base/tps/shared/conf/CS.cfg.in      | 2 +-
 6 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/base/ra/shared/conf/CS.cfg.in b/base/ra/shared/conf/CS.cfg.in
index 3a2a11af06de63c46435a6d6a7373e70bafbe091..227b117ce5e4ade8b3a283d4d0990f055b1c470f 100644
--- a/base/ra/shared/conf/CS.cfg.in
+++ b/base/ra/shared/conf/CS.cfg.in
@@ -179,7 +179,7 @@ conn.ca1._020=# where
 conn.ca1._021=#  <n>  - CA connection ID
 conn.ca1._022=#########################################
 failover.pod.enable=false
-conn.ca1.hostport=[PKI_CA_HOSTNAME]:[CA_PORT]
+conn.ca1.hostport=[PKI_CA_HOSTNAME]:[PKI_CA_PORT]
 conn.ca1.clientNickname=[HSM_LABEL][NICKNAME]
 conn.ca1.servlet.enrollment=/ca/ee/ca/profileSubmitSSLClient
 conn.ca1.servlet.addagent=/ca/admin/ca/registerRaUser
diff --git a/base/server/config/pkislots.cfg b/base/server/config/pkislots.cfg
index 56a3fc47cd207a8b0b37e9fff79ae91d85d8c168..0b239020fe67ac89b6b1f521bffd1d0e54d729d3 100644
--- a/base/server/config/pkislots.cfg
+++ b/base/server/config/pkislots.cfg
@@ -38,6 +38,7 @@ PKI_AGENT_SECURE_PORT_SLOT=[PKI_AGENT_SECURE_PORT]
 PKI_AJP_PORT_SLOT=[PKI_AJP_PORT]
 PKI_AJP_REDIRECT_PORT_SLOT=[PKI_AJP_REDIRECT_PORT]
 PKI_CA_HOSTNAME_SLOT=[PKI_CA_HOSTNAME]
+PKI_CA_PORT_SLOT=[PKI_CA_PORT]
 PKI_CERT_DB_PASSWORD_SLOT=[PKI_CERT_DB_PASSWORD]
 PKI_CFG_PATH_NAME_SLOT=[PKI_CFG_PATH_NAME]
 PKI_CLOSE_AJP_PORT_COMMENT_SLOT=[PKI_CLOSE_AJP_PORT_COMMENT]
diff --git a/base/server/etc/default.cfg b/base/server/etc/default.cfg
index 9e92f53a77f5d55a4c151e015afd2ae603754af4..b2af83857378c21c83bd407d335cd112c73915ce 100644
--- a/base/server/etc/default.cfg
+++ b/base/server/etc/default.cfg
@@ -80,6 +80,7 @@ pki_audit_signing_token=Internal Key Storage Token
 pki_backup_keys=False
 pki_backup_password=
 pki_ca_hostname=%(pki_security_domain_hostname)s
+pki_ca_port=%(pki_security_domain_https_port)s
 pki_client_admin_cert_p12=%(pki_client_dir)s/%(pki_subsystem_type)s_admin_cert.p12
 pki_client_database_password=
 pki_client_database_purge=True
diff --git a/base/server/src/engine/pkiparser.py b/base/server/src/engine/pkiparser.py
index cb202dd6be1ffca4efd221c788cd9cf1b533285a..99c8855b935ade8af08320d87420729b8c8e5c93 100644
--- a/base/server/src/engine/pkiparser.py
+++ b/base/server/src/engine/pkiparser.py
@@ -656,6 +656,8 @@ class PKIConfigParser:
                     config.pki_master_dict['pki_https_port']
                 config.pki_master_dict['PKI_CA_HOSTNAME_SLOT'] =\
                     config.pki_master_dict['pki_ca_hostname']
+                config.pki_master_dict['PKI_CA_PORT_SLOT'] =\
+                    config.pki_master_dict['pki_ca_port']
                 config.pki_master_dict['PKI_CERT_DB_PASSWORD_SLOT'] =\
                     config.pki_master_dict['pki_pin']
                 config.pki_master_dict['PKI_CFG_PATH_NAME_SLOT'] =\
diff --git a/base/tps/setup/create.pl b/base/tps/setup/create.pl
index 4b88bc6cd615461e5788deae0b92f1e7b06df1d3..11efe36f09f8b0182768f0a37d81660c069a783f 100755
--- a/base/tps/setup/create.pl
+++ b/base/tps/setup/create.pl
@@ -298,14 +298,14 @@ ASK_PKI_CA_HOSTNAME:
     goto ASK_PKI_CA_HOSTNAME;
   }
 
-ASK_CA_PORT:
+ASK_PKI_CA_PORT:
   print ("Enter the secure end entity port number of the CA [443]: ");
   chomp ($caPort = <STDIN>);
   if ($caPort eq "") {
     $caPort = "443";
   }
   if ($caPort eq "") {
-    goto ASK_CA_PORT;
+    goto ASK_PKI_CA_PORT;
   }
 
   print ("\n");
@@ -693,7 +693,7 @@ sub CopyTemplate
     s/\[TUS_ROOT\]/$tusRoot/g;
     s/\[TUS_PASS\]/$tusPass/g;
     s/\[PKI_CA_HOSTNAME\]/$caHost/g;
-    s/\[CA_PORT\]/$caPort/g;
+    s/\[PKI_CA_PORT\]/$caPort/g;
     s/\[DRM_HOST\]/$drmHost/g;
     s/\[DRM_PORT\]/$drmPort/g;
     s/\[SERVER_KEYGEN\]/$serverKeyGen/g;
diff --git a/base/tps/shared/conf/CS.cfg.in b/base/tps/shared/conf/CS.cfg.in
index fcf817695438992e26df6d849001fd5d95df3c8e..d5c0f312eae005f29443dd6e0fc04c71d9efb0dd 100644
--- a/base/tps/shared/conf/CS.cfg.in
+++ b/base/tps/shared/conf/CS.cfg.in
@@ -150,7 +150,7 @@ conn.ca1._028=# where
 conn.ca1._029=#  <n>  - CA connection ID
 conn.ca1._030=#########################################
 failover.pod.enable=false
-conn.ca1.hostport=[PKI_CA_HOSTNAME]:[CA_PORT]
+conn.ca1.hostport=[PKI_CA_HOSTNAME]:[PKI_CA_PORT]
 conn.ca1.clientNickname=[HSM_LABEL][NICKNAME]
 conn.ca1.servlet.enrollment=/ca/ee/ca/profileSubmitSSLClient
 conn.ca1.servlet.renewal=/ca/ee/ca/profileSubmitSSLClient
-- 
1.8.1.4

