Commit 66b084ca authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Minor fix to previous revision; The fast path was not getting the uuid

correctly in all cases.
parent 48d20be9
......@@ -666,7 +666,7 @@ sub LoadFromStringFast($$)
}
#
# The certificate might already have the header and footer
# so only add them if needed. This is for backwards compatibility
# So only add them if needed. This is for backwards compatibility
# with early code that stripped the header and footer strings. Dumb.
#
if ($string !~ /^-----BEGIN CERTIFICATE-----/) {
......@@ -705,10 +705,14 @@ sub LoadFromStringFast($$)
return undef;
}
foreach my $tmp (@{ $decoded->SubjectAltName }) {
print STDERR "$tmp\n";
if ($tmp =~ /^uniformResourceIdentifier=(urn:publicid:.*)$/ ||
$tmp =~ /^(urn:publicid:.*)$/) {
$urn = $1;
}
elsif ($tmp =~ /^uniformResourceIdentifier=urn:uuid:([-\w]+)$/) {
$uuid = $1;
}
}
# Ditto if the SubjectAltName does not have a URN in it.
if (!defined($urn) || !GeniHRN::IsValid($urn)) {
......
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