Commit d7708bbc authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add toplevel rspec element to disable root keys, as per issue #302.

parent 0413055e
......@@ -804,6 +804,11 @@ sub GetTicketAuxAux($$$$$$$$$$$)
#
my $packing_option = GeniXML::PackingStrategy($rspec);
#
# Global root keys disable.
#
my $disablerootkeys = GeniXML::DisableRootKey($rspec);
#
# User can turn off routing.
#
......@@ -1604,18 +1609,25 @@ sub GetTicketAuxAux($$$$$$$$$$$)
}
}
# Root keys.
my ($pubkey,$privkey) = GeniXML::GetRootKey($ref);
if (defined($pubkey)) {
$nodeblob->{"rootkey_public"} = $pubkey;
}
else {
$nodeblob->{"rootkey_public"} = -1; # means did not specify.
}
if (defined($privkey)) {
$nodeblob->{"rootkey_private"} = $privkey;
if ($disablerootkeys) {
# Top level override;
$nodeblob->{"rootkey_public"} = 0;
$nodeblob->{"rootkey_private"} = 0;
}
else {
$nodeblob->{"rootkey_private"} = -1; # means did not specify.
my ($pubkey,$privkey) = GeniXML::GetRootKey($ref);
if (defined($pubkey)) {
$nodeblob->{"rootkey_public"} = $pubkey;
}
else {
$nodeblob->{"rootkey_public"} = -1; # means did not specify.
}
if (defined($privkey)) {
$nodeblob->{"rootkey_private"} = $privkey;
}
else {
$nodeblob->{"rootkey_private"} = -1; # means did not specify.
}
}
# Program agents.
......
......@@ -773,6 +773,20 @@ sub GetRootKey($)
return ($pub,$priv);
}
#
# Are keys disabled at top level.
#
sub DisableRootKey($)
{
my ($rspec) = @_;
my $keyref = GeniXML::FindNodesNS("n:disablerootkey", $rspec,
$EMULAB_NS)->pop();
return 0
if (!defined($keyref));
return 1;
}
sub GetTarball($)
{
my ($node) = @_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment