summaryrefslogtreecommitdiff
path: root/bin/bbstored/bbstored-certs.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bbstored/bbstored-certs.in')
-rwxr-xr-xbin/bbstored/bbstored-certs.in8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/bbstored/bbstored-certs.in b/bin/bbstored/bbstored-certs.in
index 0f6b9b27..00085662 100755
--- a/bin/bbstored/bbstored-certs.in
+++ b/bin/bbstored/bbstored-certs.in
@@ -171,6 +171,12 @@ sub cmd_sign
my $acc = $1;
+ # check against filename
+ if(!($csr =~ m/(\A|\/)([A-Fa-f0-9]+)-/) || $2 ne $acc)
+ {
+ die "Certificate request filename does not match name in certificate ($common_name)"
+ }
+
print <<__E;
This certificate is for backup account
@@ -282,7 +288,7 @@ sub get_csr_common_name
my $subject;
while(<CSRTEXT>)
{
- $subject = $1 if m/Subject:.+?CN\s?=\s?([-\.\w]+)/
+ $subject = $1 if m/Subject:.+?CN\s?=\s?([-\.\w]+)/;
}
close CSRTEXT;