Commit 4c2cfe67 authored by Leigh B Stoller's avatar Leigh B Stoller

Fix how we store chained certs in tickets.

parent e92c073a
#!/usr/bin/perl -wT
#
# Copyright (c) 2008-2013 University of Utah and the Flux Group.
# Copyright (c) 2008-2014 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -662,9 +662,7 @@ sub PipeTo($$$)
#
# Write the certificate to the child.
#
print CHILD "-----BEGIN CERTIFICATE-----\n";
print CHILD $self->cert();
print CHILD "-----END CERTIFICATE-----\n";
print CHILD $self->toString();
if ($withkey && $self->privkey()) {
print CHILD "-----BEGIN RSA PRIVATE KEY-----\n";
print CHILD $self->privkey();
......@@ -732,9 +730,7 @@ sub WriteToFile($;$)
# We want this file to be passed back.
my ($tempfile, $filename) = tempfile(UNLINK => 1);
print $tempfile "-----BEGIN CERTIFICATE-----\n";
print $tempfile $self->cert();
print $tempfile "-----END CERTIFICATE-----\n";
print $tempfile $self->toString();
if ($withkey && $self->privkey()) {
print $tempfile "-----BEGIN RSA PRIVATE KEY-----\n";
......@@ -752,6 +748,18 @@ sub WriteToFile($;$)
return $filename;
}
sub toString($)
{
my ($self) = @_;
my $string = "";
$string .= "-----BEGIN CERTIFICATE-----\n";
$string .= $self->cert();
$string .= "-----END CERTIFICATE-----\n";
return $string;
}
#
# The URL is buried in an extension so we have to parse the text output.
#
......@@ -1250,7 +1258,8 @@ sub URL($) { return undef; }
sub URN($) { return field($_[0], "urn"); }
sub certfile($) { return undef; }
sub GetCertificate($) { return $_[0]; }
sub WriteToFile($$) { return GeniCertificate::WriteToFile($_[0], $_[1]); }
sub WriteToFile($$) { return GeniCertificate::WriteToFile($_[0], $_[1]); }
sub toString($) { return GeniCertificate::toString($_[0]); }
#
# Need to add DN to the emulab table.
#
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2008-2013 University of Utah and the Flux Group.
# Copyright (c) 2008-2014 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -766,8 +766,8 @@ sub RunSigner($$)
my $idx = $self->seqno();
my $expires = $self->redeem_before();
my $target_cert = $self->target_cert()->cert();
my $owner_cert = $self->owner_cert()->cert();
my $target_cert = $self->target_cert()->toString();
my $owner_cert = $self->owner_cert()->toString();
my $ticket_uuid = $self->{'ticket_uuid'};
my $rspec_xml = GeniXML::Serialize($self->rspec());
......
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