From e1fd69a9b21c409fd20f459115fd5577a9613174 Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Mon, 20 May 2013 22:18:48 -0400
Subject: [PATCH] Renamed SECURE_PORT into PKI_SECURE_PORT.

The SECURE_PORT variable in RA and TPS has been renamed into
PKI_SECURE_PORT to match the Tomcat-based subsystems.
---
 base/ra/apache/conf/nss.conf          | 4 ++--
 base/ra/shared/conf/CS.cfg.in         | 4 ++--
 base/setup/pkicreate                  | 9 ++++-----
 base/tps/apache/cgi-bin/sow/index.cgi | 4 ++--
 base/tps/apache/conf/nss.conf         | 4 ++--
 base/tps/setup/create.pl              | 2 +-
 base/tps/shared/conf/CS.cfg.in        | 4 ++--
 7 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/base/ra/apache/conf/nss.conf b/base/ra/apache/conf/nss.conf
index a3e0621ab1905313692501292e774471e8d11ac5..ccce188e346ca146100db5c1bc9a1860fd8584ed 100644
--- a/base/ra/apache/conf/nss.conf
+++ b/base/ra/apache/conf/nss.conf
@@ -15,7 +15,7 @@
 # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
 #       Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
 #
-Listen [SECURE_PORT]
+Listen [PKI_SECURE_PORT]
 
 Listen [NON_CLIENTAUTH_SECURE_PORT]
 
@@ -57,7 +57,7 @@ NSSSession3CacheTimeout 86400
 ## SSL Virtual Host Context
 ##
 
-<VirtualHost _default_:[SECURE_PORT]>
+<VirtualHost _default_:[PKI_SECURE_PORT]>
 
 #   General setup for the virtual host
 #DocumentRoot "/htdocs"
diff --git a/base/ra/shared/conf/CS.cfg.in b/base/ra/shared/conf/CS.cfg.in
index d904fa23c28bd42e615c8f1709f6d2dc2657854f..12c471b7d137315b539a093250cea828b239e50a 100644
--- a/base/ra/shared/conf/CS.cfg.in
+++ b/base/ra/shared/conf/CS.cfg.in
@@ -5,7 +5,7 @@ pidDir=[PKI_PIDDIR]
 pkicreate.pki_instance_root=[PKI_INSTANCE_ROOT]
 pkicreate.pki_instance_name=[PKI_INSTANCE_ID]
 pkicreate.subsystem_type=[PKI_SUBSYSTEM_TYPE]
-pkicreate.secure_port=[SECURE_PORT]
+pkicreate.secure_port=[PKI_SECURE_PORT]
 pkicreate.non_clientauth_secure_port=[NON_CLIENTAUTH_SECURE_PORT]
 pkicreate.unsecure_port=[PORT]
 pkicreate.user=[PKI_USER]
@@ -98,7 +98,7 @@ request.server.reject_request.num_plugins=0
 cs.type=RA
 service.machineName=[SERVER_NAME]
 service.instanceDir=[SERVER_ROOT]
-service.securePort=[SECURE_PORT]
+service.securePort=[PKI_SECURE_PORT]
 service.non_clientauth_securePort=[NON_CLIENTAUTH_SECURE_PORT]
 service.unsecurePort=[PORT]
 service.instanceID=[PKI_INSTANCE_ID]
diff --git a/base/setup/pkicreate b/base/setup/pkicreate
index a9ac1890e3656e82267892f00d611637e3d1e8b5..590db12dbdee3aeda43882ecd6e8956ca212c308 100755
--- a/base/setup/pkicreate
+++ b/base/setup/pkicreate
@@ -267,7 +267,6 @@ my $NSS_CONF                   = "NSS_CONF";
 my $OBJ_EXT                    = "OBJ_EXT";
 my $PORT                       = "PORT";
 my $PROCESS_ID                 = "PROCESS_ID";
-my $SECURE_PORT                = "SECURE_PORT";
 my $NON_CLIENTAUTH_SECURE_PORT = "NON_CLIENTAUTH_SECURE_PORT";
 my $SECURITY_LIBRARIES         = "SECURITY_LIBRARIES";
 my $SERVER_NAME                = "SERVER_NAME";
@@ -287,8 +286,9 @@ my $PKI_PIDDIR                 = "PKI_PIDDIR";
 my $PKI_LOCKDIR                = "PKI_LOCKDIR";
 
 # Template slot constants (CA, KRA, OCSP, TKS, RA, TPS)
-my $PKI_INSTANCE_ID_SLOT       = "PKI_INSTANCE_ID";
-my $PKI_REGISTRY_FILE_SLOT     = "PKI_REGISTRY_FILE";
+my $PKI_INSTANCE_ID_SLOT                = "PKI_INSTANCE_ID";
+my $PKI_REGISTRY_FILE_SLOT              = "PKI_REGISTRY_FILE";
+my $PKI_SECURE_PORT_SLOT                = "PKI_SECURE_PORT";
 
 # Template slot constants (CA, KRA, OCSP, TKS)
 my $INSTALL_TIME                        = "INSTALL_TIME";
@@ -300,7 +300,6 @@ my $PKI_INSTANCE_PATH_SLOT              = "PKI_INSTANCE_PATH";
 my $PKI_INSTANCE_ROOT_SLOT              = "PKI_INSTANCE_ROOT";
 my $PKI_MACHINE_NAME_SLOT               = "PKI_MACHINE_NAME";
 my $PKI_RANDOM_NUMBER_SLOT              = "PKI_RANDOM_NUMBER";
