summaryrefslogtreecommitdiffstats
path: root/pki/base/ra/lib/perl
diff options
context:
space:
mode:
authoralee <alee@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-06-10 18:40:50 +0000
committeralee <alee@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-06-10 18:40:50 +0000
commit9b418853f5c6a7d5f10388f4b69c409f2976ad5e (patch)
tree4712dcd38dc40fbbddcd1173063d82370b7e9e5a /pki/base/ra/lib/perl
parentd15642b1bd181454a822d8dfc16923373434093a (diff)
downloadpki-9b418853f5c6a7d5f10388f4b69c409f2976ad5e.tar.gz
pki-9b418853f5c6a7d5f10388f4b69c409f2976ad5e.tar.xz
pki-9b418853f5c6a7d5f10388f4b69c409f2976ad5e.zip
Bugzilla Bug #504898 - RA: agent unable to revoke a cert
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@578 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/ra/lib/perl')
-rw-r--r--pki/base/ra/lib/perl/PKI/Conn/CA.pm2
-rwxr-xr-xpki/base/ra/lib/perl/PKI/RA/CAInfoPanel.pm57
2 files changed, 52 insertions, 7 deletions
diff --git a/pki/base/ra/lib/perl/PKI/Conn/CA.pm b/pki/base/ra/lib/perl/PKI/Conn/CA.pm
index 799df8c00..b8cd7813b 100644
--- a/pki/base/ra/lib/perl/PKI/Conn/CA.pm
+++ b/pki/base/ra/lib/perl/PKI/Conn/CA.pm
@@ -163,7 +163,7 @@ sub revoke {
$db_password =~ s/\n$//g;
my $nickname = $cfg->get("conn." . $con_id . ".clientNickname");
- my $cahostport = $cfg->get("conn." . $con_id . ".hostport");
+ my $cahostport = $cfg->get("conn." . $con_id . ".hostagentport");
my $tmpfile = "/tmp/tmp-revoke-$serialno-$$";
my ($host, $port) = split(/:/, $cahostport);
diff --git a/pki/base/ra/lib/perl/PKI/RA/CAInfoPanel.pm b/pki/base/ra/lib/perl/PKI/RA/CAInfoPanel.pm
index b2d235eaa..d06e3daca 100755
--- a/pki/base/ra/lib/perl/PKI/RA/CAInfoPanel.pm
+++ b/pki/base/ra/lib/perl/PKI/RA/CAInfoPanel.pm
@@ -85,25 +85,35 @@ sub update
my $instanceID = $::config->get("service.instanceID");
my $host = "";
my $https_ee_port = "";
+ my $https_agent_port = "";
my $https_admin_port = "";
+ my $domain_xml = "";
if ($count =~ /http/) {
my $info = new URI::URL($count);
$host = $info->host;
$https_ee_port = $info->port;
- $https_admin_port = get_secure_admin_port_from_domain_xml($host,
- $https_ee_port);
- if( $https_admin_port eq "" ) {
- $::symbol{errorString} = "missing secure CA admin port. CA must be installed prior to RA installation";
+ $domain_xml = get_domain_xml($host, $https_ee_port);
+ if ($domain_xml eq "") {
+ $::symbol{errorString} = "missing security domain. CA must be installed prior to RA installation";
+ return 0;
+ }
+
+ $https_agent_port = get_secure_agent_port_from_domain_xml($domain_xml, $host, $https_ee_port);
+ $https_admin_port = get_secure_admin_port_from_domain_xml($domain_xml, $host, $https_ee_port);
+
+ if(($https_admin_port eq "") || ($https_agent_port eq "")) {
+ $::symbol{errorString} = "missing secure CA admin or agent port. CA must be installed prior to RA installation";
return 0;
}
} else {
$host = $::config->get("preop.securitydomain.ca$count.host");
$https_ee_port = $::config->get("preop.securitydomain.ca$count.secureport");
+ $https_agent_port = $::config->get("preop.securitydomain.ca$count.secureagentport");
$https_admin_port = $::config->get("preop.securitydomain.ca$count.secureadminport");
}
- if (($host eq "") || ($https_ee_port eq "") || ($https_admin_port eq "")) {
+ if (($host eq "") || ($https_ee_port eq "") || ($https_admin_port eq "") || ($https_agent_port eq "")) {
$::symbol{errorString} = "no CA found. CA must be installed prior to RA installation";
return 0;
}
@@ -116,6 +126,7 @@ sub update
my $subsystemCertNickName = $::config->get("preop.cert.subsystem.nickname");
$::config->put("conn.ca1.clientNickname", $subsystemCertNickName);
$::config->put("conn.ca1.hostport", $host . ":" . $https_ee_port);
+ $::config->put("conn.ca1.hostagentport", $host . ":" . $https_agent_port);
$::config->put("conn.ca1.hostadminport", $host . ":" . $https_admin_port);
$::config->commit();
@@ -200,7 +211,7 @@ DONE:
return 1;
}
-sub get_secure_admin_port_from_domain_xml
+sub get_domain_xml
{
my $host = $1;
my $https_ee_port = $2;
@@ -220,6 +231,14 @@ sub get_secure_admin_port_from_domain_xml
$content =~ /(\<XMLResponse\>.*\<\/XMLResponse\>)/;
$content = $1;
+ return $content;
+}
+
+sub get_secure_admin_port_from_domain_xml
+{
+ my $content = $1;
+ my $host = $2;
+ my $https_ee_port = $3;
# Retrieve the secure admin port corresponding
# to the selected host and secure ee port.
@@ -241,4 +260,30 @@ sub get_secure_admin_port_from_domain_xml
return $https_admin_port;
}
+sub get_secure_agent_port_from_domain_xml
+{
+ my $content = $1;
+ my $host = $2;
+ my $https_ee_port = $3;
+
+ # Retrieve the secure agent port corresponding
+ # to the selected host and secure ee port.
+ my $parser = XML::Simple->new();
+ my $response = $parser->XMLin($content);
+ my $xml = $parser->XMLin( $response->{'DomainInfo'},
+ ForceArray => 1 );
+ my $https_agent_port = "";
+ my $count = 0;
+ foreach my $c (@{$xml->{'CAList'}[0]->{'CA'}}) {
+ if( ( $host eq $c->{'Host'}[0] ) &&
+ ( $https_ee_port eq $c->{'SecurePort'}[0] ) ) {
+ $https_agent_port = https_$c->{'SecureAgentPort'}[0];
+ }
+
+ $count++;
+ }
+
+ return $https_agent_port;
+}
+
1;