-my $PKI_SECURE_PORT_SLOT                = "PKI_SECURE_PORT";
 my $PKI_EE_SECURE_PORT_SLOT             = "PKI_EE_SECURE_PORT";
 my $PKI_EE_SECURE_CLIENT_AUTH_PORT_SLOT = "PKI_EE_SECURE_CLIENT_AUTH_PORT";
 my $PKI_EE_SECURE_CLIENT_AUTH_PORT_UI_SLOT = "PKI_EE_SECURE_CLIENT_AUTH_PORT_UI";
@@ -2274,7 +2273,7 @@ sub process_pki_templates
         $slot_hash{$OBJ_EXT}               = $obj_ext;
         $slot_hash{$PORT}                  = $unsecure_port;
         $slot_hash{$PROCESS_ID}            = $$;
-        $slot_hash{$SECURE_PORT}           = $secure_port;
+        $slot_hash{$PKI_SECURE_PORT_SLOT}  = $secure_port;
         $slot_hash{$NON_CLIENTAUTH_SECURE_PORT} = $non_clientauth_secure_port;
         $slot_hash{$SECURITY_LIBRARIES}    = $default_security_libraries;
         $slot_hash{$SERVER_NAME}           = $host;
diff --git a/base/tps/apache/cgi-bin/sow/index.cgi b/base/tps/apache/cgi-bin/sow/index.cgi
index 7f7a988696f1a94bb02bcad00b6e7997921f5a8c..a4f1c14a1008b5959fa1b4be56c44df594b7d58c 100755
--- a/base/tps/apache/cgi-bin/sow/index.cgi
+++ b/base/tps/apache/cgi-bin/sow/index.cgi
@@ -31,10 +31,10 @@ print "Fedora Project";   # Vendor
 print "</IssuerName>\n";
 print "<Services>";
 print "<Operation>";
-print "https://[SERVER_NAME]:[SECURE_PORT]/nk_service";
+print "https://[SERVER_NAME]:[PKI_SECURE_PORT]/nk_service";
 print "</Operation>";
 print "<UI>";
-print "https://[SERVER_NAME]:[SECURE_PORT]/cgi-bin/sow/search.cgi";
+print "https://[SERVER_NAME]:[PKI_SECURE_PORT]/cgi-bin/sow/search.cgi";
 print "</UI>";
 print "<EnrolledTokenBrowserURL>";
 print "</EnrolledTokenBrowserURL>";
diff --git a/base/tps/apache/conf/nss.conf b/base/tps/apache/conf/nss.conf
index 314df040d95856c151728aaf322757e5ee6d7421..69063f8b1764eb886d7efaf6f76fb27a447534f5 100644
--- a/base/tps/apache/conf/nss.conf
+++ b/base/tps/apache/conf/nss.conf
@@ -15,7 +15,7 @@
 # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
 #       Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
 #
-Listen [SECURE_PORT]
+Listen [PKI_SECURE_PORT]
 
 Listen [NON_CLIENTAUTH_SECURE_PORT]
 
@@ -57,7 +57,7 @@ NSSSession3CacheTimeout 86400
 ## SSL Virtual Host Context
 ##
 
-<VirtualHost _default_:[SECURE_PORT]>
+<VirtualHost _default_:[PKI_SECURE_PORT]>
 
 #   General setup for the virtual host
 #DocumentRoot "/htdocs"
diff --git a/base/tps/setup/create.pl b/base/tps/setup/create.pl
index e8da7d859b39076a9c88d3e6e6abae946a170882..feac2af8e7fe0e98adc360b8f6d8417b766bf584 100755
--- a/base/tps/setup/create.pl
+++ b/base/tps/setup/create.pl
@@ -678,7 +678,7 @@ sub CopyTemplate
     s/\[INSTANCE_ID\]/$instanceID/g;
     s/\[SERVER_NAME\]/$serverName/g;
     s/\[PORT\]/$port/g;
-    s/\[SECURE_PORT\]/$securePort/g;
+    s/\[PKI_SECURE_PORT\]/$securePort/g;
     s/\[NICKNAME\]/$nickName/g;
     s/\[USERID\]/$uid/g;
     s/\[GROUPID\]/$gid/g;
diff --git a/base/tps/shared/conf/CS.cfg.in b/base/tps/shared/conf/CS.cfg.in
index f2a8778d020f402a549935cd1239fb83e55a5cb8..3ed389138917439e18e0692afd7b7714d4fe5a66 100644
--- a/base/tps/shared/conf/CS.cfg.in
+++ b/base/tps/shared/conf/CS.cfg.in
@@ -5,7 +5,7 @@ pidDir=[PKI_PIDDIR]
 pkicreate.pki_instance_root=[PKI_INSTANCE_ROOT]
 pkicreate.pki_instance_name=[PKI_INSTANCE_ID]
 pkicreate.subsystem_type=[PKI_SUBSYSTEM_TYPE]
-pkicreate.secure_port=[SECURE_PORT]
+pkicreate.secure_port=[PKI_SECURE_PORT]
 pkicreate.non_clientauth_secure_port=[NON_CLIENTAUTH_SECURE_PORT]
 pkicreate.unsecure_port=[PORT]
 pkicreate.user=[PKI_USER]
@@ -34,7 +34,7 @@ selftests.plugin.TPSPresence.nickname=[HSM_LABEL][NICKNAME]
 selftests.plugin.TPSValidity.nickname=[HSM_LABEL][NICKNAME]
 service.machineName=[SERVER_NAME]
 service.instanceDir=[SERVER_ROOT]
-service.securePort=[SECURE_PORT]
+service.securePort=[PKI_SECURE_PORT]
 service.non_clientauth_securePort=[NON_CLIENTAUTH_SECURE_PORT]
 service.unsecurePort=[PORT]
 service.instanceID=[PKI_INSTANCE_ID]
-- 
1.8.1.4

